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 = nullptr);
97 ~TRootGuiBuilder() override;
98
99 void AddAction(TGuiBldAction *act, const char *sect) override;
100 virtual void AddMacro(const char *macro, TImage *img);
101 void AddSection(const char *sect) override;
102 TGFrame *ExecuteAction() override;
103 virtual void HandleButtons();
104 void Show() override { MapRaised(); }
105 void Hide() override;
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 Bool_t HandleKey(Event_t *event) override;
114 virtual void HandleMenu(Int_t id);
115 void CloseWindow() override;
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();
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 ClassDefOverride(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
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
unsigned long ULong_t
Definition RtypesCore.h:55
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
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
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.
An abstract interface to image processing library.
Definition TImage.h:29
void Hide() override
Hide builder.
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.
Bool_t HandleKey(Event_t *event) override
Handle keys.
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.
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.
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.
TGuiBldEditor * fEditor
void EnableLassoButtons(Bool_t on=kTRUE)
Enable toolbar buttons for alignment.
TGuiBldEditor * GetEditor() const
TGuiBldDragManager * fManager
TGFrame * ExecuteAction() override
Execute an action.
virtual void EraseStatusBar()
Clear information shown in the status bar.
static TGFrame * BuildHScrollBar()
Helper method to create TGHScrollBar.
static TGGC * fgBgnd
void CloseWindow() override
Close GUI builder via window manager "Close" button.
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
void Show() override
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() override
Destructor.
TGToolBar * fToolBar
virtual void Update()
Update gui builder.
TGMdiFrame * fEditable
virtual Bool_t NewProject(TString type="")
Create a new project.
void AddAction(TGuiBldAction *act, const char *sect) override
Add new action to widget palette.
virtual void HandleWindowClosed(Int_t id)
Handler for closed MDI frame.
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
void AddSection(const char *sect) override
Add new shutter item.
Basic string class.
Definition TString.h:139
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
Event structure.
Definition GuiTypes.h:174