casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::DParameterButton Class Reference

Implementation of DisplayParameter to package interface to button autoguis. More...

#include <DParameterButton.h>

Inheritance diagram for casa::DParameterButton:
casa::DisplayParameter

List of all members.

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.
DParameterButtonoperator= (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.

Detailed Description

Implementation of DisplayParameter to package interface to button autoguis.

Intended use:

Public interface

Prerequisite

Etymology

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.

Synopsis

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).

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

Definition at line 92 of file DParameterButton.h.


Constructor & Destructor Documentation

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).

copy constructor.

Destructor.

default constructor disabled--do not use.

Definition at line 133 of file DParameterButton.h.


Member Function Documentation

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.


Member Data Documentation

Store for the text on the button.

Definition at line 136 of file DParameterButton.h.


The documentation for this class was generated from the following file: