#include <dialogs.h>
Inheritance diagram for TRadioButtons::
Public Methods | |
TRadioButtons (const TRect &bounds, TSItem *aStrings) | |
virtual void | draw () |
virtual Boolean | mark (int item) |
virtual void | movedTo (int item) |
virtual void | press (int item) |
virtual void | setData (void *rec) |
Static Public Methods | |
TStreamable* | build () |
Static Public Attributes | |
const char* const | name |
Protected Methods | |
TRadioButtons (StreamableInit) |
TRadioButtons objects are clusters controls with the special property that only one control button in the cluster can be selected at any moment. Selecting an unselected button will automatically deselect (restore) the previously selected button.
The user can select a button with mouse clicks, cursor movements, and Alt-letter shortcuts. Each radio button can be highlighted and selected (with the Spacebar). An "." appears in the radio button when it is selected.
Other parts of your application typically examine the state of the radio buttons to determine which option has been chosen by the user.
Radio button clusters often have associated TLabel objects to give the user an overview of the clustered options.
TRadioButtons interprets value as the number of the "pressed" button, with the first button in the cluster being number 0.
Definition at line 1181 of file dialogs.h.
|
Constructor. `bounds' is the bounding rectangle of the view. `aStrings' points to a linked list of TSItem objects, one for each radio button, and is assigned to strings data member. Every TSItem object stores the caption of the related radio button. TRadioButtons handles a maximum of 2^32 radio buttons. The sel and value data members are set to zero; options is set to (ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess). |
|
Constructor. Used to recover the view from a stream. Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit. |
|
Creates a new TRadioButtons view. Called to create an object in certain stream-reading situations. Reimplemented from TCluster. |
|
Draws the TRadioButtons object by calling the inherited TCluster::drawBox() member function. The default radio button is " ( ) " when unselected and " (.) " when selected. Note that if the boundaries of the view are sufficiently wide, radio buttons can be displayed in multiple columns. Reimplemented from TView. |
|
Returns True if the specified radio button is pressed; that is, if `item' is equal to value data member. Integer `item' specifies which radio button to check. 0 is the first radio button, 1 is the second radio button, etc. Reimplemented from TCluster. |
|
Called whenever the user moves the selection to another radio button. Sets value data member to `item'. This will press `item' radio button and release the previously pressed radio button.
Reimplemented from TCluster. |
|
Called to press another radio button. Integer `item' specifies which radio button to press. The previous radio button is released. 0 is the first radio button, 1 the second radio button, etc.
Reimplemented from TCluster. |
|
Writes the data record of this view. This method calls TCluster::setData() and after sets sel data member to value data member. This will move the selection on the currently pressed radio button. Reimplemented from TCluster. |
|
Undocumented. Reimplemented from TCluster. |