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 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TGuiBuilder //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 
23 #include "TNamed.h"
24 
27 
28 class TGFrame;
29 class TGLayoutHints;
30 class TGPicture;
31 //////////////////////////////////////////////////////////////////////////
32 class TGuiBldAction : public TNamed {
33 
34 public:
35  Int_t fType; // type of action
36  TString fAct; // action, after action execution new frame is created
37  const char *fPic; // picture name
38  const TGPicture *fPicture; // picture
39  TGLayoutHints *fHints; // layout hints for frame created by action
40 
41  TGuiBldAction(const char *name = 0, const char *title = 0,
42  Int_t type = kGuiBldCtor, TGLayoutHints *hints = 0);
43  virtual ~TGuiBldAction();
44 
45  ClassDef(TGuiBldAction,0) // gui builder action
46 };
47 
48 
49 //////////////////////////////////////////////////////////////////////////
50 class TGuiBuilder {
51 
52 protected:
53  TGuiBldAction *fAction; // current action
54 
55 public:
56  TGuiBuilder();
57  virtual ~TGuiBuilder();
58 
59  virtual void AddAction(TGuiBldAction *, const char * /*section*/) {}
60  virtual void AddSection(const char * /*section*/) {}
61  virtual TGFrame *ExecuteAction() { return 0; }
62  virtual void SetAction(TGuiBldAction *act) { fAction = act; }
63  TGuiBldAction *GetAction() const { return fAction; }
64  virtual Bool_t IsExecutable() const { return fAction && !fAction->fAct.IsNull(); }
65  virtual void Show() {}
66  virtual void Hide() {}
67 
68  static TGuiBuilder *Instance();
69 
70  ClassDef(TGuiBuilder,0) // ABC for gui builder
71 };
72 
73 R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
74 
75 #endif
TGuiBuilder::~TGuiBuilder
virtual ~TGuiBuilder()
destructor
Definition: TGuiBuilder.cxx:140
EGuiBldAction
EGuiBldAction
Definition: TGuiBuilder.h:25
TGPicture
Definition: TGPicture.h:36
TGuiBuilder::TGuiBuilder
TGuiBuilder()
constructor
Definition: TGuiBuilder.cxx:121
TNamed.h
TGuiBuilder::SetAction
virtual void SetAction(TGuiBldAction *act)
Definition: TGuiBuilder.h:62
gGuiBuilder
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:73
TString
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
TGuiBuilder::IsExecutable
virtual Bool_t IsExecutable() const
Definition: TGuiBuilder.h:64
TGuiBldAction::fAct
TString fAct
Definition: TGuiBuilder.h:36
TGuiBldAction::fPic
const char * fPic
Definition: TGuiBuilder.h:37
bool
TGuiBldAction::TGuiBldAction
TGuiBldAction(const char *name=0, const char *title=0, Int_t type=kGuiBldCtor, TGLayoutHints *hints=0)
constructor
Definition: TGuiBuilder.cxx:102
kGuiBldNone
@ kGuiBldNone
Definition: TGuiBuilder.h:31
TNamed
Definition: TNamed.h:29
TGLayoutHints
Definition: TGLayout.h:57
TGuiBldAction::fHints
TGLayoutHints * fHints
Definition: TGuiBuilder.h:39
TGuiBldAction::~TGuiBldAction
virtual ~TGuiBldAction()
destructor
Definition: TGuiBuilder.cxx:114
TGuiBuilder::AddAction
virtual void AddAction(TGuiBldAction *, const char *)
Definition: TGuiBuilder.h:59
kGuiBldFunc
@ kGuiBldFunc
Definition: TGuiBuilder.h:32
kGuiBldCtor
@ kGuiBldCtor
Definition: TGuiBuilder.h:31
TGuiBuilder::ExecuteAction
virtual TGFrame * ExecuteAction()
Definition: TGuiBuilder.h:61
kGuiBldMacro
@ kGuiBldMacro
Definition: TGuiBuilder.h:32
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGuiBuilder::AddSection
virtual void AddSection(const char *)
Definition: TGuiBuilder.h:60
TGuiBuilder::GetAction
TGuiBldAction * GetAction() const
Definition: TGuiBuilder.h:63
TGuiBldAction
Definition: TGuiBuilder.h:32
TGuiBuilder::fAction
TGuiBldAction * fAction
Definition: TGuiBuilder.h:53
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGuiBldAction::fType
Int_t fType
Definition: TGuiBuilder.h:35
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:38
kGuiBldProj
@ kGuiBldProj
Definition: TGuiBuilder.h:31
type
int type
Definition: TGX11.cxx:121
TGuiBuilder::Hide
virtual void Hide()
Definition: TGuiBuilder.h:66
TGuiBuilder
Definition: TGuiBuilder.h:50
TGuiBuilder::Show
virtual void Show()
Definition: TGuiBuilder.h:65
TGuiBuilder::Instance
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
Definition: TGuiBuilder.cxx:147
int