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
28class TGFrame;
29class TGLayoutHints;
30class TGPicture;
31//////////////////////////////////////////////////////////////////////////
32class TGuiBldAction : public TNamed {
33
34public:
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//////////////////////////////////////////////////////////////////////////
51
52protected:
53 TGuiBldAction *fAction; // current action
54
55public:
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
73R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
74
75#endif
#define R__EXTERN
Definition: DllImport.h:27
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:73
EGuiBldAction
Definition: TGuiBuilder.h:25
@ kGuiBldCtor
Definition: TGuiBuilder.h:25
@ kGuiBldProj
Definition: TGuiBuilder.h:25
@ kGuiBldNone
Definition: TGuiBuilder.h:25
@ kGuiBldMacro
Definition: TGuiBuilder.h:26
@ kGuiBldFunc
Definition: TGuiBuilder.h:26
virtual ~TGuiBldAction()
destructor
TGuiBldAction(const char *name=0, const char *title=0, Int_t type=kGuiBldCtor, TGLayoutHints *hints=0)
constructor
TGLayoutHints * fHints
Definition: TGuiBuilder.h:39
const TGPicture * fPicture
Definition: TGuiBuilder.h:38
const char * fPic
Definition: TGuiBuilder.h:37
TString fAct
Definition: TGuiBuilder.h:36
TGuiBldAction * GetAction() const
Definition: TGuiBuilder.h:63
virtual void Show()
Definition: TGuiBuilder.h:65
TGuiBldAction * fAction
Definition: TGuiBuilder.h:53
virtual void AddAction(TGuiBldAction *, const char *)
Definition: TGuiBuilder.h:59
virtual void Hide()
Definition: TGuiBuilder.h:66
virtual ~TGuiBuilder()
destructor
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
TGuiBuilder()
constructor
virtual void AddSection(const char *)
Definition: TGuiBuilder.h:60
virtual TGFrame * ExecuteAction()
Definition: TGuiBuilder.h:61
virtual void SetAction(TGuiBldAction *act)
Definition: TGuiBuilder.h:62
virtual Bool_t IsExecutable() const
Definition: TGuiBuilder.h:64
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Basic string class.
Definition: TString.h:131
Bool_t IsNull() const
Definition: TString.h:402