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
49class TGShutter;
50class TGMdiMainFrame;
51class TGDockableFrame;
52class TGMdiMenuBar;
53class TGPopupMenu;
54class TGStatusBar;
56class TGToolBar;
57class TGMdiFrame;
58class TGuiBldEditor;
59class TGButton;
60class TGPictureButton;
61class TImage;
62class TTimer;
63
64//////////////////////////////////////////////////////////////////////////
65class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
66
67friend class TGuiBldDragManager;
68
69private:
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;
93
94 void InitMenu();
98 void BindKeys();
99 TGButton *FindActionButton(const char *name, const char *section);
100
101public:
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; }
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
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:43
unsigned long ULong_t
Definition: RtypesCore.h:53
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassDef(name, id)
Definition: Rtypes.h:322
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
EGuiBuilderMenuIds
@ kGUIBLD_EDIT_PREF
@ kGUIBLD_FILE_EXIT
@ kGUIBLD_HELP_ABOUT
@ kGUIBLD_FILE_OPEN
@ kGUIBLD_WINDOW_CASCADE
@ kGUIBLD_WINDOW_OPAQUE
@ kGUIBLD_WINDOW_ARRANGE
@ kGUIBLD_HELP_CONTENTS
@ kGUIBLD_FILE_STOP
@ kGUIBLD_FILE_SAVE
@ kGUIBLD_FILE_START
@ kGUIBLD_FILE_NEW
@ kGUIBLD_HELP_BUG
@ kGUIBLD_FILE_CLOSE
@ kGUIBLD_WINDOW_HOR
@ kGUIBLD_WINDOW_VERT
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
Definition: TGGC.h:31
An abstract interface to image processing library.
Definition: TImage.h:29
TGPopupMenu * fMenuHelp
TGMdiFrame * GetEditable() const
static TGGC * GetBgndGC()
Return background GC.
virtual void AddMacro(const char *macro, TImage *img)
Add macro to "User's Macros" section Input img must be static - do not delete it.
virtual Bool_t IsGrabButtonDown() const
Return the status of the grab mode.
virtual void Show()
virtual void AddAction(TGuiBldAction *act, const char *sect)
Add new action to widget palette.
TRootGuiBuilder(const TGWindow *p=0)
Create GUI builder application.
virtual Bool_t IsSelectMode() const
Return the status of the selected mode.
static TGGC * fgBgndPopup
static TGFrame * BuildTextEdit()
Helper method to create TGTextEdit widget.
void BindKeys()
Keyborad key binding.
TGMdiMainFrame * fMain
virtual void HandleButtons()
Handle buttons in the GUI builder's widget palette.
virtual void AddSection(const char *sect)
Add new shutter item.
TGButton * FindActionButton(const char *name, const char *section)
Find action by name.
static TGGC * fgBgndPopupHlght
TGMdiFrame * FindEditableMdiFrame(const TGWindow *win)
Find the editable frame.
TGStatusBar * fStatusBar
TGMdiMenuBar * fMenuBar
static ULong_t GetBgnd()
Return default background color.
static TGGC * GetPopupBgndGC()
Return background GC for popup menus.
void EnableSelectedButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
static TGFrame * BuildHProgressBar()
Helper method to create TGHProgressBar.
virtual void SwitchToolbarButton()
Switch image of toolbar edit button according to the current state.
TGMdiMainFrame * GetMdiMain() const
static TGFrame * BuildTab()
Helper method to create TGTab widget.
virtual void UpdateStatusBar(const char *text=0)
Update information shown on the status bar.
TGDockableFrame * fShutterDock
virtual void Hide()
Hide builder.
static TGFrame * VSplitter()
Create new vertical splitter (TGVSplitter).
TGDockableFrame * fToolDock
static TGGC * GetPopupHlghtGC()
Return background GC for highlighted popup menu entry.
void EnableEditButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
static ULong_t GetPopupHlght()
Return highlighted color for popup menu entry.
static TGPopupMenu * CreatePopup()
Return style popup menu.
TGPopupMenu * fMenuEdit
virtual void ChangeSelected(TGFrame *f)
Set selected frame.
static TGFrame * BuildVProgressBar()
Helper method to create TGVProgressBar.
static TGFrame * BuildShutter()
Helper method used in guibuilding to create TGShutter widget.
static TGFrame * BuildVScrollBar()
Helper method to create TGVScrollBar.
static TGFrame * BuildH3DLine()
Helper method to create TGHorizontal3DLine widget.
static ULong_t GetPopupBgnd()
Return background color for popup menus.
virtual void CloseWindow()
Close GUI builder via window manager "Close" button.
TGFrame * fSelected
virtual Bool_t HandleKey(Event_t *event)
Handle keys.
TGuiBldEditor * fEditor
void EnableLassoButtons(Bool_t on=kTRUE)
Enable toolbar buttons for alignment.
TGuiBldEditor * GetEditor() const
TGuiBldDragManager * fManager
virtual void EraseStatusBar()
Clear information shown in the status bar.
static TGFrame * BuildHScrollBar()
Helper method to create TGHScrollBar.
static TGGC * fgBgnd
TGPictureButton * fStartButton
void InitMenu()
Inititiate GUI Builder menus.
static TGFrame * BuildListTree()
Helper method used in guibuilding.
static TGFrame * BuildV3DLine()
Helper method to create TGVertical3DLine widget.
virtual void HandleMenu(Int_t id)
Handle menu items.
static TGFrame * BuildCanvas()
Helper method used in guibuilding to create TGCanvas widget.
TGuiBldDragManager * GetManager() const
const TGPicture * fIconPic
TGPopupMenu * fMenuFile
static TGFrame * BuildListBox()
Helper method to create TGListBox widget.
TGDockableFrame * GetToolDock() const
static void PropagateBgndColor(TGFrame *frame, Pixel_t color)
Set a background color to frame and all its subframes.
static TGFrame * BuildComboBox()
Helper method to create TGComboBox widget.
TGToolBar * fToolBar
virtual Bool_t OpenProject(Event_t *event=0)
Open new gui builder project.
virtual void Update()
Update gui builder.
virtual Bool_t SaveProject(Event_t *event=0)
Save selected project.
TGMdiFrame * fEditable
virtual TGFrame * ExecuteAction()
Execute an action.
virtual Bool_t NewProject(TString type="")
Create a new project.
virtual void HandleWindowClosed(Int_t id)
Handler for closed MDI frame.
virtual ~TRootGuiBuilder()
Destructor.
TGShutter * fShutter
TGButton * fActionButton
virtual void MaybeCloseWindow()
Handler before closing MDI frame.
static TGFrame * HSplitter()
Creates new horizontal splitter (TGHSplitter).
TGPopupMenu * fMenuWindow
Basic string class.
Definition: TString.h:131
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TText * text