Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/guibuilder:$Id$
2// Author: Valeriy Onuchin 12/09/04
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 *************************************************************************/
12#ifndef ROOT_TRootGuiBuilder
13#define ROOT_TRootGuiBuilder
16#include "TGFrame.h"
17#include "TGuiBuilder.h"
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;
59class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
61friend class TGuiBldDragManager;
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
84 static TGGC *fgBgnd;
88 void InitMenu();
92 void BindKeys();
93 TGButton *FindActionButton(const char *name, const char *section);
96 TRootGuiBuilder(const TGWindow *p = nullptr);
97 virtual ~TRootGuiBuilder();
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 = nullptr);
111 virtual Bool_t SaveProject(Event_t *event = nullptr);
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 = nullptr);
119 virtual void EraseStatusBar();
120 virtual void SwitchToolbarButton();
123 TGuiBldEditor *GetEditor() const { return fEditor; }
125 TGMdiMainFrame *GetMdiMain() const { return fMain; }
126 TGMdiFrame *GetEditable() const { return fEditable; }
129 static ULong_t GetBgnd();
130 static TGGC *GetBgndGC();
132 static ULong_t GetPopupBgnd();
133 static TGGC *GetPopupBgndGC();
135 static ULong_t GetPopupHlght();
136 static TGGC *GetPopupHlghtGC();
138 static void PropagateBgndColor(TGFrame *frame, Pixel_t color);
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();
158 ClassDef(TRootGuiBuilder,0) // ROOT GUI Builder
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define f(i)
Definition: RSha256.hxx:104
bool Bool_t
Definition: RtypesCore.h:63
int Int_t
Definition: RtypesCore.h:45
const Bool_t kTRUE
Definition: RtypesCore.h:100
unsigned long ULong_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:335
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition: TGX11.cxx:110
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
void MapRaised() override
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:397
This file contains the TGMdiFrame class.
Definition: TGMdiFrame.h:42
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:55
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.
Definition: TGuiBldEditor.h:32
An abstract interface to image processing library.
Definition: TImage.h:29
virtual Bool_t SaveProject(Event_t *event=nullptr)
Save selected project.
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.
TGDockableFrame * fShutterDock
virtual void UpdateStatusBar(const char *text=nullptr)
Update information shown on the status bar.
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.
TRootGuiBuilder(const TGWindow *p=nullptr)
Create GUI builder application.
TGToolBar * fToolBar
virtual void Update()
Update gui builder.
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()
TGShutter * fShutter
TGButton * fActionButton
virtual Bool_t OpenProject(Event_t *event=nullptr)
Open new gui builder project.
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
Event structure.
Definition: GuiTypes.h:174