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

#include <RGPrintRequester.hh>

Inheritance diagram for RGPrintRequester:
RGMessageRequester RGBaseRequester

Public Member Functions

 RGPrintRequester (const TGWindow *parent, const TGWindow *main, string &command, int &result, const char *title, const char *message="", const char *buttons=rDico.prrq_print_buttons.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGPrintRequester (const TGWindow *parent, const TGWindow *main, const string &fname, string &command, int &result, const char *title, const char *message="", const char *buttons=rDico.prrq_print_buttons.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGPrintRequester (const TGWindow *parent, const TGWindow *main, const string &fname, const char *title, const char *message="", const char *buttons=rDico.prrq_print_buttons.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGPrintRequester (const TGWindow *parent, const TGWindow *main, TPad *pad, const char *title, const char *message="", const char *buttons=rDico.prrq_print_buttons.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
virtual ~RGPrintRequester ()
 
virtual void Construct ()
 
virtual void Button (const int n)
 
 ClassDef (RGPrintRequester, 0)
 
- Public Member Functions inherited from RGMessageRequester
 RGMessageRequester (const TGWindow *parent, const TGWindow *main, int &result, const char *title, const char *message, const ULong_t text_align=kLHintsCenterX|kLHintsExpandX, const char *buttons=rDico.brq_continue.c_str(), const ULong_t opts=0, const bool auto_start=true)
 
 RGMessageRequester (const TGWindow *parent, const TGWindow *main, const char *title, const char *message, const ULong_t text_align=kLHintsCenterX|kLHintsExpandX, const char *buttons=rDico.brq_continue.c_str(), const ULong_t opts=0, const bool auto_start=false)
 
virtual ~RGMessageRequester ()
 
 ClassDef (RGMessageRequester, 0)
 
- Public Member Functions inherited from 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)
 
 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)
 

Static Public Member Functions

static string GetCommand ()
 
static Double_t GetSizeX ()
 
static Double_t GetSizeY ()
 
static Int_t GetOrientation ()
 
static string GetPrintOptions ()
 
static void SetCommand (const string &cmd)
 
static void SetSizeX (const Double_t x)
 
static void SetSizeY (const Double_t y)
 
static void SetOrientation (const Int_t opt)
 
static string GetPrintCommand (const string &fname)
 
static void Print (const string &fname)
 
static void Print (TPad *pad)
 

Private Member Functions

 GObject (RGPrintRequester)
 
 RGPrintRequester (const RGPrintRequester &req)
 

Private Attributes

string * print_command
 Result print command pointer.
 
bool exec_print
 Flag if command must be executed (printing)
 
string file_name
 File name to print.
 
TPad * pad_ptr
 Pointer to pad to print.
 
RGPadPrintCommandw_print_cmd
 Print command widget.
 

Static Private Attributes

static string default_command = "lpr %f"
 Print command.
 
static Double_t default_size_x = 18.
 Paper width.
 
static Double_t default_size_y = 26.
 Paper height.
 
static Int_t default_orientation = 0
 Paper orientation.
 

Additional Inherited Members

- Protected Member Functions inherited from RGMessageRequester
 RGMessageRequester (const RGMessageRequester &req)
 
- Protected Member Functions inherited from RGBaseRequester
 RGBaseRequester (const RGBaseRequester &req)
 
- Protected Attributes inherited from RGBaseRequester
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 inherited from RGBaseRequester
static UInt_t max_width = 1200
 Maximum request width.
 
static UInt_t max_height = 800
 Maximum request height.
 

Detailed Description

class RGPrintRequester

This class defines a print request:

  • either to print a file
  • either to get a printing command

In the command line, the file name is indicated by 'f' tag.

For a request returning a printing command, if 'f' tag is found, it is replaced by the file name, else the file name is added at the end of the command.

The type of request depends on the constructor choice. The options are kept in static variables of the class, so that they are memorized.

Constructor & Destructor Documentation

RGPrintRequester::RGPrintRequester ( const TGWindow *  parent,
const TGWindow *  main,
string &  command,
int &  result,
const char *  title,
const char *  message = "",
const char *  buttons = rDico.prrq_print_buttons.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = true 
)

Constructor with print command return. The command line do not replace a file name.

When closing, the argument result get information on the button that closed the request, and command get the printing command without file name.

Parameters
parentparent window
mainmain application window
commandreturned command line
resultreturn value (button)
titletitle
messageassociated text message
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), exec_print, file_name, pad_ptr, print_command, and RGBaseRequester::Request().

RGPrintRequester::RGPrintRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string &  fname,
string &  command,
int &  result,
const char *  title,
const char *  message = "",
const char *  buttons = rDico.prrq_print_buttons.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = true 
)

Constructor with print command return including file name.

When closing, the argument result get information on the button that closed the request, and command get the printing command without file name.

Parameters
parentparent window
mainmain application window
fnamename of the file to print
commandreturned command line
resultreturn value (button)
titletitle
messageassociated text message
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), exec_print, file_name, pad_ptr, print_command, and RGBaseRequester::Request().

RGPrintRequester::RGPrintRequester ( const TGWindow *  parent,
const TGWindow *  main,
const string &  fname,
const char *  title,
const char *  message = "",
const char *  buttons = rDico.prrq_print_buttons.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = true 
)

Constructor of a request for immediate printing of a file. There is no returned value.

Parameters
parentparent window
mainmain application window
fnamename of the file to print
titletitle
messageassociated text message
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), exec_print, file_name, RGBaseRequester::options, pad_ptr, print_command, and RGBaseRequester::Request().

RGPrintRequester::RGPrintRequester ( const TGWindow *  parent,
const TGWindow *  main,
TPad *  pad,
const char *  title,
const char *  message = "",
const char *  buttons = rDico.prrq_print_buttons.c_str(),
const ULong_t  opts = 0,
const bool  auto_start = true 
)

Constructor of a request for immediate printing of a pad. There is no returned value.

Parameters
parentparent window
mainmain application window
padpointer of pad to print
titletitle
messageassociated text message
buttonsbuttons texts
optsoptions
auto_startflag for execution at construction

References Construct(), exec_print, file_name, pad_ptr, print_command, and RGBaseRequester::Request().

RGPrintRequester::RGPrintRequester ( const RGPrintRequester req)
private

Copy constructor, not implemented.

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

Destructor.

Member Function Documentation

RGPrintRequester::GObject ( RGPrintRequester  )
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.
string RGPrintRequester::GetCommand ( )
inlinestatic

Get the print command, without checking for file name, from static class information.

References default_command.

Double_t RGPrintRequester::GetSizeX ( )
inlinestatic

Get paper size X (cm), from static data.

References default_size_x.

Double_t RGPrintRequester::GetSizeY ( )
inlinestatic

Get paper size Y (cm), from static data.

References default_size_y.

Int_t RGPrintRequester::GetOrientation ( )
inlinestatic

Get paper orientation, from static data.

References default_orientation.

string RGPrintRequester::GetPrintOptions ( )
static

Get the print options to generate a file from a ROOT canvas, using static options.

References default_orientation.

void RGPrintRequester::SetCommand ( const string &  cmd)
inlinestatic

Set default print command line.

Parameters
cmdnew command

References default_command.

void RGPrintRequester::SetSizeX ( const Double_t  x)
inlinestatic

Set default paper size X (cm).

Parameters
xsize

References default_size_x.

void RGPrintRequester::SetSizeY ( const Double_t  y)
inlinestatic

Set default paper size Y (cm).

Parameters
ysize

References default_size_y.

void RGPrintRequester::SetOrientation ( const Int_t  opt)
inlinestatic

Set default paper orientation.

Parameters
optorientation

References default_orientation.

string RGPrintRequester::GetPrintCommand ( const string &  fname)
static

Get print command line from static options.

Parameters
fnamefile name

References default_command.

Referenced by Button(), and Print().

void RGPrintRequester::Print ( const string &  fname)
static

Print a file from the command line from static data (paper size options are not considered here).

Parameters
fnamefile name

References GetPrintCommand().

Referenced by Button(), and Print().

void RGPrintRequester::Print ( TPad *  pad)
static

Print a pad from the command line from static data.

Parameters
padpad pointer

References default_orientation, Print(), and TMP_PAD_PRINT_FILE.

RGPrintRequester::ClassDef ( RGPrintRequester  ,
 
)

For ROOT dictionary.


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