Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGuiBuilder.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Valeriy Onuchin 12/08/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
13/** \class TGuiBuilder
14 \ingroup guibuilder
15
16### %ROOT GUI Builder principles
17
18With the GUI builder, we try to make the next step from WYSIWYG
19to embedded editing concept - WYSIWYE ("what you see is what you edit").
20The ROOT GUI Builder allows modifying real GUI objects.
21For example, one can edit the existing GUI application created by
22guitest.C.
23GUI components can be added to a design area from a widget palette,
24or can be borrowed from another application.
25One can drag and and drop TCanvas's menu bar into the application.
26GUI objects can be resized and dragged, copied and pasted.
27ROOT GUI Builder allows changing the layout, snap to grid, change object's
28layout order via the GUI Builder toolbar, or by options in the right-click
29context menus.
30A final design can be immediately tested and used, or saved as a C++ macro.
31For example, it's possible to rearrange buttons in control bar,
32add separators etc. and continue to use a new fancy control bar in the
33application.
34
35
36The following is a short description of the GUI Builder actions and key shortcuts:
37
38 - Press Ctrl-Double-Click to start/stop edit mode
39 - Press Double-Click to activate quick edit action (defined in root.mimes)
40
41### Selection, grabbing, dropping
42
43It is possible to select, drag any frame and drop it to any frame
44
45 - Click left mouse button or Ctrl-Click to select an object to edit.
46 - Press right mouse button to activate context menu
47 - Multiple selection (grabbing):
48 - draw lasso and press Return key
49 - press Shift key and draw lasso
50 - Dropping:
51 - select frame and press Ctrl-Return key
52 - Changing layout order:
53 - select frame and use arrow keys to change layout order
54 - Alignment:
55 - draw lasso and press arrow keys (or Shift-Arrow key) to align frames
56
57### Key shortcuts
58
59 - Return - grab selected frames
60 - Ctrl-Return - drop frames
61 - Del - delete selected frame
62 - Shift-Del - crop action
63 - Ctrl-X - cut action
64 - Ctrl-C - copy action
65 - Ctrl-V - paste action
66 - Ctrl-R - replace action
67 - Ctrl-L - compact layout
68 - Ctrl-B - break layout
69 - Ctrl-H - switch horizontal-vertical layout
70 - Ctrl-G - switch on/off grid
71 - Ctrl-S - save action
72 - Ctrl-O - open and execute a ROOT macro file. GUI components created
73 after macro execution will be embedded to currently edited
74 design area.
75 - Ctrl-N - create new main frame
76
77*/
78
79
80#include "TGuiBuilder.h"
81#include "TVirtualDragManager.h"
82#include "TPluginManager.h"
83#include "TROOT.h"
84
85
88
89////////////////////////////////////////////////////////////////////////////////
90/// constructor
91
92TGuiBldAction::TGuiBldAction(const char *name, const char *title,
93 Int_t type, TGLayoutHints *hints) :
94 TNamed(name, title), fType(type), fHints(hints)
95{
96 fPicture = 0;
97 fPic = 0;
98 fAct = "";
99}
100
101////////////////////////////////////////////////////////////////////////////////
102/// destructor
103
107
108////////////////////////////////////////////////////////////////////////////////
109/// constructor
110
112{
113 fAction = 0;
114 // load plugin
115 if (!gGuiBuilder) {
116 gHandler = gROOT->GetPluginManager()->FindHandler("TGuiBuilder");
117
118 if (!gHandler || (gHandler->LoadPlugin() == -1)) return;
119
120 gGuiBuilder = this;
121 gHandler->ExecPlugin(0);
122 } else {
123 gGuiBuilder->Show();
124 }
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// destructor
129
133
134////////////////////////////////////////////////////////////////////////////////
135/// return an instance of TGuiBuilder object
136
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
char name[80]
Definition TGX11.cxx:148
static TPluginHandler * gHandler
externTGuiBuilder * gGuiBuilder
Definition TGuiBuilder.h:66
#define gROOT
Definition TROOT.h:417
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
~TGuiBldAction() override
destructor
TGuiBldAction(const char *name=nullptr, const char *title=nullptr, Int_t type=kGuiBldCtor, TGLayoutHints *hints=nullptr)
constructor
TGLayoutHints * fHints
Definition TGuiBuilder.h:32
const TGPicture * fPicture
Definition TGuiBuilder.h:31
const char * fPic
Definition TGuiBuilder.h:30
TGuiBldAction * fAction
Definition TGuiBuilder.h:46
virtual ~TGuiBuilder()
destructor
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
TGuiBuilder()
constructor
TNamed()
Definition TNamed.h:38