Logo ROOT  
Reference Guide
TRootGuiBuilder.h
Go to the documentation of this file.
1 // @(#)root/guibuilder:$Id$
2 // Author: Valeriy Onuchin 12/09/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_TRootGuiBuilder
13 #define ROOT_TRootGuiBuilder
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TRootGuiBuilder //
19 // //
20 //////////////////////////////////////////////////////////////////////////
21 
22 #include "TGFrame.h"
23 #include "TGuiBuilder.h"
24 
32 
34 
40 
44 
46 };
47 
48 
49 class TGShutter;
50 class TGMdiMainFrame;
51 class TGDockableFrame;
52 class TGMdiMenuBar;
53 class TGPopupMenu;
54 class TGStatusBar;
55 class TGuiBldDragManager;
56 class TGToolBar;
57 class TGMdiFrame;
58 class TGuiBldEditor;
59 class TGButton;
60 class TGPictureButton;
61 class TImage;
62 class TTimer;
63 
64 //////////////////////////////////////////////////////////////////////////
65 class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
66 
67 friend class TGuiBldDragManager;
68 
69 private:
70  TGuiBldDragManager *fManager; // drag and drop manager
71  TGButton *fActionButton;// action button
72  TGToolBar *fToolBar; // guibuider toolbar
73  TGShutter *fShutter; // widget palette
74  TGMdiMainFrame *fMain; // main mdi frame
75  TGDockableFrame *fToolDock; // dockable frame where toolbar is located
76  TGDockableFrame *fShutterDock; // dockable frame where widget palette is located
77  TGMdiMenuBar *fMenuBar; // guibuilder menu bar
78  TGPopupMenu *fMenuFile; // "File" popup menu
79  TGPopupMenu *fMenuWindow; // "Window" popup menu
80  TGPopupMenu *fMenuEdit; // "Edit" popup menu
81  TGPopupMenu *fMenuHelp; // "Help" popup menu
82  TGStatusBar *fStatusBar; // guibuilder status bar
83  TGFrame *fSelected; // selected frame
84  TGMdiFrame *fEditable; // mdi frame where editted frame is located
85  TGuiBldEditor *fEditor; // frame property editor
86  const TGPicture *fIconPic; // icon picture
87  TGPictureButton *fStartButton; // start button
89 
90  static TGGC *fgBgnd;
91  static TGGC *fgBgndPopup;
93 
94  void InitMenu();
95  void EnableLassoButtons(Bool_t on = kTRUE);
97  void EnableEditButtons(Bool_t on = kTRUE);
98  void BindKeys();
99  TGButton *FindActionButton(const char *name, const char *section);
100 
101 public:
102  TRootGuiBuilder(const TGWindow *p = 0);
103  virtual ~TRootGuiBuilder();
104 
105  virtual void AddAction(TGuiBldAction *act, const char *sect);
106  virtual void AddMacro(const char *macro, TImage *img);
107  virtual void AddSection(const char *sect);
108  virtual TGFrame *ExecuteAction();
109  virtual void HandleButtons();
110  virtual void Show() { MapRaised(); }
111  virtual void Hide();
112  virtual void ChangeSelected(TGFrame *f);
113  virtual void Update();
114  virtual Bool_t IsSelectMode() const;
115  virtual Bool_t IsGrabButtonDown() const;
116  virtual Bool_t OpenProject(Event_t *event = 0);
117  virtual Bool_t SaveProject(Event_t *event = 0);
118  virtual Bool_t NewProject(TString type = "");
119  virtual Bool_t HandleKey(Event_t *event);
120  virtual void HandleMenu(Int_t id);
121  virtual void CloseWindow();
122  virtual void MaybeCloseWindow();
123  virtual void HandleWindowClosed(Int_t id);
124  virtual void UpdateStatusBar(const char *text = 0);
125  virtual void EraseStatusBar();
126  virtual void SwitchToolbarButton();
127 
129  TGuiBldEditor *GetEditor() const { return fEditor; }
130  TGDockableFrame *GetToolDock() const { return fToolDock; }
131  TGMdiMainFrame *GetMdiMain() const { return fMain; }
132  TGMdiFrame *GetEditable() const { return fEditable; }
134 
135  static ULong_t GetBgnd();
136  static TGGC *GetBgndGC();
137 
138  static ULong_t GetPopupBgnd();
139  static TGGC *GetPopupBgndGC();
140 
141  static ULong_t GetPopupHlght();
142  static TGGC *GetPopupHlghtGC();
143 
144  static void PropagateBgndColor(TGFrame *frame, Pixel_t color);
145 
146  static TGFrame *HSplitter();
147  static TGFrame *VSplitter();
148  static TGPopupMenu *CreatePopup();
149  static TGFrame *BuildListTree();
150  static TGFrame *BuildCanvas();
151  static TGFrame *BuildShutter();
152  static TGFrame *BuildTextEdit();
153  static TGFrame *BuildTab();
154  static TGFrame *BuildListBox();
155  static TGFrame *BuildComboBox();
156  static TGFrame *BuildH3DLine();
157  static TGFrame *BuildV3DLine();
158  static TGFrame *BuildHScrollBar();
159  static TGFrame *BuildVScrollBar();
160  static TGFrame *BuildHProgressBar();
161  static TGFrame *BuildVProgressBar();
162 
163 
164  ClassDef(TRootGuiBuilder,0) // ROOT GUI Builder
165 };
166 
167 
168 #endif
TRootGuiBuilder::fEditable
TGMdiFrame * fEditable
Definition: TRootGuiBuilder.h:84
TRootGuiBuilder::fEditor
TGuiBldEditor * fEditor
Definition: TRootGuiBuilder.h:85
TRootGuiBuilder::BuildV3DLine
static TGFrame * BuildV3DLine()
Helper method to create TGVertical3DLine widget.
Definition: TRootGuiBuilder.cxx:2531
TRootGuiBuilder::Hide
virtual void Hide()
Hide builder.
Definition: TRootGuiBuilder.cxx:2160
TGWindow
Definition: TGWindow.h:31
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGMainFrame
Definition: TGFrame.h:444
kGUIBLD_WINDOW_CASCADE
@ kGUIBLD_WINDOW_CASCADE
Definition: TRootGuiBuilder.h:37
TGPicture
Definition: TGPicture.h:36
f
#define f(i)
Definition: RSha256.hxx:104
TRootGuiBuilder::IsSelectMode
virtual Bool_t IsSelectMode() const
Return the status of the selected mode.
Definition: TRootGuiBuilder.cxx:1422
TRootGuiBuilder::GetBgnd
static ULong_t GetBgnd()
Return default background color.
Definition: TRootGuiBuilder.cxx:2169
TRootGuiBuilder::PropagateBgndColor
static void PropagateBgndColor(TGFrame *frame, Pixel_t color)
Set a background color to frame and all its subframes.
Definition: TRootGuiBuilder.cxx:2206
TRootGuiBuilder::~TRootGuiBuilder
virtual ~TRootGuiBuilder()
Destructor.
Definition: TRootGuiBuilder.cxx:932
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TRootGuiBuilder::GetPopupBgndGC
static TGGC * GetPopupBgndGC()
Return background GC for popup menus.
Definition: TRootGuiBuilder.cxx:2249
kGUIBLD_FILE_SAVE
@ kGUIBLD_FILE_SAVE
Definition: TRootGuiBuilder.h:31
kGUIBLD_EDIT_PREF
@ kGUIBLD_EDIT_PREF
Definition: TRootGuiBuilder.h:33
TRootGuiBuilder::CreatePopup
static TGPopupMenu * CreatePopup()
Return style popup menu.
Definition: TRootGuiBuilder.cxx:2303
TRootGuiBuilder::EnableEditButtons
void EnableEditButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
Definition: TRootGuiBuilder.cxx:1339
TRootGuiBuilder::Update
virtual void Update()
Update gui builder.
Definition: TRootGuiBuilder.cxx:1385
TRootGuiBuilder::ChangeSelected
virtual void ChangeSelected(TGFrame *f)
Set selected frame.
Definition: TRootGuiBuilder.cxx:1214
TGToolBar
Definition: TGToolBar.h:42
TRootGuiBuilder::GetBgndGC
static TGGC * GetBgndGC()
Return background GC.
Definition: TRootGuiBuilder.cxx:2190
TRootGuiBuilder::BuildListBox
static TGFrame * BuildListBox()
Helper method to create TGListBox widget.
Definition: TRootGuiBuilder.cxx:2475
TRootGuiBuilder::FindEditableMdiFrame
TGMdiFrame * FindEditableMdiFrame(const TGWindow *win)
Find the editable frame.
Definition: TRootGuiBuilder.cxx:1738
Int_t
int Int_t
Definition: RtypesCore.h:45
TRootGuiBuilder
Definition: TRootGuiBuilder.h:65
TRootGuiBuilder::IsGrabButtonDown
virtual Bool_t IsGrabButtonDown() const
Return the status of the grab mode.
Definition: TRootGuiBuilder.cxx:1435
TImage
An abstract interface to image processing library.
Definition: TImage.h:29
TRootGuiBuilder::HandleMenu
virtual void HandleMenu(Int_t id)
Handle menu items.
Definition: TRootGuiBuilder.cxx:1783
TRootGuiBuilder::VSplitter
static TGFrame * VSplitter()
Create new vertical splitter (TGVSplitter).
Definition: TRootGuiBuilder.cxx:2102
kGUIBLD_FILE_START
@ kGUIBLD_FILE_START
Definition: TRootGuiBuilder.h:29
TRootGuiBuilder::EnableSelectedButtons
void EnableSelectedButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
Definition: TRootGuiBuilder.cxx:1267
TRootGuiBuilder::fMenuEdit
TGPopupMenu * fMenuEdit
Definition: TRootGuiBuilder.h:80
TString
Basic string class.
Definition: TString.h:136
TRootGuiBuilder::CloseWindow
virtual void CloseWindow()
Close GUI builder via window manager "Close" button.
Definition: TRootGuiBuilder.cxx:944
TGFrame
Definition: TGFrame.h:105
TRootGuiBuilder::GetEditor
TGuiBldEditor * GetEditor() const
Definition: TRootGuiBuilder.h:129
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
kGUIBLD_WINDOW_VERT
@ kGUIBLD_WINDOW_VERT
Definition: TRootGuiBuilder.h:36
text
TText * text
Definition: entrylist_figure1.C:10
TRootGuiBuilder::GetToolDock
TGDockableFrame * GetToolDock() const
Definition: TRootGuiBuilder.h:130
bool
TRootGuiBuilder::fShutterDock
TGDockableFrame * fShutterDock
Definition: TRootGuiBuilder.h:76
TRootGuiBuilder::HandleButtons
virtual void HandleButtons()
Handle buttons in the GUI builder's widget palette.
Definition: TRootGuiBuilder.cxx:1068
kGUIBLD_HELP_ABOUT
@ kGUIBLD_HELP_ABOUT
Definition: TRootGuiBuilder.h:42
TGStatusBar
Definition: TGStatusBar.h:29
TRootGuiBuilder::fToolBar
TGToolBar * fToolBar
Definition: TRootGuiBuilder.h:72
TRootGuiBuilder::BuildTextEdit
static TGFrame * BuildTextEdit()
Helper method to create TGTextEdit widget.
Definition: TRootGuiBuilder.cxx:2441
TRootGuiBuilder::Show
virtual void Show()
Definition: TRootGuiBuilder.h:110
TRootGuiBuilder::fToolDock
TGDockableFrame * fToolDock
Definition: TRootGuiBuilder.h:75
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TRootGuiBuilder::SwitchToolbarButton
virtual void SwitchToolbarButton()
Switch image of toolbar edit button according to the current state.
Definition: TRootGuiBuilder.cxx:1756
kGUIBLD_WINDOW_ARRANGE
@ kGUIBLD_WINDOW_ARRANGE
Definition: TRootGuiBuilder.h:39
TRootGuiBuilder::NewProject
virtual Bool_t NewProject(TString type="")
Create a new project.
Definition: TRootGuiBuilder.cxx:1491
TRootGuiBuilder::fgBgndPopupHlght
static TGGC * fgBgndPopupHlght
Definition: TRootGuiBuilder.h:92
kGUIBLD_FILE_CLOSE
@ kGUIBLD_FILE_CLOSE
Definition: TRootGuiBuilder.h:27
TRootGuiBuilder::FindActionButton
TGButton * FindActionButton(const char *name, const char *section)
Find action by name.
Definition: TRootGuiBuilder.cxx:978
kGUIBLD_HELP_CONTENTS
@ kGUIBLD_HELP_CONTENTS
Definition: TRootGuiBuilder.h:41
TRootGuiBuilder::EnableLassoButtons
void EnableLassoButtons(Bool_t on=kTRUE)
Enable toolbar buttons for alignment.
Definition: TRootGuiBuilder.cxx:1223
TRootGuiBuilder::BuildH3DLine
static TGFrame * BuildH3DLine()
Helper method to create TGHorizontal3DLine widget.
Definition: TRootGuiBuilder.cxx:2520
TGGC
Definition: TGGC.h:31
TRootGuiBuilder::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle keys.
Definition: TRootGuiBuilder.cxx:1462
TGMdiFrame
Definition: TGMdiFrame.h:51
TRootGuiBuilder::SaveProject
virtual Bool_t SaveProject(Event_t *event=0)
Save selected project.
Definition: TRootGuiBuilder.cxx:1602
TGMdiMainFrame
Definition: TGMdiMainFrame.h:138
TRootGuiBuilder::fMenuFile
TGPopupMenu * fMenuFile
Definition: TRootGuiBuilder.h:78
TRootGuiBuilder::UpdateStatusBar
virtual void UpdateStatusBar(const char *text=0)
Update information shown on the status bar.
Definition: TRootGuiBuilder.cxx:1974
TRootGuiBuilder::GetPopupBgnd
static ULong_t GetPopupBgnd()
Return background color for popup menus.
Definition: TRootGuiBuilder.cxx:2227
TRootGuiBuilder::fMain
TGMdiMainFrame * fMain
Definition: TRootGuiBuilder.h:74
TGFrame.h
TRootGuiBuilder::fgBgndPopup
static TGGC * fgBgndPopup
Definition: TRootGuiBuilder.h:91
TRootGuiBuilder::fStatusBar
TGStatusBar * fStatusBar
Definition: TRootGuiBuilder.h:82
TRootGuiBuilder::AddAction
virtual void AddAction(TGuiBldAction *act, const char *sect)
Add new action to widget palette.
Definition: TRootGuiBuilder.cxx:1007
TRootGuiBuilder::BuildComboBox
static TGFrame * BuildComboBox()
Helper method to create TGComboBox widget.
Definition: TRootGuiBuilder.cxx:2496
TRootGuiBuilder::HandleWindowClosed
virtual void HandleWindowClosed(Int_t id)
Handler for closed MDI frame.
Definition: TRootGuiBuilder.cxx:1947
TRootGuiBuilder::GetEditable
TGMdiFrame * GetEditable() const
Definition: TRootGuiBuilder.h:132
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
TGDockableFrame
Definition: TGDockableFrame.h:93
TRootGuiBuilder::BuildTab
static TGFrame * BuildTab()
Helper method to create TGTab widget.
Definition: TRootGuiBuilder.cxx:2461
TRootGuiBuilder::AddSection
virtual void AddSection(const char *sect)
Add new shutter item.
Definition: TRootGuiBuilder.cxx:1056
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TRootGuiBuilder::BuildListTree
static TGFrame * BuildListTree()
Helper method used in guibuilding.
Definition: TRootGuiBuilder.cxx:2311
kGUIBLD_WINDOW_HOR
@ kGUIBLD_WINDOW_HOR
Definition: TRootGuiBuilder.h:35
TRootGuiBuilder::BuildVProgressBar
static TGFrame * BuildVProgressBar()
Helper method to create TGVProgressBar.
Definition: TRootGuiBuilder.cxx:2585
TRootGuiBuilder::InitMenu
void InitMenu()
Inititiate GUI Builder menus.
Definition: TRootGuiBuilder.cxx:1140
TRootGuiBuilder::GetPopupHlghtGC
static TGGC * GetPopupHlghtGC()
Return background GC for highlighted popup menu entry.
Definition: TRootGuiBuilder.cxx:2287
TRootGuiBuilder::fMenuBar
TGMdiMenuBar * fMenuBar
Definition: TRootGuiBuilder.h:77
TRootGuiBuilder::BuildShutter
static TGFrame * BuildShutter()
Helper method used in guibuilding to create TGShutter widget.
Definition: TRootGuiBuilder.cxx:2350
TGuiBldEditor
Definition: TGuiBldEditor.h:39
TRootGuiBuilder::AddMacro
virtual void AddMacro(const char *macro, TImage *img)
Add macro to "User's Macros" section Input img must be static - do not delete it.
Definition: TRootGuiBuilder.cxx:1691
TRootGuiBuilder::ExecuteAction
virtual TGFrame * ExecuteAction()
Execute an action.
Definition: TRootGuiBuilder.cxx:1099
TRootGuiBuilder::GetMdiMain
TGMdiMainFrame * GetMdiMain() const
Definition: TRootGuiBuilder.h:131
TRootGuiBuilder::fMenuWindow
TGPopupMenu * fMenuWindow
Definition: TRootGuiBuilder.h:79
TRootGuiBuilder::BuildCanvas
static TGFrame * BuildCanvas()
Helper method used in guibuilding to create TGCanvas widget.
Definition: TRootGuiBuilder.cxx:2329
TRootGuiBuilder::BindKeys
void BindKeys()
Keyborad key binding.
Definition: TRootGuiBuilder.cxx:2006
TRootGuiBuilder::fgBgnd
static TGGC * fgBgnd
Definition: TRootGuiBuilder.h:90
kGUIBLD_FILE_EXIT
@ kGUIBLD_FILE_EXIT
Definition: TRootGuiBuilder.h:28
TGPictureButton
Definition: TGButton.h:228
TRootGuiBuilder::fClosing
Int_t fClosing
Definition: TRootGuiBuilder.h:88
TRootGuiBuilder::GetManager
TGuiBldDragManager * GetManager() const
Definition: TRootGuiBuilder.h:133
TRootGuiBuilder::fIconPic
const TGPicture * fIconPic
Definition: TRootGuiBuilder.h:86
TGuiBldAction
Definition: TGuiBuilder.h:32
TRootGuiBuilder::GetPopupHlght
static ULong_t GetPopupHlght()
Return highlighted color for popup menu entry.
Definition: TRootGuiBuilder.cxx:2265
TRootGuiBuilder::fSelected
TGFrame * fSelected
Definition: TRootGuiBuilder.h:83
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGPopupMenu
Definition: TGMenu.h:123
Event_t
Definition: GuiTypes.h:173
name
char name[80]
Definition: TGX11.cxx:110
kGUIBLD_WINDOW_OPAQUE
@ kGUIBLD_WINDOW_OPAQUE
Definition: TRootGuiBuilder.h:38
TRootGuiBuilder::MaybeCloseWindow
virtual void MaybeCloseWindow()
Handler before closing MDI frame.
Definition: TRootGuiBuilder.cxx:1919
TRootGuiBuilder::BuildHProgressBar
static TGFrame * BuildHProgressBar()
Helper method to create TGHProgressBar.
Definition: TRootGuiBuilder.cxx:2570
TRootGuiBuilder::BuildVScrollBar
static TGFrame * BuildVScrollBar()
Helper method to create TGVScrollBar.
Definition: TRootGuiBuilder.cxx:2556
TRootGuiBuilder::HSplitter
static TGFrame * HSplitter()
Creates new horizontal splitter (TGHSplitter).
Definition: TRootGuiBuilder.cxx:2131
TRootGuiBuilder::fShutter
TGShutter * fShutter
Definition: TRootGuiBuilder.h:73
TGShutter
Definition: TGShutter.h:69
type
int type
Definition: TGX11.cxx:121
TGButton
Definition: TGButton.h:68
TRootGuiBuilder::BuildHScrollBar
static TGFrame * BuildHScrollBar()
Helper method to create TGHScrollBar.
Definition: TRootGuiBuilder.cxx:2542
kGUIBLD_FILE_STOP
@ kGUIBLD_FILE_STOP
Definition: TRootGuiBuilder.h:30
TRootGuiBuilder::EraseStatusBar
virtual void EraseStatusBar()
Clear information shown in the status bar.
Definition: TRootGuiBuilder.cxx:1996
kGUIBLD_FILE_NEW
@ kGUIBLD_FILE_NEW
Definition: TRootGuiBuilder.h:26
TRootGuiBuilder::fStartButton
TGPictureButton * fStartButton
Definition: TRootGuiBuilder.h:87
TGuiBuilder.h
EGuiBuilderMenuIds
EGuiBuilderMenuIds
Definition: TRootGuiBuilder.h:25
TGuiBuilder
Definition: TGuiBuilder.h:50
TRootGuiBuilder::TRootGuiBuilder
TRootGuiBuilder(const TGWindow *p=0)
Create GUI builder application.
Definition: TRootGuiBuilder.cxx:581
TRootGuiBuilder::fMenuHelp
TGPopupMenu * fMenuHelp
Definition: TRootGuiBuilder.h:81
TRootGuiBuilder::fManager
TGuiBldDragManager * fManager
Definition: TRootGuiBuilder.h:70
kGUIBLD_FILE_OPEN
@ kGUIBLD_FILE_OPEN
Definition: TRootGuiBuilder.h:45
TRootGuiBuilder::fActionButton
TGButton * fActionButton
Definition: TRootGuiBuilder.h:71
kGUIBLD_HELP_BUG
@ kGUIBLD_HELP_BUG
Definition: TRootGuiBuilder.h:43
TRootGuiBuilder::OpenProject
virtual Bool_t OpenProject(Event_t *event=0)
Open new gui builder project.
Definition: TRootGuiBuilder.cxx:1545
TGuiBldDragManager
Definition: TGuiBldDragManager.h:58
int
TGMdiMenuBar
Definition: TGMdiMenu.h:53