casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::DParameterButton Class Reference

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

#include <DParameterButton.h>

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

Public Member Functions

 DParameterButton (const casacore::String name, const casacore::String description, const casacore::String text, const casacore::String help="", const casacore::String context="", const casacore::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. More...
 
 DParameterButton (const DParameterButton &other)
 copy constructor. More...
 
virtual ~DParameterButton ()
 Destructor. More...
 
DParameterButtonoperator= (const DParameterButton &other)
 copy assignment. More...
 
virtual casacore::Bool fromRecord (const casacore::RecordInterface &record)
 Determine whether the record (passed originally from autogui.g) indicates that the button was pressed. More...
 
virtual void toRecord (casacore::RecordInterface &record, const casacore::Bool fullrecord=true, const casacore::Bool overwrite=false)
 Place a record describing this button in a sub-field of record with name matching that of this parameter. More...
 
- Public Member Functions inherited from casa::DisplayParameter
virtual ~DisplayParameter ()
 Destructor. More...
 
casacore::String name () const
 Return the name of this parameter. More...
 
casacore::String description () const
 Return the description of this parameter. More...
 
casacore::String help () const
 Return the help for this parameter. More...
 
casacore::String context () const
 Return the context of this parameter. More...
 
casacore::Bool allowUnset () const
 Return whether this parameter can be unset. More...
 
casacore::Bool editable () const
 Return whether this parameter is editable. More...
 
void setName (const casacore::String name)
 Set or change the name of this parameter to that specified. More...
 
void setDescription (const casacore::String description)
 Set or change the description of this parameter to what is specified. More...
 
void setHelp (const casacore::String help)
 Set or change the help for this parameter to what is specified. More...
 
void setContext (const casacore::String context)
 Set or change the context of this parameter to what is specified. More...
 
void setAllowUnset (const casacore::Bool allowunset)
 Set or change whether this parameter may be unset, according to the function argument value. More...
 
void setEditable (const casacore::Bool editable)
 Set or change whether this parameter is editable according to the function argument. More...
 

Private Member Functions

 DParameterButton ()
 default constructor disabled–do not use. More...
 

Private Attributes

casacore::String itsText
 Store for the text on the button. More...
 

Additional Inherited Members

- Protected Member Functions inherited from casa::DisplayParameter
 DisplayParameter (const casacore::String name, const casacore::String description, const casacore::String help, const casacore::String context="", const casacore::Bool allowunset=false, const casacore::Bool editable=true)
 Constructor taking the name of the parameter, a short description, some help text, and flags indicating whether the parameter can be unset and is editable. More...
 
 DisplayParameter (const DisplayParameter &other)
 Copy constructor using copy semantics. More...
 
 DisplayParameter ()
 Default constructor yielding a useless DisplayParameter. More...
 
DisplayParameteroperator= (const DisplayParameter &other)
 Copy assignment. More...
 
casacore::Record baseDescription ()
 Return a basic description of this parameter; used by virtual implementations of toRecord method to fill out a casacore::Record describing this DisplayParameter. More...
 
const DisplayOptionsdisplayOptions () const
 Return the DisplayOptions to use for parsing Records. More...
 

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");
casacore::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 casacore::String  name,
const casacore::String  description,
const casacore::String  text,
const casacore::String  help = "",
const casacore::String  context = "",
const casacore::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 ( )
inlineprivate

default constructor disabled–do not use.

Definition at line 133 of file DParameterButton.h.

Member Function Documentation

virtual casacore::Bool casa::DParameterButton::fromRecord ( const casacore::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 ( casacore::RecordInterface record,
const casacore::Bool  fullrecord = true,
const casacore::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

casacore::String casa::DParameterButton::itsText
private

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: