Logo ROOT   master
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
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:131
TGMdiMainFrame * GetMdiMain() const
virtual ~TRootGuiBuilder()
Destructor.
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:43
bool Bool_t
Definition: RtypesCore.h:61
TGMdiMenuBar * fMenuBar
An abstract interface to image processing library.
Definition: TImage.h:29
virtual TGFrame * ExecuteAction()
Execute an action.
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
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:322
static TGFrame * VSplitter()
Create new vertical splitter (TGVSplitter).
ULong_t Pixel_t
Definition: GuiTypes.h:39
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:51
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
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:53
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.
static TGFrame * BuildShutter()
Helper method used in guibuilding to create TGShutter widget.
const Bool_t kTRUE
Definition: RtypesCore.h:89
virtual void ChangeSelected(TGFrame *f)
Set selected frame.
TGMdiFrame * GetEditable() const
Definition: TGGC.h:31
char name[80]
Definition: TGX11.cxx:109