Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
21class TGFrame;
22class TGLayoutHints;
23class TGPicture;
24//////////////////////////////////////////////////////////////////////////
25class TGuiBldAction : public TNamed {
26
27public:
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 = nullptr, const char *title = nullptr,
35 Int_t type = kGuiBldCtor, TGLayoutHints *hints = nullptr);
36 virtual ~TGuiBldAction();
37
38 ClassDefOverride(TGuiBldAction,0) // gui builder action
39};
40
41
42//////////////////////////////////////////////////////////////////////////
44
45protected:
46 TGuiBldAction *fAction; // current action
47
48public:
50 virtual ~TGuiBuilder();
51
52 virtual void AddAction(TGuiBldAction *, const char * /*section*/) {}
53 virtual void AddSection(const char * /*section*/) {}
54 virtual TGFrame *ExecuteAction() { return nullptr; }
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
66R__EXTERN TGuiBuilder *gGuiBuilder; // global gui builder
67
68#endif
#define R__EXTERN
Definition DllImport.h:27
#define ClassDef(name, id)
Definition Rtypes.h:337
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGuiBuilder * gGuiBuilder
Definition TGuiBuilder.h:66
EGuiBldAction
Definition TGuiBuilder.h:18
@ kGuiBldCtor
Definition TGuiBuilder.h:18
@ kGuiBldProj
Definition TGuiBuilder.h:18
@ kGuiBldNone
Definition TGuiBuilder.h:18
@ kGuiBldMacro
Definition TGuiBuilder.h:19
@ kGuiBldFunc
Definition TGuiBuilder.h:19
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
virtual ~TGuiBldAction()
destructor
TGLayoutHints * fHints
Definition TGuiBuilder.h:32
const TGPicture * fPicture
Definition TGuiBuilder.h:31
const char * fPic
Definition TGuiBuilder.h:30
TGuiBldAction * GetAction() const
Definition TGuiBuilder.h:56
virtual void Show()
Definition TGuiBuilder.h:58
TGuiBldAction * fAction
Definition TGuiBuilder.h:46
virtual void AddAction(TGuiBldAction *, const char *)
Definition TGuiBuilder.h:52
virtual void Hide()
Definition TGuiBuilder.h:59
virtual ~TGuiBuilder()
destructor
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
TGuiBuilder()
constructor
virtual void AddSection(const char *)
Definition TGuiBuilder.h:53
virtual TGFrame * ExecuteAction()
Definition TGuiBuilder.h:54
virtual void SetAction(TGuiBldAction *act)
Definition TGuiBuilder.h:55
virtual Bool_t IsExecutable() const
Definition TGuiBuilder.h:57
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Basic string class.
Definition TString.h:139
Bool_t IsNull() const
Definition TString.h:418