Ruler Object Library: 4.4 Managing Rulers: Guide Constraints and Guidelines

Up: GEOS SDK TechDocs | Up | Prev: 4.3 Grid Spacing and Constraint | Next: 4.5 Other Mouse Constraints

Sometimes the user will want to have some guidelines that do not conform to a regular grid. The user may set up their own guidelines. Normally to allow the use of guidelines, your application should include a RulerGuideControl object. The features structures for this controller class are shown below.

Code Display 19-6 RulerGuideControlClass Features

typedef WordFlags  RulerGuideControlFeatures; 
#define  RGCF_HV 			(0x08)
#define RGCF_LIST 			(0x04)
#define RGCF_POSITION 			(0x02)
#define RGCF_DELETE 			(0x01)
#define  RULER_GUIDE_CONTROL_DEFAULT_FEATURES \
			(RGCF_HV | RGCF_LIST | RGCF_POSITION | RGCF_DELETE)

The following messages allow for the use and manipulation of guidelines.

MSG_VIS_RULER_TURN_GUIDES_SNAPPING_ON

void MSG_VIS_RULER_TURN_GUIDES_SNAPPING_ON();

Set the default VisRulerConstrainStrategy to include guides snapping, turning on the VRCS_SNAP_TO_GUIDES_X and VRCS_SNAP_TO_GUIDES_Y flags.

MSG_VIS_RULER_TURN_GUIDES_SNAPPING_OFF

void MSG_VIS_RULER_TURN_GUIDES_SNAPPING_OFF();

Set the default VisRulerConstrainStrategy to not include guides snapping, turning off the VRCS_SNAP_TO_GUIDES_X and VRCS_SNAP_TO_GUIDES_Y flags.

MSG_VIS_RULER_CREATE_GUIDE_ARRAY

void MSG_VIS_RULER_CREATE_GUIDE_ARRAY();

By default, the VisRuler stores its guides in a chunk array, known as a guide array. If the ruler has no guides defined, it doesn't bother keeping this data structure around. When the first guide is created, the VisRuler will send itself this message, to which it will respond by setting up the data region.

Subclasses might intercept this message if they have data structures which need initializing when the first guide is created.

MSG_VIS_RULER_ADD_HORIZONTAL_GUIDE

void MSG_VIS_RULER_ADD_HORIZONTAL_GUIDE( @stack
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to add a horizontal guide.

MSG_VIS_RULER_ADD_VERTICAL_GUIDE

void MSG_VIS_RULER_ADD_VERTICAL_GUIDE( @stack
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to add a vertical guide.

MSG_VIS_RULER_DRAW_GUIDES

void MSG_VIS_RULER_DRAW_GUIDES(
        GStateHandle gstate);

Use this message to draw guidelines to a document. The default VisRuler handler for this message will draw the lines at the appropriate coordinates to the passed GState.

MSG_VIS_RULER_DRAW_GUIDE_INDICATORS

void MSG_VIS_RULER_DRAW_GUIDE_INDICATORS();

This message asks the VisRuler to draw tick-marks on itself to show the positions of guides. The default VisRuler has no handler for this message; subclasses are welcome to intersect it and draw indicators appropriately.

MSG_VIS_RULER_SNAP_TO_GUIDES

void MSG_VIS_RULER_SNAP_TO_GUIDES(
        PointDWFixed _far* point);

Use this message to snap the passed point to the guides.

MSG_VIS_RULER_SNAP_TO_GUIDES_X

void MSG_VIS_RULER_SNAP_TO_GUIDES_X(
        PointDWFixed _far* point);

Use this message to horizontally snap the passed point to the guides.

MSG_VIS_RULER_SNAP_TO_GUIDES_Y

void MSG_VIS_RULER_SNAP_TO_GUIDES_Y(
        PointDWFixed _far* point);

Use this message to vertically snap the passed point to the guides.

MSG_VIS_RULER_GET_GUIDE_INFLUENCE

word MSG_VIS_RULER_GET_GUIDE_INFLUENCE();

Guidelines will only affect the mouse if the mouse pointer lies within the guide's area of influence. This message returns the present influence value.

MSG_VIS_RULER_SET_GUIDE_INFLUENCE

void MSG_VIS_RULER_SET_GUIDE_INFLUENCE(
        word influence);

Guidelines will only affect the mouse if the mouse pointer lies within the guide's area of influence. This message sets the influence distance, measured in pixels.

MSG_VIS_RULER_SELECT_HORIZONTAL_GUIDE

void MSG_VIS_RULER_SELECT_HORIZONTAL_GUIDE( @stack
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to select a horizontal guide at the passed coordinates, if any. Note that only one horizontal guide may be selected at any time.

MSG_VIS_RULER_SELECT_VERTICAL_GUIDE

void MSG_VIS_RULER_SELECT_VERTICAL_GUIDE( @stack
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to select a vertical guide at the passed coordinates, if any. Note that only one vertical guide may be selected at any time.

MSG_VIS_RULER_DESELECT_ALL_HORIZONTAL_GUIDES

void MSG_VIS_RULER_DESELECT_ALL_HORIZONTAL_GUIDES();

Use this message to deselect all of the ruler's horizontal guides.

MSG_VIS_RULER_DESELECT_ALL_VERTICAL_GUIDES

void MSG_VIS_RULER_DESELECT_ALL_VERTICAL_GUIDES();

Use this message to deselect all of the ruler's vertical guides.

MSG_VIS_RULER_DELETE_HORIZONTAL_GUIDE

void MSG_VIS_RULER_DELETE_HORIZONTAL_GUIDE( @stack 
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to delete the horizontal guide at the passed coordinate, if any.

MSG_VIS_RULER_DELETE_VERTICAL_GUIDE

void MSG_VIS_RULER_DELETE_VERTICAL_GUIDE( @stack 
        sdword 		dwfInt, 
        word 		dwfFrac);

Use this message to delete the vertical guide at the passed coordinate, if any.


Up: GEOS SDK TechDocs | Up | Prev: 4.3 Grid Spacing and Constraint | Next: 4.5 Other Mouse Constraints