Logo ROOT  
Reference Guide
TGuiBuilder.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Valeriy Onuchin 12/08/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGuiBuilder
13 #define ROOT_TGuiBuilder
14 
15 
16 #include "TNamed.h"
17 
20 
21 class TGFrame;
22 class TGLayoutHints;
23 class TGPicture;
24 //////////////////////////////////////////////////////////////////////////
25 class TGuiBldAction : public TNamed {
26 
27 public:
28  Int_t fType; // type of action
29  TString fAct; // action, after action execution new frame is created
30  const char *fPic; // picture name
31  const TGPicture *fPicture; // picture
32  TGLayoutHints *fHints; // layout hints for frame created by action
33 
34  TGuiBldAction(const char *name = 0, const char *title = 0,
35  Int_t type = kGuiBldCtor, TGLayoutHints *hints = 0);
36  virtual ~TGuiBldAction();
37 
38  ClassDef(TGuiBldAction,0) // gui builder action
39 };
40 
41 
42 //////////////////////////////////////////////////////////////////////////
43 class TGuiBuilder {
44 
45 protected:
46  TGuiBldAction *fAction; // current action
47 
48 public:
49  TGuiBuilder();
50  virtual ~TGuiBuilder();
51 
52  virtual void AddAction(TGuiBldAction *, const char * /*section*/) {}
53  virtual void AddSection(const char * /*section*/) {}
54  virtual TGFrame *ExecuteAction() { return 0; }
55  virtual void SetAction(TGuiBldAction *act) { fAction = act; }
56  TGuiBldAction *GetAction() const { return fAction; }
57  virtual Bool_t IsExecutable() const { return fAction && !fAction->fAct.IsNull(); }
58  virtual void Show() {}
59  virtual void Hide() {}
60 
61  static TGuiBuilder *Instance();
62 
63  ClassDef(TGuiBuilder,0) // ABC for gui builder
64 };
65 
66 R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
67 
68 #endif
TGuiBuilder::~TGuiBuilder
virtual ~TGuiBuilder()
destructor
Definition: TGuiBuilder.cxx:132
EGuiBldAction
EGuiBldAction
Definition: TGuiBuilder.h:18
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
TGuiBuilder::TGuiBuilder
TGuiBuilder()
constructor
Definition: TGuiBuilder.cxx:113
TNamed.h
TGuiBuilder::SetAction
virtual void SetAction(TGuiBldAction *act)
Definition: TGuiBuilder.h:55
gGuiBuilder
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:66
TString
Basic string class.
Definition: TString.h:136
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGuiBuilder::IsExecutable
virtual Bool_t IsExecutable() const
Definition: TGuiBuilder.h:57
TGuiBldAction::fAct
TString fAct
Definition: TGuiBuilder.h:29
TGuiBldAction::fPic
const char * fPic
Definition: TGuiBuilder.h:30
bool
TGuiBldAction::TGuiBldAction
TGuiBldAction(const char *name=0, const char *title=0, Int_t type=kGuiBldCtor, TGLayoutHints *hints=0)
constructor
Definition: TGuiBuilder.cxx:94
kGuiBldNone
@ kGuiBldNone
Definition: TGuiBuilder.h:18
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGuiBldAction::fHints
TGLayoutHints * fHints
Definition: TGuiBuilder.h:32
TGuiBldAction::~TGuiBldAction
virtual ~TGuiBldAction()
destructor
Definition: TGuiBuilder.cxx:106
TGuiBuilder::AddAction
virtual void AddAction(TGuiBldAction *, const char *)
Definition: TGuiBuilder.h:52
kGuiBldFunc
@ kGuiBldFunc
Definition: TGuiBuilder.h:19
kGuiBldCtor
@ kGuiBldCtor
Definition: TGuiBuilder.h:18
TGuiBuilder::ExecuteAction
virtual TGFrame * ExecuteAction()
Definition: TGuiBuilder.h:54
kGuiBldMacro
@ kGuiBldMacro
Definition: TGuiBuilder.h:19
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGuiBuilder::AddSection
virtual void AddSection(const char *)
Definition: TGuiBuilder.h:53
TGuiBuilder::GetAction
TGuiBldAction * GetAction() const
Definition: TGuiBuilder.h:56
TGuiBldAction
Definition: TGuiBuilder.h:25
TGuiBuilder::fAction
TGuiBldAction * fAction
Definition: TGuiBuilder.h:46
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGuiBldAction::fType
Int_t fType
Definition: TGuiBuilder.h:28
name
char name[80]
Definition: TGX11.cxx:110
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
TGuiBldAction::fPicture
const TGPicture * fPicture
Definition: TGuiBuilder.h:31
kGuiBldProj
@ kGuiBldProj
Definition: TGuiBuilder.h:18
type
int type
Definition: TGX11.cxx:121
TGuiBuilder::Hide
virtual void Hide()
Definition: TGuiBuilder.h:59
TGuiBuilder
Definition: TGuiBuilder.h:43
TGuiBuilder::Show
virtual void Show()
Definition: TGuiBuilder.h:58
TGuiBuilder::Instance
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
Definition: TGuiBuilder.cxx:139
int