You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_BasicButton object:
Cvo_BasicButton
Cvo_Window
The Cvo_BasicButton object is the base on which all button objects are built. It is documented here only as to provide a list of member functions that may be used with any of the types derived from it. It should not be created directly by the average Cvo application.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
LeftJustify (
)
RightJustify (
)
Center (
)
Cause the contents of the button to be left or right justified or centered, if this makes sense for the particular button type.
Flash (
)
Cause the button to flash as if it had been pressed and released.
Note that no action will be taken. If you wish to synthesize the
user pressing and releasing the button, use ForceDown()
and
ForceUp()
.
ForceDown (
)
Make the object believe it has been pressed. Any action, such as
becoming sunken or generating a CvoButtonDownEvent
will occur.
ForceUp (
[ BOOL send_event ] )
Make the object believe it has been released. If send_event is
not passed, or is True
, ForceUp()
will behave as if the mouse
cursor had been in the object at the time it was released and the
appropriate events will be generated. Otherwise, if send_event is
False
, ForceUp()
will behave as if the mouse cursor had not been
in the object at the time it was released.
ForceRelease (
)
This function forces the button object to believe it is not currently pressed. This function should be used with great care. Typically it is only called by internal Cvo routines.
This object defines the following Cvo Events in addition to those defined by its parent and ancestor objects.
CvoButtonDownEvent
struct
Cvo_ButtonDownEvent
int button,
int value,
unsigned int state
The button down event is generated whenever the button has been pressed down.
The button element of the event structure indicates which mouse button was pressed. Possible values currently are:
Button1
Button2
Button3
Button4
Button5
The value element is typically 0, although toggle type buttons will set this to non-zero to indicate a depressed state.
The state element indicates the states of the modifiers at the time the button was pressed. Possible values which may be ORed together are:
ShiftMask
LockMask
ControlMask
Mod1Mask
Mod2Mask
Mod3Mask
Mod4Mask
Mod5Mask
Button1Mask
Button2Mask
Button3Mask
Button4Mask
Button5Mask
CvoButtonUpEvent
struct
Cvo_ButtonUpEvent
int button,
int value,
unsigned int state
This event is generated whenever the button has been released while
the button had "focus." That is, if the mouse is used to depress the
button and the mouse is moved out of the button and then released,
this event will not be generated. This implies that all
CvoButtonDownEvent
s will not necessarily be followed by a
CvoButtonUpEvent
.
The button element of the event structure indicates which mouse button was released. Possible values currently are:
Button1
Button2
Button3
Button4
Button5
The value element is typically 0. Toggle type buttons will assure this is 0 to indicate the toggle is no longer depressed.
The state element indicates the states of the modifiers at the time the button was released. Possible values which may be ORed together are:
ShiftMask
LockMask
ControlMask
Mod1Mask
Mod2Mask
Mod3Mask
Mod4Mask
Mod5Mask
Button1Mask
Button2Mask
Button3Mask
Button4Mask
Button5Mask
This object defines the following event translations in addition to those defined by its parent and ancestor objects.
<ButtonPress>
:
Press()
The Press translation is used to cause the button to be pressed. The
CvoButtonDownEvent
event is generated.
<ButtonRelease>
:
Release()
The Release translation is used to cause the button to be released.
The CvoButtonUpEvent
event is generated.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoBasicButton.Cursor
(new value:
Top Left Arrow
)
*CvoBasicButton.Pad
(new value:
2
)
See the legend for information about the conventions used in this documentation.