SDK:Working with Tool Mode Bar

From Vectorworks Developer
Jump to: navigation, search

.SDK|SDK ..SDK:Types|SDK Types ..SDK:Using the SDK|Using the SDK ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Mode Bar

The mode bar is the space on top of the document where VectorWorks shows tool specific User Interface widgets as well as a line of help text.

TheModeBarSample.jpg

VectorWorks sends several events to allow the plug-in to define the Mode Bar and to respond to events from it:

  • kToolDoSetup -- This event is send when the tool is activated or the tool is resumed. During this event the plug-in must set up the mode bar.
  • kToolDoSetDown -- This event is send when the tool is deactivated or suspended. During this event the plug-in must store the mode bar state so they can be restored if needed.
  • kToolDoModeEvent -- The user have selected User Interface element from the Mode Bar.

kToolDoSetup

During this kToolDoSetup event the user has to create the mode bar using the following functions:

And then to initialize the initial state of the mode bar.

Usually the plug-in stores the state on kToolDoSetDown and restores it using kToolDoSetup.

kToolDoSetDown

Usually the plug-in stores the state on kToolDoSetDown and restores it using kToolDoSetup.

kToolDoModeEvent

This message is received when Mode Bar User Interface element is selected by the user.

The messages are as follows:

size_t	groupID		= message1 > 0 ? (size_t)(message1-1) : 0;
size_t	buttonID	= message2 > 0 ? (size_t)(message2-1) : 0;
size_t	newButtonID	= buttonID & 0x0000FFFF;
size_t	oldButtonID	= (buttonID & 0xFFFF0000) >> 24;

The User Interface groups are represented by ID which is the index of the element. Every group contain one element, except radio groups which have many elements in the group.

The radio groups contain elements with consecutive indexes.

ModeBarGroups.jpg

See Also

Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox