Class XbpCheckBox() Foundation

Class function of the XbpCheckBox class.


The XbpCheckBox class provides the checkbox dialog element. A checkbox is always in one of two conditions: "selected" or "not selected". The current state is stored in the edit buffer of the XbpCheckbox object. These states are identified by the logical values .T. (true) and .F. (false).

A checkbox is always displayed on the screen in two parts. It consists of a square where the current state of the checkbox is visually displayed and the caption which is displayed to the right of the box. The character "x" is displayed in the box when the checkbox is in the "selected" state. The appearance of this box cannot be altered. The caption displays the specified text and must be defined before the :create() method is called.

Class methods
Creates an instance of the XbpCheckBox class.

The instance variables in this group configure system resources. If changes are made to these values, they must either be made before the :create() method is executed or the :configure() method must be used to activate the changes.

Automatically fits the size of the checkbox to the caption.
The caption of the checkbox.
Indicates whether the checkbox receives input focus when the mouse is clicked on it.
The state of the XbpCheckBox object.
Life cycle
Requests system resources for the XbpCheckBox object.
Reconfigures the XbpCheckBox object after :create() has been executed.
Releases the system resources of the XbpCheckbox object.
Returns the value in the edit buffer of the checkbox.
Returns the current state of the checkbox.
Specifies a new caption.
Sets the current value or state of the checkbox.
Checkbox has been selected.
Create checkboxes
// In the example, two checkboxes are created in 
// an XbpCrt window. Each checkbox outputs text 
// using QOut() indicating whether it is "selected". 

#include "" 

   LOCAL nEvent, mp1, mp2, oXbp 

   // Create the first checkbox, specify position using :create() 
   oXbp := XbpCheckbox():new() 
   oXbp:caption := "A" 
   oXbp:create( , , {10,20}, {100,40} ) 

   // Determine state using mp1 
   oXbp:selected := ; 
      {| mp1, mp2, oChk| QOut( "Checkbox A", ; 
                     IIf( mp1, "selected" , ; 
                               "not selected" ) ) } 

   // Create second checkbox, specify position using :new() 
   oXbp := XbpCheckbox():new( , , {150,20}, {100,40} ) 
   oXbp:caption := "B" 

   // Determine state using :getData() 
   oXbp:selected := ; 
      {| mp1, mp2, oChk| QOut( "Checkbox B", ; 
          IIf( oChk:getData(), "selected", ; 
                               "not selected" ) ) } 

   // Event loop 
   nEvent := 0 
   DO WHILE nEvent <> xbeP_Close 
      nEvent := AppEvent( @mp1, @mp2, @oXbp ) 
      oXbp:HandleEvent( nEvent, mp1, mp2 ) 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.