Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TGFrame.h"
17#include "TGuiBuilder.h"
18
26
28
34
38
40};
41
42
43class TGShutter;
44class TGMdiMainFrame;
45class TGDockableFrame;
46class TGMdiMenuBar;
47class TGPopupMenu;
48class TGStatusBar;
50class TGToolBar;
51class TGMdiFrame;
52class TGuiBldEditor;
53class TGButton;
54class TGPictureButton;
55class TImage;
56class TTimer;
57
58//////////////////////////////////////////////////////////////////////////
59class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
60
61friend class TGuiBldDragManager;
62
63private:
64 TGuiBldDragManager *fManager; // drag and drop manager
65 TGButton *fActionButton;// action button
66 TGToolBar *fToolBar; // guibuider toolbar
67 TGShutter *fShutter; // widget palette
68 TGMdiMainFrame *fMain; // main mdi frame
69 TGDockableFrame *fToolDock; // dockable frame where toolbar is located
70 TGDockableFrame *fShutterDock; // dockable frame where widget palette is located
71 TGMdiMenuBar *fMenuBar; // guibuilder menu bar
72 TGPopupMenu *fMenuFile; // "File" popup menu
73 TGPopupMenu *fMenuWindow; // "Window" popup menu
74 TGPopupMenu *fMenuEdit; // "Edit" popup menu
75 TGPopupMenu *fMenuHelp; // "Help" popup menu
76 TGStatusBar *fStatusBar; // guibuilder status bar
77 TGFrame *fSelected; // selected frame
78 TGMdiFrame *fEditable; // mdi frame where edited frame is located
79 TGuiBldEditor *fEditor; // frame property editor
80 const TGPicture *fIconPic; // icon picture
81 TGPictureButton *fStartButton; // start button
83
84 static TGGC *fgBgnd;
87
88 void InitMenu();
92 void BindKeys();
93 TGButton *FindActionButton(const char *name, const char *section);
94
95public:
96 TRootGuiBuilder(const TGWindow *p = 0);
97 virtual ~TRootGuiBuilder();
98
99 virtual void AddAction(TGuiBldAction *act, const char *sect);
100 virtual void AddMacro(const char *macro, TImage *img);
101 virtual void AddSection(const char *sect);
102 virtual TGFrame *ExecuteAction();
103 virtual void HandleButtons();
104 virtual void Show() { MapRaised(); }
105 virtual void Hide();
106 virtual void ChangeSelected(TGFrame *f);
107 virtual void Update();
108 virtual Bool_t IsSelectMode() const;
109 virtual Bool_t IsGrabButtonDown() const;
110 virtual Bool_t OpenProject(Event_t *event = 0);
111 virtual Bool_t SaveProject(Event_t *event = 0);
112 virtual Bool_t NewProject(TString type = "");
113 virtual Bool_t HandleKey(Event_t *event);
114 virtual void HandleMenu(Int_t id);
115 virtual void CloseWindow();
116 virtual void MaybeCloseWindow();
117 virtual void HandleWindowClosed(Int_t id);
118 virtual void UpdateStatusBar(const char *text = 0);
119 virtual void EraseStatusBar();
120 virtual void SwitchToolbarButton();
121
123 TGuiBldEditor *GetEditor() const { return fEditor; }
125 TGMdiMainFrame *GetMdiMain() const { return fMain; }
126 TGMdiFrame *GetEditable() const { return fEditable; }
128
129 static ULong_t GetBgnd();
130 static TGGC *GetBgndGC();
131
132 static ULong_t GetPopupBgnd();
133 static TGGC *GetPopupBgndGC();
134
135 static ULong_t GetPopupHlght();
136 static TGGC *GetPopupHlghtGC();
137
138 static void PropagateBgndColor(TGFrame *frame, Pixel_t color);
139
140 static TGFrame *HSplitter();
141 static TGFrame *VSplitter();
142 static TGPopupMenu *CreatePopup();
143 static TGFrame *BuildListTree();
144 static TGFrame *BuildCanvas();
145 static TGFrame *BuildShutter();
146 static TGFrame *BuildTextEdit();
147 static TGFrame *BuildTab();
148 static TGFrame *BuildListBox();
149 static TGFrame *BuildComboBox();
150 static TGFrame *BuildH3DLine();
151 static TGFrame *BuildV3DLine();
152 static TGFrame *BuildHScrollBar();
153 static TGFrame *BuildVScrollBar();
154 static TGFrame *BuildHProgressBar();
155 static TGFrame *BuildVProgressBar();
156
157
158 ClassDef(TRootGuiBuilder,0) // ROOT GUI Builder
159};
160
161
162#endif
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
int Int_t
Definition RtypesCore.h:45
unsigned long ULong_t
Definition RtypesCore.h:55
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
int type
Definition TGX11.cxx:121
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
A button abstract base class.
Definition TGButton.h:68
A frame with handles that allow it to be undocked (i.e.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
virtual void MapRaised()
map raised
Definition TGFrame.h:205
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:398
This file contains the TGMdiFrame class.
Definition TGMdiFrame.h:44
This file contains the TGMdiMainFrame class.
Yield an action as soon as it is clicked.
Definition TGButton.h:228
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class creates a popup menu object.
Definition TGMenu.h:110
A shutter widget contains a set of shutter items that can be open and closed like a shutter.
Definition TGShutter.h:58
Provides a StatusBar widget.
Definition TGStatusBar.h:21
A toolbar is a composite frame that contains TGPictureButtons.
Definition TGToolBar.h:33
ROOT GUI Window base class.
Definition TGWindow.h:23
Drag and drop manager used by the ROOT GUI Builder.
The property editor.
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.
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()
Keyboard 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.
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:136
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
TText * text
Event structure.
Definition GuiTypes.h:174