JG ROOT Tools libraries
version 5.0 - august 2014
|
#include <RGBaseRequester.hh>
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) | |
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:
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.
parent | parent window |
main | main application window |
result | return value |
title | title |
buttons | buttons texts |
opts | options |
auto_start | flag 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.
parent | parent window |
main | main application window |
title | title |
buttons | buttons texts |
opts | options |
auto_start | flag for execution at construction |
References Construct(), options, req_buttons, req_title, Request(), and result_adr.
|
protected |
Copy constructor, not implemented.
req | request to copy |
|
virtual |
Destructor.
Referenced by Quit().
|
private |
Macro from GCpp library that defines the following functions:
|
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().
|
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().
|
virtual |
Execute the request.
References MapRequester(), and options.
Referenced by RGItemTreeSelector::MoveSelectedToFolder(), RGBaseRequester(), RGFitDisplayer1D::RGFitDisplayer1D(), RGFitDisplayer2D::RGFitDisplayer2D(), RGListRequester::RGListRequester(), RGMessageRequester::RGMessageRequester(), RGPrintRequester::RGPrintRequester(), RGStringRequester::RGStringRequester(), RGTextMessageRequester::RGTextMessageRequester(), and RGTreeRequester::RGTreeRequester().
|
inlinevirtual |
Get pointer to the requester central frame.
References w_widget_frame.
Referenced by RGTextMessageRequester::Construct(), and RGMessageRequester::RGMessageRequester().
|
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.
|
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.
|
inlinevirtual |
Add widgets in the frame: the added TGFrame object parent is updated.
f | pointer to TGFrame to be added |
l | layout pointer |
References w_widget_frame.
Referenced by RGFitDisplayer2D::Construct(), RGFitDisplayer::Construct(), RGTextMessageRequester::Construct(), RGPrintRequester::Construct(), RGTreeRequester::Construct(), RGListRequester::Construct(), RGMessageRequester::RGMessageRequester(), and RGStringRequester::RGStringRequester().
|
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().
|
inlinevirtual |
Set the cancellation flag for closing the window when a button is clicked (this function may be used in buttons slots).
b | flag status |
References cancel_close.
Referenced by RGFitDisplayer::Button(), RGTreeRequester::ProcessButton(), and RGListRequester::ProcessButton().
|
inlinevirtual |
Signal sent when a button is clicked.
n | button number |
Referenced by RGStringRequester::Button(), and Button().
|
virtual |
Slot called for events in the main frame.
event | pointer to event data |
|
virtual |
Slot used to get the button clicked, and to send the corresponding signal ReqButtonClicked(Int_t).
n | requester button identifier |
Reimplemented in RGFitDisplayer, and RGStringRequester.
References ReqButtonClicked(), and result_adr.
|
virtual |
Close the request (slot from close window button).
References ~RGBaseRequester().
RGBaseRequester::ClassDef | ( | RGBaseRequester | , |
0 | |||
) |
For ROOT dictionary.