JG ROOT Tools libraries  version 5.0 - august 2014
RGBaseRequester Class Reference

#include <RGBaseRequester.hh>

Inheritance diagram for RGBaseRequester:
RGFitDisplayer RGListRequester RGMessageRequester RGTextMessageRequester RGTreeRequester RGFitDisplayer1D RGFitDisplayer2D RGPrintRequester RGStringRequester

Public Member Functions

 RGBaseRequester (const TGWindow *parent, const TGWindow *main, int &result, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGBaseRequester (const TGWindow *parent, const TGWindow *main, const char *title, const char *buttons=rDico.brq_ok_cancel.c_str(), const ULong_t opts=0, const bool auto_start=false)
 
virtual ~RGBaseRequester ()
 
virtual void MapRequester ()
 
virtual void Request ()
 
virtual TGCompositeFrame * GetFrame () const
 
virtual TGHorizontalFrame * GetHFrame () const
 
virtual TGVerticalFrame * GetVFrame () const
 
virtual void AddFrame (TGFrame *f, TGLayoutHints *l=0)
 
virtual void CloseFromButton ()
 
virtual void CancelClose (const Bool_t b=kTRUE)
 
virtual void ReqButtonClicked (Int_t n)
 
virtual void ProcessedEvent (Event_t *event)
 
virtual void Button (Int_t n)
 
virtual void Quit ()
 
 ClassDef (RGBaseRequester, 0)
 

Protected Member Functions

 RGBaseRequester (const RGBaseRequester &req)
 
virtual void Construct ()
 

Protected Attributes

int * result_adr
 Request resul pointer.
 
string req_title
 Request title.
 
const char * req_buttons
 Buttons texts.
 
UInt_t options
 Request options.
 
ULong_t req_button_layout
 Buttons layout.
 
TGCompositeFrame * w_widget_frame
 Frame for widgets.
 
TGCompositeFrame * w_buttons_frame
 Frame for buttons.
 
TList buttons_list
 List of created buttons.
 
Bool_t cancel_close
 Check for close cancellation.
 

Static Protected Attributes

static UInt_t max_width = 1200
 Maximum request width.
 
static UInt_t max_height = 800
 Maximum request height.
 

Private Member Functions

 GObject (RGBaseRequester)
 

Detailed Description

class RGBaseRequester

Base class to define requests that expect a result from button click.

When the request is executed, the result is stored in result variable. The values correspond to button numbers, starting at 1, except the last one that is 0, like the window close button.

Buttons are defined in a single character string, each button text separated from others with '|' character. When a button is selected, the request is closed, except if the button text ends with '*', or if a slot is called that calls the CancelClose() function.

Base requester options:

  • format for addtionnal widgets frame
    • rgReqVerticalFrame
    • rgReqHorizontalFrame
    • rgReqFrameType
    • rgReqNoExpandX
    • rgReqNoExpandY
  • position of request buttons
    • rgReqButtonsBottom
    • rgReqButtonsRight
    • rgReqButtonsRightTop
    • rgReqButtonsRightBottom
    • rgReqButtonsLeft
    • rgReqButtonsLeftTop
    • rgReqButtonsLeftBottom
    • rgReqButtonsSideTop
    • rgReqButtonsSideBottom
    • rgReqButtonsSide
    • rgReqButtonsPosition
  • other options
    • rgReqNoWait

Constructor & Destructor Documentation

RGBaseRequester::RGBaseRequester ( const TGWindow *  parent,
const TGWindow *  main,
int &  result,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = true 
)

Constructor of a request with a return value (in the result argument variable). The result corresponds to the button used to close the request.

If the auto_start argument is set to false, the resquest is not executed from the constructor (default is true for this constructor). It must be set to false for derived classes. The execution can be executed later using the Request() functions.

Parameters
parentparent window
mainmain application window
resultreturn value
titletitle
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), options, req_buttons, req_title, Request(), and result_adr.

RGBaseRequester::RGBaseRequester ( const TGWindow *  parent,
const TGWindow *  main,
const char *  title,
const char *  buttons = rDico.brq_ok_cancel.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = false 
)

Constructor of a request without a return value, for use in derived classes construction. For this constructor, the default auto_start argument value is false.

Parameters
parentparent window
mainmain application window
titletitle
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), options, req_buttons, req_title, Request(), and result_adr.

RGBaseRequester::RGBaseRequester ( const RGBaseRequester req)
protected

Copy constructor, not implemented.

Parameters
reqrequest to copy
RGBaseRequester::~RGBaseRequester ( )
virtual

Destructor.

Referenced by Quit().

Member Function Documentation

RGBaseRequester::GObject ( RGBaseRequester  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
void RGBaseRequester::Construct ( )
protectedvirtual

Set-up the base widgets of the requester: the fram that my include requester body, and the buttons.

Reimplemented in RGListRequester, RGTreeRequester, RGPrintRequester, RGTextMessageRequester, RGFitDisplayer, RGFitDisplayer2D, and RGFitDisplayer1D.

References buttons_list, options, req_button_layout, req_buttons, w_buttons_frame, and w_widget_frame.

Referenced by RGBaseRequester().

void RGBaseRequester::MapRequester ( )
virtual

Function displaying the request: it may be overloaded by derived classes requiring updates of their specific widgets.

Reimplemented in RGListRequester, RGTreeRequester, RGFitDisplayer, and RGStringRequester.

References max_height, max_width, and req_title.

Referenced by RGStringRequester::MapRequester(), RGFitDisplayer::MapRequester(), and Request().

TGCompositeFrame * RGBaseRequester::GetFrame ( ) const
inlinevirtual

Get pointer to the requester central frame.

References w_widget_frame.

Referenced by RGTextMessageRequester::Construct(), and RGMessageRequester::RGMessageRequester().

TGHorizontalFrame * RGBaseRequester::GetHFrame ( ) const
inlinevirtual

Get pointer to the horizontal frame containing widgets. If the request is build in a vertical frame, the function returns NULL.

References options, and w_widget_frame.

TGVerticalFrame * RGBaseRequester::GetVFrame ( ) const
inlinevirtual

Get pointer to the vertical frame containing widgets. If the request is build in a horizontal frame, the function returns NULL.

References options, and w_widget_frame.

void RGBaseRequester::AddFrame ( TGFrame *  f,
TGLayoutHints *  l = 0 
)
inlinevirtual
void RGBaseRequester::CloseFromButton ( )
virtual

Slot called by the request buttons: the request is closed only if closing has not been cancelled by the CancelClose() function.

References cancel_close.

Referenced by RGListRequester::DoubleClicked(), RGStringRequester::ReturnPressed(), and RGTreeRequester::SingleSelected().

void RGBaseRequester::CancelClose ( const Bool_t  b = kTRUE)
inlinevirtual

Set the cancellation flag for closing the window when a button is clicked (this function may be used in buttons slots).

Parameters
bflag status

References cancel_close.

Referenced by RGFitDisplayer::Button(), RGTreeRequester::ProcessButton(), and RGListRequester::ProcessButton().

void RGBaseRequester::ReqButtonClicked ( Int_t  n)
inlinevirtual

Signal sent when a button is clicked.

Parameters
nbutton number

Referenced by RGStringRequester::Button(), and Button().

void RGBaseRequester::ProcessedEvent ( Event_t *  event)
virtual

Slot called for events in the main frame.

Parameters
eventpointer to event data
void RGBaseRequester::Button ( Int_t  n)
virtual

Slot used to get the button clicked, and to send the corresponding signal ReqButtonClicked(Int_t).

Parameters
nrequester button identifier

Reimplemented in RGFitDisplayer, and RGStringRequester.

References ReqButtonClicked(), and result_adr.

void RGBaseRequester::Quit ( )
virtual

Close the request (slot from close window button).

References ~RGBaseRequester().

RGBaseRequester::ClassDef ( RGBaseRequester  ,
 
)

For ROOT dictionary.


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