Click or drag to resize

CheckBox Class

X#
Create check boxes, which are controls that can be toggled on or off by a user (or for 3-state check boxes, to a third state).
Inheritance Hierarchy
Object
  VObject
    Control
      TextControl
        Button
          CheckBox

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS CheckBox INHERIT Button
Request Example View Source

The CheckBox type exposes the following members.

Constructors
  NameDescription
Public methodCheckBox
Construct a check box.
Top
Properties
  NameDescription
Public propertyBackground
The brush used for painting the background of the control. For example, in a single line edit control, the background is the color behind the text in the edit control.
(Inherited from Control.)
Public propertyCaption
The string representing the caption of the text control.
(Inherited from TextControl.)
Public propertyChecked
A logical value representing the current state of a check box. It is TRUE if the box is checked (or for 3-state check boxes, if it is in the third UNDETERMINED state), otherwise it is FALSE. The CheckBox:Checked assign also changes CheckBox:Value and CheckBox:TextValue. Also, if the CheckBox:Value is changed, CheckBox:ValueChanged is set to TRUE.
Public propertyContextMenu
A menu object representing the local pop-up menu for a control.
(Inherited from Control.)
Public propertyControlFont
The font used to draw the text in the control.
(Inherited from TextControl.)
Public propertyControlID
A number between 1 and 8000 representing the unique ID of a control
(Inherited from Control.)
Public propertyCurrentText
For check boxes, push buttons, and radio buttons, Button:CurrentText contains NULL_STRING.
(Inherited from Button.)
Public propertyFieldSpec
The field specification connected to the control.
(Inherited from Control.)
Public propertyHyperLabel
The hyperlabel connected to the control.
(Inherited from Control.)
Public propertyLength
A numeric value representing the number of characters in the control.
(Inherited from TextControl.)
Public propertyModified
A logical value that is set to TRUE when a standard edit control or editable combo box is in the process of being modified.
(Inherited from Control.)
Public propertyName
A string representing the name of the control.
(Inherited from Control.)
Public propertyNameSym
A symbol representing the name of the control.
(Inherited from Control.)
Public propertyOrigin
A point representing the location of a control on its owner window, in canvas coordinates.
(Inherited from Control.)
Public propertyOwner
The owner window of a control.
(Inherited from Control.)
Public propertyOwnerAlignment
Constant representing how the window will be aligned within its owner window.
(Inherited from Control.)
Public propertyReadOnly
Is the control readonly ?
(Inherited from Control.)
Public propertyServer
The server object that currently connected to this control. If no server is connected, the value is NIL.
(Inherited from Control.)
Public propertySize
A dimension representing the size of a control.
(Inherited from Control.)
Public propertyStatus
A hyperlabel indicating the status of the control after a validation attempt or other action.
(Inherited from Control.)
Public propertyTextColor
The color used to draw the text in the control. (Refer to the Color:Init() method for details on specifying a color object.)
(Inherited from TextControl.)
Public propertyTextValue
CheckBox:TextValue is initialized to FALSE on data windows, since the control contains no text.
(Overrides TextValue.)
Public propertyToolTipText
String value representing the tooltip text used when the user moves the mouse pointer over the control.
(Inherited from Control.)
Public propertyUseHLForToolTip
Logical value determining whether the descriptive text of a control's Hyperlabel should be used as the tooltip text.
(Inherited from Control.)
Public propertyValue
CheckBox:Value contains TRUE if the check box is in the checked (ON) state or for 3-state check boxes, in the third UNDETERMINED state. It contains FALSE if it is in the unchecked state (OFF).
(Overrides Value.)
Public propertyValueChanged
A logical value representing whether the control's Value has been changed from its prior setting.
(Inherited from Control.)
Top
Methods
  NameDescription
Public methodActivate
Provide a method that is invoked when the control has focus and a window is activated.

(Inherited from Control.)
Public methodAsString
Return an identifying label for the button.
(Inherited from Button.)
Public methodCreate
Creates the underlying Win32 control
(Inherited from TextControl.)
Public methodDeactivate
Provide a method that is invoked when the control has focus and a window is deactivated.

(Inherited from Control.)
Public methodDEFAULT
Call the default windows procedure for a control and set the EventReturnValue.
(Inherited from Control.)
Public methodDestroy
Provide a method to de-instantiate a CheckBox object.
(Overrides Destroy.)
Public methodDisable
Disable a control (until a subsequent call to Control:Enable()).
(Inherited from Control.)
Public methodDisableTheme
Disable the WinXP theme for a control.
(Inherited from Control.)
Public methodDispatch
Provide the prototype dispatcher for events within the system when the control has focus; routing various events to their appropriate event handlers.

(Inherited from Control.)
Public methodEnable
Enable a control that was previously disabled.
(Inherited from Control.)
Public methodExpose
Provide a method that is invoked when the control has focus and whenever part of the window needs repainting.

(Inherited from Control.)
Public methodFocusChange
Provide a method that is invoked when the control has focus and the input focus changes from the current control to another (or vice versa).

(Inherited from Control.)
Public methodFont
Change the current font of the text control.
(Inherited from TextControl.)
Public methodGetExStyle
Retrieve the Ex styles for the control.
(Inherited from Control.)
Public methodGetStyle
Retrieve the styles for the control.
(Inherited from Control.)
Public methodHandle
Return the handle for a control.
(Inherited from Control.)
Public methodHasBorder
Check if a border has been set for the control
(Inherited from Control.)
Public methodHasStyle
Check if a style value has been set for the control
(Inherited from Control.)
Public methodHide
Hide a control so it is not visible (until a subsequent call to Control:Show()).
(Inherited from Control.)
Public methodHorizontalScroll
Provide a method that is invoked when the control has focus and a horizontal scroll bar is scrolled.

(Inherited from Control.)
Public methodIme
Return and optionally set whether Input Method Editor is enabled for this text control.
(Inherited from TextControl.)
Public methodIsEnabled
Report if this control is currently enabled.
(Inherited from Control.)
Public methodIsExStyle
Check if a exstyle value has been set for the control
(Inherited from Control.)
Public methodIsReadOnly
Report if this control is currently readonly.
(Inherited from Control.)
Public methodIsStyle
Check if a style value has been set for the control
(Inherited from Control.)
Public methodIsVisible
Report if this control is visible (completely or partially) or hidden.
(Inherited from Control.)
Public methodKeyDown
Provide a method that is invoked when the control has focus and a key on the keyboard is pressed.

(Inherited from Control.)
Public methodKeyUp
Provide a method that is invoked when the control has focus and a key on the keyboard is released.

(Inherited from Control.)
Public methodLinkDF
Connect a control to a data field in a data server.
(Inherited from Control.)
Public methodMenuInit
Provide a method that is invoked when a pop-up menu owned by the control is about to pop up.
(Inherited from Control.)
Public methodMenuSelect
Provide a method that is invoked when an item on a menu owned by the control is highlighted.
(Inherited from Control.)
Public methodMouseButtonDoubleClick
Provide a method that is invoked when the control has focus, the mouse pointer is positioned over the window, and a mouse button is double-clicked.

(Inherited from Control.)
Public methodMouseButtonDown
Provide a method that is invoked when the control has focus, the mouse pointer is positioned over the window, and a mouse button is clicked.

(Inherited from Control.)
Public methodMouseButtonUp
Provide a method that is invoked when the control has focus, the mouse pointer is positioned over the window, and a mouse button is released.
(Inherited from Control.)
Public methodMouseDrag
Provide a method that is invoked when the control has focus and a mouse with one or more buttons clicked is moved in the window.
(Inherited from Control.)
Public methodMouseMove
Provide a method that is invoked when the control has focus and the mouse is moved in the control.
(Inherited from Control.)
Public methodMove
Provide a method that is invoked when the control has focus and the control is moved (either by the user or by the application).
(Inherited from Control.)
Public methodOverRide
This is a compatibility method that is no longer used or needed.
(Inherited from Control.)
Public methodPerformValidations
Perform all the validations defined to this control's field specification (for example, required, maximum and minimum digits, maximum and minimum value, validation rule) and return the result of the test.
(Inherited from Control.)
Public methodRegisterTimer
Register a timer method to be invoked for the control.
(Inherited from Control.)
Public methodRemoveEditBalloonTip
Removes the current BallonTip from the Edit control that has inherited from this class.
(Inherited from TextControl.)
Public methodRePaint
Send an ExposeEvent to repaint the control
(Inherited from Control.)
Public methodResize
Provide a method that is invoked when the control has focus and the control changes size.
(Inherited from Control.)
Public methodRestoreUpdate
Resume all drawing updates for a control (after Control:SuspendUpdate() is called).
(Inherited from Control.)
Public methodSetCueBanner
Add a cue banner to the Edit control that has inherited from this class.
(Inherited from TextControl.)
Public methodSetExStyle
Set the exstyle for the control.
(Inherited from Control.)
Public methodSetFocus
Pass input focus to a control, thereby directing all mouse and keyboard input to the control.
(Inherited from Control.)
Public methodSetParent
Change the parent handle for the control.
(Inherited from Control.)
Public methodSetStyle (Inherited from Button.)
Public methodShow
Display a control so it is visible.
(Inherited from Control.)
Public methodShowEditBalloonTip
Add a BallonTip to the Edit control that has inherited from this class.
(Inherited from TextControl.)
Public methodSuspendUpdate
Temporarily suspend all drawing updates for a control; drawing resumes with a call to Control:RestoreUpdate().
(Inherited from Control.)
Public methodTimer
Provide a method to be invoked at specific intervals defined when the timer is registered though the RegisterTimer() method.
(Inherited from Control.)
Public methodValidateControl
This method validates if the control has been created and when not then it triggers the control creation
(Inherited from Control.)
Public methodVerticalScroll
Provide a method that is invoked when the control has focus and a vertical scroll bar is scrolled.
(Inherited from Control.)
Top
Fields
  NameDescription
Public fieldEventReturnValue (Inherited from Control.)
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks
A check box allows the user to choose between 2 or 3 states. A 2-state check box allows a choice between a checked (ON) and unchecked (OFF) state. The choice is reflected in CheckBox:Value access, which may be TRUE or FALSE. A 3-state check box adds a third (UNDETERMINED) state, in which the box is dimmed. The third state is indicated by CheckBox:Value being TRUE and by CheckBox:ValueChanged (which is normally TRUE) being FALSE. A check box may be bound to a logical field in a server. Because of this, you can not directly bind a 3-state check box to a server; instead you must create a numeric or character field to store the 3-state information, and update it based on the status of the CheckBox:Value and CheckBox:ValueChanged accesses. The Window:ButtonClick() event handler responds to events in the check box. The default behavior of the event handler is to toggle the state of the check box. Typically, you would implement your own ButtonClick() event handler in which you first call the default handler to set the state of the buttons. For example:
X#
1METHOD ButtonClick(oControlEvent) CLASS MyWind
2SUPER:ButtonClick(oControlEvent)
3// Do something else
Examples
This example creates a check box on a dialog window and then checks it:
X#
1CLASS MyDialog INHERIT DialogWindow
2HIDDEN oCBNew AS OBJECT
3METHOD Init(oWindow,nResourceID) CLASS MyDialog
4SUPER:Init(oWindow,nResourceID)
5oCBNew := CheckBox{SELF,IDB_CHECKBOX}
6oCBNew:Checked := TRUE
7SELF:Show()
In Windows, check boxes are equivalent to a button with the BS_CHECKBOX style. The style BS_AUTOCHECKBOX is useful because the button is automatically checked and unchecked without any code being written in the system. They are normally specified in the resource entity like this:
X#
1RESOURCE IDD_ABOUT DIALOG 20,20,160,120
2STYLE WS_POPUP | WS_DLGFRAME
3BEGIN
4CHECKBOX "&Color" IDB_COLOR,10,20,40,12
5CHECKBOX "&Filled" IDB_FILLED,10,35,40,12
6CONTROL "&Auto",IDB_AUTO,"button", BS_AUTOCHECKBOX,10,65,40,12
7DEFPUSHBUTTON "OK" IDB_OK,64,80,32,14, WS_GROUP
8END
See Also

Reference