CButtonEvent

Name

CButtonEvent -- Encapsulate button press events

Synopsis


#include <ButtonEvent.h>

class CButtonEvent      
{
  
public:

  CButtonEvent(const msg_ButtonPress& rButtonInfo);

  Int_t getId() const;
  Int_t getCurrentSpectrum() const;
  Bool_t getToggleState() const;
  Int_t getPromptedSpectrum() const;
  std::string getm_sPromptedString() const;
  
  const PointArray& getPoints() const;
  PointIterator begin ();
  PointIterator end ();
  UInt_t size ();
  const CPoint& operator[] (UInt_t nI)  const;
 
};

        

DESCRIPTION

Button press events are sent by Xamine when a user button has been clicked and any prompters successfully navigated by the user. The CButtonEvent class can be instantiated on a button press message and decodes/makes available the pertinent information in the event. Note that to know what to pull out of the event, the software must know prompter type was used to create the button.

METHODS

CButtonEvent(const msg_ButtonPress& rButtonInfo = );

Constructs the object from the raw button press event received from Xamine.

const Int_t getId() ();

Retrieves the id of the button that was pressed to create this ievent. The button Id is how you determine which button was clicked.

const Int_t getCurrentSpectrum();

Returns the Xamine id of the currently selected spectrum. -1 is returned if there is no currently selected spectrum.

const Bool_t getToggleState();

If the button is a toggle button, returns the state of the toggle. kfTRUE means that the toggle is lit up. This method does not return a meaningful result if the button was not a toggle button.

const Int_t getPromptedSpectrum();

If the button has a spectrum prompter associated with it, the Xamine id of the selected spectrum is returned. This method does not return a meaningful result if the button does not use a spectrum prompter.

const std::string getm_sPromptedString();

Returns the string prompt value. This is for both the string prompter and the filename prompter (in which case it's the path of the selected filename). If the prompter does not return a string value, the return value of this method is not meaningful.

const const PointArray& getPoints();

If the button had a point prompter associated with it, the points clicked in by the user are returned. See Point.h for type definitions in this and other point methods.

No guarantees are provided for the results of this method if the button did not have a point prompter (e.g. don't assume the points array is empty).

PointIterator begin();

Returns an iterator to the front of the container that holds the points inputted by the user in response to a point prompter. If the button did not use a point prompter, while this may be a valid iterator, the contents of the container are not well defined.

PointIterator end();

Returns an iterator off the end of the points container.

UInt_t size();

Returns the number of elements in the points container.

const const CPoint& operator[] (UInt_t nI = );

Returns a readonly reference to the point index nI.