GEOS SDK TechDocs
|
|
4.5 Other Mouse Constraints
For the most part, the ruler will work together with the main view to coordinate updates. This is done by means of messages going to the ruler. Subclasses of VisRulerClass might conceivably intercept these messages to alter behavior.
void MSG_VIS_RULER_GAINED_SELECTION(
optr dest);
This message notifies the ruler that the ruled object (the object in the main view) is selected and the ruler should update its UI to reflect its own attributes.
Parameters: dest Object to send messages to whenever a change in ruler settings should result in the ruled object being redrawn (e.g. when the user wants to draw the grid).
Return: Nothing.
void MSG_VIS_RULER_LOST_SELECTION();
This message notifies the ruler that the ruled object is no longer selected.
void MSG_VIS_RULER_UPDATE_CONTROLLERS();
This message signals that the ruler should update its associated controllers.
void MSG_VIS_RULER_UPDATE_TYPE_CONTROLLER();
This message signals that the ruler should update its type controller, if any.
void MSG_VIS_RULER_UPDATE_GRID_CONTROLLER();
This message signals that the ruler should update its grid controller, if any.
void MSG_VIS_RULER_UPDATE_GUIDE_CONTROLLER();
This message signals that the ruler should update its guide controller, if any.
void MSG_VIS_RULER_COMBINE_GUIDE_INFO(
MemHandle data); /* Handle of block containing
VisRulerNotifyGuideChangeBlockHeader*/
This message allows the horizontal and vertical rulers to load their respective guide information into a single structure so that the information can be collated and passed on to a RulerGuideControl.
Structures:
typedef struct {
LMemBlockHeader VRNGCBH_header;
word VRNGCBH_vertGuideArray;
word VRNGCBH_horizGuideArray;
} VisRulerNotifyGuideChangeBlockHeader;
void MSG_VIS_RULER_VIEW_SCALE_FACTOR_CHANGED( @stack
WindowHandle viewWindow,
WWFixedAsDWord yScaleFactor,
WWFixedAsDWord xScaleFactor);
The ruler will receive this message when the main view's scale factor changes. Specifically, when the RulerContent `s scale is changing (which will happen because of the RulerView's link to the main view), its handler for
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
sends this message to the VisRuler.
@message word MSG_VIS_RULER_GET_DESIRED_SIZE();
This message returns how much space the ruler thinks it needs to draw the numbers and hatch marks.
Interception: This method should be subclassed if the subclassed ruler's size needs to vary with respect to scale factor, whether the ruler is horizontal or vertical, or whatever size seems appropriate.
void MSG_VIS_RULER_INVALIDATE_WITH_SLAVES();
The ruler's default behavior will result in it redrawing itself at appropriate times. Depending on what use you put your ruler to, you may have to force it to redraw itself. If so, you should probably use this message.
GEOS SDK TechDocs
|
|
4.5 Other Mouse Constraints