Logo ROOT   6.10/09
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
virtual void Show()
Definition: TGuiBuilder.h:65
EGuiBldAction
Definition: TGuiBuilder.h:25
virtual void Hide()
Definition: TGuiBuilder.h:66
virtual void SetAction(TGuiBldAction *act)
Definition: TGuiBuilder.h:62
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * fPic
Definition: TGuiBuilder.h:37
TGLayoutHints * fHints
Definition: TGuiBuilder.h:39
const TGPicture * fPicture
Definition: TGuiBuilder.h:38
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual Bool_t IsExecutable() const
Definition: TGuiBuilder.h:64
virtual void AddAction(TGuiBldAction *, const char *)
Definition: TGuiBuilder.h:59
TGuiBldAction * GetAction() const
Definition: TGuiBuilder.h:63
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:73
virtual TGFrame * ExecuteAction()
Definition: TGuiBuilder.h:61
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:53
Bool_t IsNull() const
Definition: TString.h:385
#define R__EXTERN
Definition: DllImport.h:27
virtual void AddSection(const char *)
Definition: TGuiBuilder.h:60
TString fAct
Definition: TGuiBuilder.h:36