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).
Example
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 */ ;
Motivation
Allows buttons to be defined using the same compact DParameter
interface used for other autogui widgets.
Thrown Exceptions
Member Description
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).
copy constructor.
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. 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).
default constructor disabled--do not use.