casa
$Rev:20696$
|
Implementation of DisplayParameter to package interface to button autoguis. More...
#include <DParameterButton.h>
Public Member Functions | |
DParameterButton (const String name, const String description, const String text, const String help="", const String context="", const Bool editable=True) | |
Constructor taking the name (id) of the button, a label which will appear beside the button, and the text which will appear on the button. | |
DParameterButton (const DParameterButton &other) | |
copy constructor. | |
virtual | ~DParameterButton () |
Destructor. | |
DParameterButton & | operator= (const DParameterButton &other) |
copy assignment. | |
virtual Bool | fromRecord (const RecordInterface &record) |
Determine whether the record (passed originally from autogui.g) indicates that the button was pressed. | |
virtual void | toRecord (RecordInterface &record, const Bool fullrecord=True, const Bool overwrite=False) |
Place a record describing this button in a sub-field of record with name matching that of this parameter. | |
Private Member Functions | |
DParameterButton () | |
default constructor disabled--do not use. | |
Private Attributes | |
String | itsText |
Store for the text on the button. |
Implementation of DisplayParameter to package interface to button autoguis.
Public interface
DParameterButton is an implementation of a DisplayParameter for Buttons. It defines the necessary information to define a button in autogui.g, and packages it into the parameter record field autogui requires.
This class is derived from DisplayParameter It holds the meta-information neccessary to define a button widget, packaging it into the 'parameter record' field required by autogui.g. It can determine whether the button was pressed. The 'value' has no meaning here (it will be True).
DParameterButton pbtn("unique_btn_id", "Label Beside Button", "Text on Button", "Help Message for Button"); Record rec; // (usually within 'getoptions()') pstring.toRecord(rec); // rec is returned to autogui.g // to define the button. // ...when inRec is received recording user gui updates // (usually within 'setOptions()'): if(pbtn.fromRecord(inRec)) /* button was pressed; respond */ ;
Allows buttons to be defined using the same compact DParameter interface used for other autogui widgets.
Definition at line 92 of file DParameterButton.h.
casa::DParameterButton::DParameterButton | ( | const String | name, |
const String | description, | ||
const String | text, | ||
const String | help = "" , |
||
const String | context = "" , |
||
const Bool | editable = True |
||
) |
Constructor taking the name (id) of the button, a label which will appear beside the button, and the text which will appear on the button.
Optionally, popup help text, 'context' string, and a flag indicating whether the button is enabled (disable is not fully supported yet). The context string determines which autogui rollup the button will appear in (replace spaces with underscores in this string).
casa::DParameterButton::DParameterButton | ( | const DParameterButton & | other | ) |
copy constructor.
virtual casa::DParameterButton::~DParameterButton | ( | ) | [virtual] |
Destructor.
casa::DParameterButton::DParameterButton | ( | ) | [inline, private] |
default constructor disabled--do not use.
Definition at line 133 of file DParameterButton.h.
virtual Bool casa::DParameterButton::fromRecord | ( | const RecordInterface & | record | ) | [virtual] |
Determine whether the record (passed originally from autogui.g) indicates that the button was pressed.
Implements casa::DisplayParameter.
DParameterButton& casa::DParameterButton::operator= | ( | const DParameterButton & | other | ) |
copy assignment.
virtual void casa::DParameterButton::toRecord | ( | RecordInterface & | record, |
const Bool | fullrecord = True , |
||
const Bool | overwrite = False |
||
) | [virtual] |
Place a record describing this button in a sub-field of record
with name matching that of this parameter.
If overwrite
is True
, then any existing field with matching name will be overwritten. If fullrecord
is True
, then a complete description of the parameter is given, otherwise just its current value is stored in record
. (At present, fullrecord
is ignored; the full record is always returned).
Implements casa::DisplayParameter.
String casa::DParameterButton::itsText [private] |
Store for the text on the button.
Definition at line 136 of file DParameterButton.h.