FutureBasic Logo

<<    Index    >> FutureBasic 5

button   function



Syntax:
buttonState = button( btnNum [,selector] )

Description:
Returns 0 (_grayBtn) if the button is inactive (for example in a non-front window), otherwise returns the button's 32-bit signed value.
The extended button function offers access to many of the features found in appearance buttons. Use the selectors in conjunction with the button reference number to obtain information. For example, to get the minimum value for button number 10, the code would be:
min = button( 10, _FBGetCtlMinimum )
If the button statement is called and the btnNum parameter refers to a button that does not exist, you will see the message, "Button() called for non-existant button." If an improper selector is used, you will see the message, "Bad parameter for Button()." The following table lists possible values for the button statement's selector.
Selector Description
< zero
Get the reference number of the nth embedded sub control. The absolute value of this is used as the index. Example:
subControlRef = button(_mySuperControl,-3) : rem get 3rd embedded control's ref num
_FBGetCtlRawValue The control's 32-bit signed value.
_FBGetCtlMinimum Minimum value allowed for this control.
_FBGetCtlMaximum Maximum value allowed for this control.
_FBGetCtlPage Page up/down value for a scroll bar.
_FBGetRootControl Root control of the window.
_FBcountSubControls Count how many controls are embedded in this super control.
_FBGetSuperControl Get (parent) super control's ref num.
_FBGetControlDate Fills the global Pascal string gFBControlText$ with the text version of the control's date. It also fills the global record gFBControlSeconds with the control's date/time record. See "Time and Date Buttons" under the appearance button statement.
_FBgetControlTime Fills the global Pascal string gFBControlText$ with the text version of the control's time. It also fills the global record gFBControlSeconds with the control's date/dime record. See "Time and Date Buttons" under the appearance button statement.
_FBgetBevelControlMenuHandle   Gets the menu handle of a beveled pop-up menu button.
_FBgetBevelControlMenuVal Gets the current selection of a beveled pop-up menu button.
_FBgetBevelControlLastMenu Gets the previous selection of a beveled pop-up menu button.
_FBgetControlMenuHandle Gets the menu handle of a standard pop-up menu button.
_FBgetControlMenuID Gets the current selection of a standard pop-up menu button.
See Also:
button; scroll button