WDS_Button

WDS_Button

wds

1998 12-05


CLASS

WDS_Button - button widget


SYNOPSIS

Class WDS_Button is a pressable button widget. It activates when the left mouse is pressed inside its geometry. It deactivates upon release of the left mouse. In order to detect a left mouse release outside its geometry, the button registers a non-exclusive event bypass with the ancestral scope closest to the root of the hierarchy. This registration occurs upon activation and removed upon deactivation. Text set through WDS_Widget::SetLabel() is automatically formatted to fit the box.


PUBLIC MEMBER FUNCTIONS

Inheritance from class WDS_Widget



long GetFlags(void)

void SetFlags(long set)

void SetFlagsIncluding(long set)

void SetFlagsExcluding(long set)
Set/Get flags for the button from the following. Enumeration values are given for clarity; they are subject to change.



WDS_BUTTON_FLAGS_NONE 0 No special flags.
WDS_BUTTON_FLAGS_TOGGLE 1 Instead of a simple press-release button, the button activates on the first press and, potentially, deactivates on the second press.
WDS_BUTTON_FLAGS_EXCLUSIVE 2 When activated, the button registers with the shallowest ancestral scope in a way that deactivates any exclusive buttons that registered with the same scope. This is useful for radio buttons.
WDS_BUTTON_FLAGS_UNTAKE_ONLY 4 User can not directly deactivate a toggled button, but only indirectly using WDS_BUTTON_FLAGS_EXCLUSIVE flag described above.
WDS_BUTTON_FLAGS_TOGGLE_AUTOSIZE 8 Autosize the widget using specific rules generally applicable to toggle and radio buttons. The height is the maximum of the string and annotation heights. The width is the sum of the annotation string width, prefered widget height, and annotation width. This implies a square widget box with an offset to the annotation specified by the annotation width. Note that this is NOT the standard interpretation of the annotation size.


STATE CHANGES


WDS_STATE_0 Released
WDS_STATE_1 Pressed


FILES

wds/button.h Button header file


SEE ALSO

WDS_intro(3), WDS_Widget(3), WDS_Scope(3), WDS_String(3), WDS_RadioButton(3), WDS_ToggleButton(3)


NOTES

If there no ancestral scope which complete covers the geometry of the window, it is possible to press a button, drag the mouse to the uncovered area, and release the mouse without the button deactivating. Therefore, it is good practice to begin the widget hierarchy in each window with a window-filling scope.