Logo ROOT   6.08/07
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 #ifndef ROOT_TNamed
24 #include "TNamed.h"
25 #endif
26 
29 
30 class TGFrame;
31 class TGLayoutHints;
32 class TGPicture;
33 //////////////////////////////////////////////////////////////////////////
34 class TGuiBldAction : public TNamed {
35 
36 public:
37  Int_t fType; // type of action
38  TString fAct; // action, after action execution new frame is created
39  const char *fPic; // picture name
40  const TGPicture *fPicture; // picture
41  TGLayoutHints *fHints; // layout hints for frame created by action
42 
43  TGuiBldAction(const char *name = 0, const char *title = 0,
44  Int_t type = kGuiBldCtor, TGLayoutHints *hints = 0);
45  virtual ~TGuiBldAction();
46 
47  ClassDef(TGuiBldAction,0) // gui builder action
48 };
49 
50 
51 //////////////////////////////////////////////////////////////////////////
52 class TGuiBuilder {
53 
54 protected:
55  TGuiBldAction *fAction; // current action
56 
57 public:
58  TGuiBuilder();
59  virtual ~TGuiBuilder();
60 
61  virtual void AddAction(TGuiBldAction *, const char * /*section*/) {}
62  virtual void AddSection(const char * /*section*/) {}
63  virtual TGFrame *ExecuteAction() { return 0; }
64  virtual void SetAction(TGuiBldAction *act) { fAction = act; }
65  TGuiBldAction *GetAction() const { return fAction; }
66  virtual Bool_t IsExecutable() const { return fAction && !fAction->fAct.IsNull(); }
67  virtual void Show() {}
68  virtual void Hide() {}
69 
70  static TGuiBuilder *Instance();
71 
72  ClassDef(TGuiBuilder,0) // ABC for gui builder
73 };
74 
75 R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
76 
77 #endif
virtual void Show()
Definition: TGuiBuilder.h:67
EGuiBldAction
Definition: TGuiBuilder.h:27
virtual void Hide()
Definition: TGuiBuilder.h:68
virtual void SetAction(TGuiBldAction *act)
Definition: TGuiBuilder.h:64
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * fPic
Definition: TGuiBuilder.h:39
TGLayoutHints * fHints
Definition: TGuiBuilder.h:41
const TGPicture * fPicture
Definition: TGuiBuilder.h:40
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Bool_t IsExecutable() const
Definition: TGuiBuilder.h:66
virtual void AddAction(TGuiBldAction *, const char *)
Definition: TGuiBuilder.h:61
TGuiBldAction * GetAction() const
Definition: TGuiBuilder.h:65
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:75
virtual TGFrame * ExecuteAction()
Definition: TGuiBuilder.h:63
virtual ~TGuiBldAction()
destructor
TGuiBldAction(const char *name=0, const char *title=0, Int_t type=kGuiBldCtor, TGLayoutHints *hints=0)
constructor
int type
Definition: TGX11.cxx:120
TGuiBldAction * fAction
Definition: TGuiBuilder.h:55
Bool_t IsNull() const
Definition: TString.h:387
#define R__EXTERN
Definition: DllImport.h:27
virtual void AddSection(const char *)
Definition: TGuiBuilder.h:62
TString fAct
Definition: TGuiBuilder.h:38
char name[80]
Definition: TGX11.cxx:109