Logo ROOT   6.08/07
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 #ifndef ROOT_TGFrame
23 #include "TGFrame.h"
24 #endif
25 #ifndef ROOT_TGuiBuilder
26 #include "TGuiBuilder.h"
27 #endif
28 
36 
38 
44 
48 
50 };
51 
52 
53 class TGShutter;
54 class TGMdiMainFrame;
55 class TGDockableFrame;
56 class TGMdiMenuBar;
57 class TGPopupMenu;
58 class TGStatusBar;
59 class TGuiBldDragManager;
60 class TGToolBar;
61 class TGMdiFrame;
62 class TGuiBldEditor;
63 class TGButton;
64 class TGPictureButton;
65 class TImage;
66 class TTimer;
67 
68 //////////////////////////////////////////////////////////////////////////
69 class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
70 
71 friend class TGuiBldDragManager;
72 
73 private:
74  TGuiBldDragManager *fManager; // drag and drop manager
75  TGButton *fActionButton;// action button
76  TGToolBar *fToolBar; // guibuider toolbar
77  TGShutter *fShutter; // widget palette
78  TGMdiMainFrame *fMain; // main mdi frame
79  TGDockableFrame *fToolDock; // dockable frame where toolbar is located
80  TGDockableFrame *fShutterDock; // dockable frame where widget palette is located
81  TGMdiMenuBar *fMenuBar; // guibuilder menu bar
82  TGPopupMenu *fMenuFile; // "File" popup menu
83  TGPopupMenu *fMenuWindow; // "Window" popup menu
84  TGPopupMenu *fMenuEdit; // "Edit" popup menu
85  TGPopupMenu *fMenuHelp; // "Help" popup menu
86  TGStatusBar *fStatusBar; // guibuilder status bar
87  TGFrame *fSelected; // selected frame
88  TGMdiFrame *fEditable; // mdi frame where editted frame is located
89  TGuiBldEditor *fEditor; // frame property editor
90  const TGPicture *fIconPic; // icon picture
91  TGPictureButton *fStartButton; // start button
93 
94  static TGGC *fgBgnd;
95  static TGGC *fgBgndPopup;
97 
98  void InitMenu();
99  void EnableLassoButtons(Bool_t on = kTRUE);
101  void EnableEditButtons(Bool_t on = kTRUE);
102  void BindKeys();
103  TGButton *FindActionButton(const char *name, const char *section);
104 
105 public:
106  TRootGuiBuilder(const TGWindow *p = 0);
107  virtual ~TRootGuiBuilder();
108 
109  virtual void AddAction(TGuiBldAction *act, const char *sect);
110  virtual void AddMacro(const char *macro, TImage *img);
111  virtual void AddSection(const char *sect);
112  virtual TGFrame *ExecuteAction();
113  virtual void HandleButtons();
114  virtual void Show() { MapRaised(); }
115  virtual void Hide();
116  virtual void ChangeSelected(TGFrame *f);
117  virtual void Update();
118  virtual Bool_t IsSelectMode() const;
119  virtual Bool_t IsGrabButtonDown() const;
120  virtual Bool_t OpenProject(Event_t *event = 0);
121  virtual Bool_t SaveProject(Event_t *event = 0);
122  virtual Bool_t NewProject(TString type = "");
123  virtual Bool_t HandleKey(Event_t *event);
124  virtual void HandleMenu(Int_t id);
125  virtual void CloseWindow();
126  virtual void MaybeCloseWindow();
127  virtual void HandleWindowClosed(Int_t id);
128  virtual void UpdateStatusBar(const char *text = 0);
129  virtual void EraseStatusBar();
130  virtual void SwitchToolbarButton();
131 
133  TGuiBldEditor *GetEditor() const { return fEditor; }
134  TGDockableFrame *GetToolDock() const { return fToolDock; }
135  TGMdiMainFrame *GetMdiMain() const { return fMain; }
136  TGMdiFrame *GetEditable() const { return fEditable; }
138 
139  static ULong_t GetBgnd();
140  static TGGC *GetBgndGC();
141 
142  static ULong_t GetPopupBgnd();
143  static TGGC *GetPopupBgndGC();
144 
145  static ULong_t GetPopupHlght();
146  static TGGC *GetPopupHlghtGC();
147 
148  static void PropagateBgndColor(TGFrame *frame, Pixel_t color);
149 
150  static TGFrame *HSplitter();
151  static TGFrame *VSplitter();
152  static TGPopupMenu *CreatePopup();
153  static TGFrame *BuildListTree();
154  static TGFrame *BuildCanvas();
155  static TGFrame *BuildShutter();
156  static TGFrame *BuildTextEdit();
157  static TGFrame *BuildTab();
158  static TGFrame *BuildListBox();
159  static TGFrame *BuildComboBox();
160  static TGFrame *BuildH3DLine();
161  static TGFrame *BuildV3DLine();
162  static TGFrame *BuildHScrollBar();
163  static TGFrame *BuildVScrollBar();
164  static TGFrame *BuildHProgressBar();
165  static TGFrame *BuildVProgressBar();
166 
167 
168  ClassDef(TRootGuiBuilder,0) // ROOT GUI Builder
169 };
170 
171 
172 #endif
virtual void AddMacro(const char *macro, TImage *img)
Add macro to "User's Macros" section Input img must be static - do not delete it. ...
TGuiBldDragManager * GetManager() const
TGuiBldDragManager * fManager
TGDockableFrame * fToolDock
virtual void MaybeCloseWindow()
Handler before closing MDI frame.
static TGFrame * BuildHProgressBar()
Helper method to create TGHProgressBar.
TGStatusBar * fStatusBar
static TGGC * GetBgndGC()
Return background GC.
static TGFrame * BuildListBox()
Helper method to create TGListBox widget.
static TGFrame * BuildV3DLine()
Helper method to create TGVertical3DLine widget.
virtual Bool_t IsSelectMode() const
Return the status of the selected mode.
static TGFrame * HSplitter()
Creates new horizontal splitter (TGHSplitter).
virtual Bool_t IsGrabButtonDown() const
Return the status of the grab mode.
virtual void Show()
static ULong_t GetBgnd()
Return default background color.
Basic string class.
Definition: TString.h:137
TGMdiMainFrame * GetMdiMain() const
virtual ~TRootGuiBuilder()
Destructor.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGMdiMenuBar * fMenuBar
An abstract interface to image processing library.
Definition: TImage.h:37
virtual TGFrame * ExecuteAction()
Execute an action.
virtual void MapRaised()
Definition: TGFrame.h:268
virtual void HandleWindowClosed(Int_t id)
Handler for closed MDI frame.
virtual void HandleButtons()
Handle buttons in the GUI builder's widget palette.
TGPopupMenu * fMenuFile
static ULong_t GetPopupBgnd()
Return background color for popup menus.
TGFrame * fSelected
#define ClassDef(name, id)
Definition: Rtypes.h:254
static TGFrame * VSplitter()
Create new vertical splitter (TGVSplitter).
ULong_t Pixel_t
Definition: GuiTypes.h:41
static TGFrame * BuildCanvas()
Helper method used in guibuilding to create TGCanvas widget.
TRootGuiBuilder(const TGWindow *p=0)
Create GUI builder application.
TGuiBldEditor * GetEditor() const
static TGGC * fgBgndPopupHlght
void EnableLassoButtons(Bool_t on=kTRUE)
Enable toolbar buttons for alignment.
static ULong_t GetPopupHlght()
Return highlighted color for popup menu entry.
virtual void EraseStatusBar()
Clear information shown in the status bar.
static TGFrame * BuildComboBox()
Helper method to create TGComboBox widget.
virtual Bool_t SaveProject(Event_t *event=0)
Save selected project.
static TGGC * GetPopupBgndGC()
Return background GC for popup menus.
virtual void UpdateStatusBar(const char *text=0)
Update information shown on the status bar.
virtual void AddSection(const char *sect)
Add new shutter item.
EGuiBuilderMenuIds
static TGGC * fgBgndPopup
static TGFrame * BuildHScrollBar()
Helper method to create TGHScrollBar.
static TGFrame * BuildTextEdit()
Helper method to create TGTextEdit widget.
void EnableSelectedButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
TGButton * FindActionButton(const char *name, const char *section)
Find action by name.
TGMdiFrame * fEditable
static TGFrame * BuildH3DLine()
Helper method to create TGHorizontal3DLine widget.
static TGFrame * BuildVProgressBar()
Helper method to create TGVProgressBar.
TGuiBldEditor * fEditor
virtual void CloseWindow()
Close GUI builder via window manager "Close" button.
void InitMenu()
Inititiate GUI Builder menus.
TGPopupMenu * fMenuWindow
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:57
void BindKeys()
Keyborad key binding.
TGMdiMainFrame * fMain
void EnableEditButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
static void PropagateBgndColor(TGFrame *frame, Pixel_t color)
Set a background color to frame and all its subframes.
TGPictureButton * fStartButton
virtual Bool_t HandleKey(Event_t *event)
Handle keys.
virtual void AddAction(TGuiBldAction *act, const char *sect)
Add new action to widget palette.
static TGFrame * BuildTab()
Helper method to create TGTab widget.
virtual void Update()
Update gui builder.
TGDockableFrame * fShutterDock
double f(double x)
virtual void HandleMenu(Int_t id)
Handle menu items.
TGButton * fActionButton
TText * text
TGMdiFrame * FindEditableMdiFrame(const TGWindow *win)
Find the editable frame.
virtual void SwitchToolbarButton()
Switch image of toolbar edit button according to the current state.
int type
Definition: TGX11.cxx:120
virtual void Hide()
Hide builder.
unsigned long ULong_t
Definition: RtypesCore.h:51
static TGFrame * BuildListTree()
Helper method used in guibuilding.
TGShutter * fShutter
TGPopupMenu * fMenuEdit
static TGFrame * BuildVScrollBar()
Helper method to create TGVScrollBar.
static TGGC * fgBgnd
static TGPopupMenu * CreatePopup()
Return style popup menu.
virtual Bool_t NewProject(TString type="")
Create a new project.
const TGPicture * fIconPic
virtual Bool_t OpenProject(Event_t *event=0)
Open new gui builder project.
TGPopupMenu * fMenuHelp
TGDockableFrame * GetToolDock() const
TGToolBar * fToolBar
static TGGC * GetPopupHlghtGC()
Return background GC for highlighted popup menu entry.
const Bool_t kTRUE
Definition: Rtypes.h:91
static TGFrame * BuildShutter()
Helper method used in guibuilding to create TGShutter widget.
virtual void ChangeSelected(TGFrame *f)
Set selected frame.
TGMdiFrame * GetEditable() const
Definition: TGGC.h:35
char name[80]
Definition: TGX11.cxx:109