Logo ROOT  
Reference Guide
TRootGuiBuilder.cxx
Go to the documentation of this file.
1 // @(#)root/guibuilder:$Id: d2f0a1966f9911570cafe9d356f2158a2773edd1 $
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 
13 #include "TRootGuiBuilder.h"
14 #include "TGuiBldDragManager.h"
15 #include "TGuiBldEditor.h"
16 
17 #include "TGShutter.h"
18 #include "TGSplitter.h"
19 #include "TGLayout.h"
20 #include "TGResourcePool.h"
21 #include "TGButton.h"
22 #include "TROOT.h"
23 #include "TGDockableFrame.h"
24 #include "TGMdi.h"
25 #include "TGStatusBar.h"
26 #include "TG3DLine.h"
27 #include "TGLabel.h"
28 #include "TColor.h"
29 #include "TGToolBar.h"
30 #include "TGToolTip.h"
31 #include "KeySymbols.h"
32 #include "TGFileDialog.h"
33 #include "TGMsgBox.h"
34 #include "TSystem.h"
35 #include "TRootHelpDialog.h"
36 #include "TGListTree.h"
37 #include "TImage.h"
38 #include "TGTextEdit.h"
39 #include "TGTab.h"
40 #include "TGListBox.h"
41 #include "TGComboBox.h"
42 #include "TGProgressBar.h"
43 #include "TVirtualX.h"
44 
45 
46 //////////////////////////////////////////////////////////////////////////
47 //
48 // TRootGuiBuilder
49 //
50 //
51 // ************************************************
52 // ROOT GUI Builder principles
53 // ************************************************
54 //
55 // With the GUI builder, we try to make the next step from WYSIWYG
56 // to embedded editing concept - WYSIWYE ("what you see is what you edit").
57 // The ROOT GUI Builder allows modifying real GUI objects.
58 // For example, one can edit the existing GUI application created by
59 // $ROOTSYS/tutorials/gui/guitest.C.
60 // GUI components can be added to a design area from a widget palette,
61 // or can be borrowed from another application.
62 // One can drag and and drop TCanvas's menu bar into the application.
63 // GUI objects can be resized and dragged, copied and pasted.
64 // ROOT GUI Builder allows changing the layout, snap to grid, change object's
65 // layout order via the GUI Builder toolbar, or by options in the right-click
66 // context menus.
67 // A final design can be immediatly tested and used, or saved as a C++ macro.
68 // For example, it's possible to rearrange buttons in control bar,
69 // add separators etc. and continue to use a new fancy control bar in the
70 // application.
71 //
72 // ************************************************
73 //
74 // The following is a short description of the GUI Builder actions and key shortcuts:
75 //
76 // o Press Ctrl-Double-Click to start/stop edit mode
77 // o Press Double-Click to activate quick edit action (defined in root.mimes)
78 //
79 // Selection, grabbing, dropping
80 // ************************************************
81 // It is possible to select, drag any frame and drop it to any frame
82 //
83 // o Click left mouse button or Ctrl-Click to select an object to edit.
84 // o Press right mouse button to activate context menu
85 // o Multiple selection (grabbing):
86 // - draw lasso and press Return key
87 // - press Shift key and draw lasso
88 // o Dropping:
89 // - select frame and press Ctrl-Return key
90 // o Changing layout order:
91 // - select frame and use arrow keys to change layout order
92 // o Alignment:
93 // - draw lasso and press arrow keys (or Shift-Arrow key) to align frames
94 //
95 // Key shortcuts
96 // ************************************************
97 // o Return - grab selected frames
98 // o Ctrl-Return - drop frames
99 // o Del - delete selected frame
100 // o Shift-Del - crop action
101 // o Ctrl-X - cut action
102 // o Ctrl-C - copy action
103 // o Ctrl-V - paste frame into the last clicked position
104 // o Ctrl-L - compact
105 // o Ctrl-B - enable/disable layout
106 // o Ctrl-H - switch horizontal-vertical layout
107 // o Ctrl-G - switch on/off grid
108 // o Ctrl-S - save action
109 // o Ctrl-O - open and execute a ROOT macro file. GUI components created
110 // after macro execution will be emebedded to currently edited
111 // design area.
112 // o Ctrl-N - create new main frame
113 //
114 //Begin_Html
115 /*
116 <img src="gif/RootGuiBuilder.gif">
117 */
118 //End_Html
119 
120 
121 const char gHelpBuilder[] = "\
122  Start/Stop Edit Mode\n\
123  ************************************************\n\
124  o Select File menu / Edit\n\
125  o Select Start Edit button on the toolbar\n\
126  o Ctrl-Double-Click on the project frame\n\
127  o Double-Click to activate quick edit action (defined in root.mimes)\n\
128 \n\
129  Select, Grab, Drop\n\
130  ************************************************\n\
131  It is possible to select & drag any frame and drop it to another frame\n\
132 \n\
133  o Press left mouse button Click or Ctrl-Click to select an object.\n\
134  o Press right mouse button to activate context menu\n\
135  o Multiple selection can be done in two ways (grabbing):\n\
136  - draw lasso and press Return key\n\
137  - press Shift key and draw lasso\n\
138  o Dropping:\n\
139  - select frame and press Ctrl-Return key\n\
140  o Changing layout order of widgets:\n\
141  - set broken layout mode via toolbar button or check button\n\
142  \'Layout subframes\' in tab \'Layout\'\n\
143  - select a widget and use arrow keys to change the layout order\n\
144  o Alignment:\n\
145  - remove the selection (if any) by using the space bar\n\
146  - draw lasso and use the four toolbar buttons for widget alignment\n\
147  - arrow keys align the frames too, if you prefer the keyboard\n\
148 \n\
149  Key shortcuts\n\
150  ************************************************\n\
151  o Return - grab selected frames\n\
152  o Ctrl-Return - drop frames\n\
153  o Del - delete selected frame\n\
154  o Shift-Del - crop\n\
155  o Ctrl-X - cut\n\
156  o Ctrl-C - copy\n\
157  o Ctrl-V - paste frame into the last clicked position\n\
158  o Ctrl-L - compact frame\n\
159  o Ctrl-B - enable/disable layout\n\
160  o Ctrl-H - switch Horizontal-Vertical layout\n\
161  o Ctrl-G - switch ON/OFF grid\n\
162  o Ctrl-S - save\n\
163  o Ctrl-O - open and execute ROOT macro file\n\
164  o Ctrl-N - create new main frame\n\
165  o Ctrl-Z - undo last action (not implemented)\n\
166  o Shift-Ctrl-Z - redo (not implemented)\n\
167 \n\
168  More information\n\
169  ************************************************\n\
170 \n\
171 For more information, please see the GuiBuilder Howto page at:\n\
172 \n\
173  http://root.cern.ch/root/HowtoGuiBuilder.html\n\
174 \n\
175 ";
176 
177 const char gHelpAboutBuilder[] = "\
178  ROOT Gui Builder\n\
179 \n\
180 ************************************************************\n\
181 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *\n\
182 * All rights reserved. *\n\
183 * *\n\
184 * For the licensing terms see $ROOTSYS/LICENSE. *\n\
185 * For the list of contributors see $ROOTSYS/README/CREDITS.*\n\
186 ************************************************************\n\
187 ";
188 
189 //----- Toolbar stuff...
190 
192  { "bld_edit.png", "Start Edit (Ctrl-Dbl-Click)", kFALSE, kEditableAct, 0 },
193  { "", "", kFALSE, -1, 0 },
194  { "bld_new.png", "New (Ctrl-N)", kFALSE, kNewAct, 0 },
195  { "bld_open.png", "Open (Ctrl-O)", kFALSE, kOpenAct, 0 },
196  { "bld_save.png", "Save As (Ctrl-S)", kFALSE, kSaveAct, 0 },
197  { "", "", kFALSE, -1, 0 },
198 // { "bld_pointer.xpm", "Selector (Ctrl-Click)", kTRUE, kSelectAct, 0 },
199 // { "bld_grab.xpm", "Grab Selected Frames (Return)", kTRUE, kGrabAct, 0 },
200  { "", "", kFALSE, -1, 0 },
201  { "bld_compact.png", "Compact selected frame (Ctrl-L)", kFALSE, kCompactAct, 0 },
202  { "bld_break.png", "Disable/Enable layout (Ctrl-B)", kFALSE, kBreakLayoutAct, 0 },
203  { "bld_hbox.png", "Layout selected frame horizontally (Ctrl-H)", kFALSE, kLayoutHAct, 0 },
204  { "bld_vbox.png", "Layout selected frame vertically (Ctrl-H)", kFALSE, kLayoutVAct, 0 },
205  { "bld_grid.png", "On/Off grid (Ctrl+G)", kFALSE, kGridAct, 0 },
206  { "", "", kFALSE, -1, 0 },
207  { "bld_AlignTop.png", "Align selected frames to the top line of lasso (Up Arrow)", kFALSE, kUpAct, 0 },
208  { "bld_AlignBtm.png", "Align selected frames to the down line of lasso (Down Arrow)", kFALSE, kDownAct, 0 },
209  { "bld_AlignLeft.png", "Align selected frames to the left line of lasso (Left Arrow)", kFALSE, kLeftAct, 0 },
210  { "bld_AlignRight.png", "Align selected frames to the right line of lasso (Right Arrow)", kFALSE, kRightAct, 0 },
211  { "", "", kFALSE, -1, 0 },
212  { "bld_cut.png", "Cut (Ctrl-X)", kFALSE, kCutAct, 0 },
213  { "bld_copy.png", "Copy (Ctrl-C)", kFALSE, kCopyAct, 0 },
214  { "bld_paste.png", "Paste frame into the last clicked position (Ctrl-V)", kFALSE, kPasteAct, 0 },
215 // { "bld_paste_into.png", "Paste with replacing of selected frame (Ctrl-R)", kFALSE, kReplaceAct, 0 },
216  { "bld_delete.png", "Delete (Del/Backspace)", kFALSE, kDeleteAct, 0 },
217  { "bld_crop.png", "Crop (Shift-Del)", kFALSE, kCropAct, 0 },
218 // { "", "", kFALSE, -1, 0 },
219 // { "bld_undo.png", "Undo (Ctrl-Z)", kFALSE, kUndoAct, 0 },
220 // { "bld_redo.png", "Redo (Shift-Ctrl-Z)", kFALSE, kRedoAct, 0 },
221  { 0, 0, kFALSE, 0, 0 }
222 };
223 
224 
226 
227 
231 
232 
233 ////////////////////////////////////////////////////////////////////////////////
234 //
235 // Here are few experimental GUI classes which give a nice&fancy appearence
236 // to GuiBuilder.
237 //
238 ////////////////////////////////////////////////////////////////////////////////
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 class TGuiBldMenuTitle : public TGMenuTitle {
242 
243 private:
244  Pixel_t fBgndColor;
245 
246 protected:
247  void DoRedraw();
248 
249 public:
250  virtual ~TGuiBldMenuTitle() {}
251  TGuiBldMenuTitle(const TGWindow *p, TGHotString *s, TGPopupMenu *menu) :
252  TGMenuTitle(p, s, menu) {
254  fBgndColor = TRootGuiBuilder::GetBgnd();
255  SetBackgroundColor(fBgndColor);
257  }
258 
259  Bool_t HandleCrossing(Event_t *event);
260 };
261 
262 ////////////////////////////////////////////////////////////////////////////////
263 /// Handle crossing events.
264 
265 Bool_t TGuiBldMenuTitle::HandleCrossing(Event_t *event)
266 {
267  if (event->fType == kEnterNotify) {
268  fBgndColor = TRootGuiBuilder::GetPopupHlght();
269  } else {
270  fBgndColor = TRootGuiBuilder::GetBgnd();
271  }
272  DoRedraw();
273  return kTRUE;
274 }
275 
276 ////////////////////////////////////////////////////////////////////////////////
277 /// Redraw builder menu title.
278 
279 void TGuiBldMenuTitle::DoRedraw()
280 {
282 
283  int x, y, max_ascent, max_descent;
284  x = y = 4;
285 
286  gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
287 
288  if (fState) {
289  gVirtualX->SetForeground(fNormGC, GetDefaultSelectedBackground());
290  gVirtualX->FillRectangle(fId,fNormGC, 0, 0, fWidth, fHeight);
291  gVirtualX->SetForeground(fNormGC, GetForeground());
292  fLabel->Draw(fId, fSelGC, x, y + max_ascent);
293  } else {
294  gVirtualX->SetForeground(fNormGC, fBgndColor);
295  gVirtualX->FillRectangle(fId,fNormGC, 0, 0, fWidth, fHeight);
296  gVirtualX->SetForeground(fNormGC, GetForeground());
297  fLabel->Draw(fId, fNormGC, x, y + max_ascent);
298  }
299  if (fBgndColor == TRootGuiBuilder::GetPopupHlght()) {
300  gVirtualX->DrawRectangle(fId, TGFrame::GetBlackGC()(),
301  0, 0, GetWidth()-1, GetHeight()-1);
302  }
303 }
304 
305 
306 ////////////////////////////////////////////////////////////////////////////////
307 class TGuiBldPopupMenu : public TGPopupMenu {
308 
309 public:
310  virtual ~TGuiBldPopupMenu() { }
311  TGuiBldPopupMenu() :
312  TGPopupMenu(gClient->GetDefaultRoot()) {
315  fEntrySep = 8;
316  }
317  void DrawEntry(TGMenuEntry *entry);
318 };
319 
320 ////////////////////////////////////////////////////////////////////////////////
321 /// Draw popup menu entry.
322 
323 void TGuiBldPopupMenu::DrawEntry(TGMenuEntry *entry)
324 {
325  FontStruct_t font;
326  GCValues_t gcval;
327 
328  if (entry->GetStatus() & kMenuHideMask)
329  return;
330 
331  if (entry->GetStatus() & kMenuDefaultMask) {
332  font = fHifontStruct;
333  gcval.fMask = kGCFont;
334  gcval.fFont = gVirtualX->GetFontHandle(font);
335  gVirtualX->ChangeGC(fNormGC, &gcval);
336  gVirtualX->ChangeGC(fSelGC, &gcval);
337  } else {
338  font = fFontStruct;
339  }
340 
341  UInt_t tw = 0;
342  UInt_t sep = fEntrySep;
343  Int_t max_ascent, max_descent;
344  gVirtualX->GetFontProperties(font, max_ascent, max_descent);
345  if (entry->GetShortcut())
346  tw = 7 + gVirtualX->TextWidth(fFontStruct, entry->GetShortcutText(),
347  entry->GetShortcut()->Length());
348 
349  Int_t tx = entry->GetEx() + fXl;
350  Int_t ty = entry->GetEy() + max_ascent + 2;
351  UInt_t h = max_ascent + max_descent + sep;
352  Int_t picposy = 0;
353  if (entry->GetPic() != 0) {
354  picposy = entry->GetEy() + h / 2;
355  picposy -= entry->GetPic()->GetHeight() / 2;
356  }
357 
358  switch (entry->GetType()) {
359  case kMenuPopup:
360  case kMenuLabel:
361  case kMenuEntry:
362  if ((entry->GetStatus() & kMenuActiveMask) &&
363  entry->GetType() != kMenuLabel) {
364  if (entry->GetStatus() & kMenuEnableMask) {
365  gVirtualX->FillRectangle(fId,
367  entry->GetEx()+1, entry->GetEy(),
368  fMenuWidth-6, h - 1);
369  gVirtualX->DrawRectangle(fId, TGFrame::GetBlackGC()(),
370  entry->GetEx()+ 1, entry->GetEy()-1,
371  fMenuWidth - entry->GetEx()- 6, h - 1);
372  }
373 
374  if (entry->GetType() == kMenuPopup) {
375  DrawTrianglePattern(fSelGC, fMenuWidth-10, entry->GetEy() + 3,
376  fMenuWidth-6, entry->GetEy() + 11);
377  }
378 
379  if (entry->GetStatus() & kMenuCheckedMask) {
380  DrawCheckMark(fSelGC, 6, entry->GetEy()+sep, 14,
381  entry->GetEy()+11);
382  }
383 
384  if (entry->GetStatus() & kMenuRadioMask) {
385  DrawRCheckMark(fSelGC, 6, entry->GetEy()+sep, 14,
386  entry->GetEy()+11);
387  }
388 
389  if (entry->GetPic() != 0) {
390  entry->GetPic()->Draw(fId, fSelGC, 8, picposy);
391  }
392 
393  entry->GetLabel()->Draw(fId,
394  (entry->GetStatus() & kMenuEnableMask) ? fSelGC :
395  GetShadowGC()(), tx, ty);
396  if (entry->GetShortcut())
397  entry->GetShortcut()->Draw(fId,
398  (entry->GetStatus() & kMenuEnableMask) ? fSelGC :
399  GetShadowGC()(), fMenuWidth - tw, ty);
400  } else {
401  if ( entry->GetType() != kMenuLabel) {
402  gVirtualX->FillRectangle(fId,
403  TRootGuiBuilder::GetBgndGC()->GetGC(),
404  entry->GetEx()+1, entry->GetEy()-1, tx-4, h);
405 
406  gVirtualX->FillRectangle(fId,
408  tx-1, entry->GetEy()-1, fMenuWidth-tx-1, h);
409  } else { // we need some special background for labels
410  gVirtualX->FillRectangle(fId, TGFrame::GetBckgndGC()(),
411  entry->GetEx()+1, entry->GetEy()-1,
412  fMenuWidth - entry->GetEx()- 3, h);
413  }
414 
415  if (entry->GetType() == kMenuPopup) {
416  DrawTrianglePattern(fNormGC, fMenuWidth-10, entry->GetEy() + 3,
417  fMenuWidth-6, entry->GetEy() + 11);
418  }
419 
420  if (entry->GetStatus() & kMenuCheckedMask) {
421  DrawCheckMark(fNormGC, 6, entry->GetEy()+sep, 14,
422  entry->GetEy()+11);
423  }
424 
425  if (entry->GetStatus() & kMenuRadioMask) {
426  DrawRCheckMark(fNormGC, 6, entry->GetEy()+sep, 14,
427  entry->GetEy()+11);
428  }
429 
430  if (entry->GetPic() != 0) {
431  entry->GetPic()->Draw(fId, fNormGC, 8, picposy);
432  }
433 
434  if (entry->GetStatus() & kMenuEnableMask) {
435  entry->GetLabel()->Draw(fId, fNormGC, tx, ty);
436  if (entry->GetShortcut())
437  entry->GetShortcut()->Draw(fId, fNormGC, fMenuWidth - tw, ty);
438  } else {
439  entry->GetLabel()->Draw(fId, GetHilightGC()(), tx+1, ty+1);
440  entry->GetLabel()->Draw(fId, GetShadowGC()(), tx, ty);
441  if (entry->GetShortcut()) {
442  entry->GetShortcut()->Draw(fId, GetHilightGC()(),
443  fMenuWidth - tw+1, ty+1);
444  entry->GetShortcut()->Draw(fId, GetShadowGC()(),
445  fMenuWidth - tw, ty);
446  }
447  }
448  }
449  break;
450 
451  case kMenuSeparator:
452  gVirtualX->FillRectangle(fId, TRootGuiBuilder::GetBgndGC()->GetGC(),
453  entry->GetEx()+1, entry->GetEy()-1,
454  tx-4, 4);
455  gVirtualX->DrawLine(fId, TGFrame::GetBlackGC()(), tx+1,
456  entry->GetEy()+1, fMenuWidth-sep,
457  entry->GetEy()+1);
458  break;
459  }
460 
461  // restore font
462  if (entry->GetStatus() & kMenuDefaultMask) {
463  gcval.fFont = gVirtualX->GetFontHandle(fFontStruct);
464  gVirtualX->ChangeGC(fNormGC, &gcval);
465  gVirtualX->ChangeGC(fSelGC, &gcval);
466  }
467 }
468 
469 ////////////////////////////////////////////////////////////////////////////////
470 class TGuiBldToolButton : public TGPictureButton {
471 
472 private:
474 
475 protected:
476  void DoRedraw();
477 
478 public:
479  virtual ~TGuiBldToolButton() { }
480  TGuiBldToolButton(const TGWindow *p, const TGPicture *pic, Int_t id = -1) :
481  TGPictureButton(p, pic, id) {
482  fBgndColor = TRootGuiBuilder::GetBgnd();
484  }
485 
486  Bool_t IsDown() const { return (fOptions & kSunkenFrame); }
487  void SetState(EButtonState state, Bool_t emit = kTRUE);
488  Bool_t HandleCrossing(Event_t *event);
489  void SetBackgroundColor(Pixel_t bgnd) { fBgndColor = bgnd; TGFrame::SetBackgroundColor(bgnd); }
490 };
491 
492 ////////////////////////////////////////////////////////////////////////////////
493 /// Redraw tool button.
494 
495 void TGuiBldToolButton::DoRedraw()
496 {
497  int x = (fWidth - fTWidth) >> 1;
498  int y = (fHeight - fTHeight) >> 1;
499  UInt_t w = GetWidth() - 1;
500  UInt_t h = GetHeight()- 1;
501 
502  TGFrame::SetBackgroundColor(fBgndColor);
503 
505  if (fState == kButtonDown || fState == kButtonEngaged) {
506  ++x; ++y;
507  w--; h--;
508  }
509 
510  const TGPicture *pic = fPic;
511  if (fState == kButtonDisabled) {
512  if (!fPicD) CreateDisabledPicture();
513  pic = fPicD ? fPicD : fPic;
514  }
515  if (fBgndColor == TRootGuiBuilder::GetPopupHlght()) {
516  x--; y--;
517  gVirtualX->DrawRectangle(fId, TGFrame::GetBlackGC()(), 0, 0, w, h);
518  }
519  pic->Draw(fId, fNormGC, x, y);
520 }
521 
522 ////////////////////////////////////////////////////////////////////////////////
523 /// Handle crossing events.
524 
525 Bool_t TGuiBldToolButton::HandleCrossing(Event_t *event)
526 {
527  if (fTip) {
528  if (event->fType == kEnterNotify) {
529  fTip->Reset();
530  } else {
531  fTip->Hide();
532  }
533  }
534 
535  if ((event->fType == kEnterNotify) && (fState != kButtonDisabled)) {
536  fBgndColor = TRootGuiBuilder::GetPopupHlght();
537  } else {
538  fBgndColor = TRootGuiBuilder::GetBgnd();
539  }
540  if (event->fType == kLeaveNotify) {
541  fBgndColor = TRootGuiBuilder::GetBgnd();
542  if (fState != kButtonDisabled && fState != kButtonEngaged)
543  SetState(kButtonUp, kFALSE);
544  }
545  DoRedraw();
546 
547  return kTRUE;
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Set state of tool bar button and emit a signal according
552 /// to passed arguments.
553 
554 void TGuiBldToolButton::SetState(EButtonState state, Bool_t emit)
555 {
556  Bool_t was = !IsDown();
557 
558  if (state != fState) {
559  switch (state) {
560  case kButtonEngaged:
561  case kButtonDown:
562  fOptions &= ~kRaisedFrame;
563  fOptions |= kSunkenFrame;
564  break;
565  case kButtonDisabled:
566  case kButtonUp:
567  fOptions &= ~kRaisedFrame;
568  fOptions &= ~kSunkenFrame;
569  break;
570  }
571  fState = state;
572  DoRedraw();
573  if (emit) EmitSignals(was);
574  }
575 }
576 
577 ////////////////////////////////////////////////////////////////////////////////
578 ////////////////////////////////////////////////////////////////////////////////
579 /// Create GUI builder application.
580 
582  TGMainFrame(p ? p : gClient->GetDefaultRoot(), 1, 1)
583 {
585  gGuiBuilder = this;
586  fManager = 0;
587  fEditor = 0;
588  fActionButton = 0;
589  fClosing = 0;
590 
591  if (gDragManager) {
593  } else {
595  }
596  fManager->SetBuilder(this);
597 
598  fMenuBar = new TGMdiMenuBar(this, 10, 10);
600  InitMenu();
601 
603  kLHintsExpandX, 0,0,2,2));
604 
605  fToolDock = new TGDockableFrame(this);
606  AddFrame(fToolDock, new TGLayoutHints(kLHintsExpandX, 0, 0, 1, 0));
607  fToolDock->SetWindowName("GuiBuilder ToolBar");
608 
611  kLHintsExpandX));
612 
613  int spacing = 8;
614 
615  for (int i = 0; gToolBarData[i].fPixmap; i++) {
616  if (strlen(gToolBarData[i].fPixmap) == 0) {
617  spacing = 8;
618  continue;
619  }
620 
621  const TGPicture *pic = fClient->GetPicture(gToolBarData[i].fPixmap);
622  TGuiBldToolButton *pb = new TGuiBldToolButton(fToolBar, pic,
623  gToolBarData[i].fId);
624  pb->SetStyle(gClient->GetStyle());
625 
626  pb->SetToolTipText(gToolBarData[i].fTipText);
627 
628  TGToolTip *tip = pb->GetToolTip();
629  tip->SetDelay(200);
630 
631  tip->Connect("Reset()", "TRootGuiBuilder", this, "UpdateStatusBar(=0)");
632  tip->Connect("Hide()", "TRootGuiBuilder", this, "EraseStatusBar()");
633 
634  fToolBar->AddButton(this, pb, spacing);
635  spacing = 0;
636 
637  if (gToolBarData[i].fId == kEditableAct) {
638  fStartButton = pb;
639  continue;
640  }
641 
642  if ((gToolBarData[i].fId == kUndoAct) ||
643  (gToolBarData[i].fId == kRedoAct)) {
644  pb->SetState(kButtonDisabled);
645  }
646  }
647 
648  fToolBar->Connect("Clicked(Int_t)", "TGuiBldDragManager", fManager,
649  "HandleAction(Int_t)");
650 
652  kLHintsExpandX, 0,0,2,5));
653 
654  TGCompositeFrame *cf = new TGHorizontalFrame(this, 1, 1);
656 
657  //fShutterDock = new TGDockableFrame(cf);
658  //cf->AddFrame(fShutterDock, new TGLayoutHints(kLHintsNormal ));
659  //fShutterDock->SetWindowName("Widget Factory");
660  //fShutterDock->EnableUndock(kTRUE);
661  //fShutterDock->EnableHide(kTRUE);
662  //fShutterDock->DockContainer();
663 
664  fShutter = new TGShutter(cf, kSunkenFrame);
667 
668  TGVSplitter *splitter = new TGVSplitter(cf);
669  splitter->SetFrame(fShutter, kTRUE);
671 
672  fMain = new TGMdiMainFrame(cf, fMenuBar, 1, 1);
673  fMain->Connect("FrameClosed(Int_t)", "TRootGuiBuilder", this,
674  "HandleWindowClosed(Int_t)");
675 
676  TQObject::Connect("TGMdiFrame", "CloseWindow()", "TRootGuiBuilder", this,
677  "MaybeCloseWindow()");
678 
680 
682 
683  const TGPicture *pbg = fClient->GetPicture("bld_bg.png");
684  if (pbg) {
686  }
687 
688  if (fManager) {
689  fEditor = new TGuiBldEditor(cf);
692  fEditor->SetEmbedded();
693  }
694 
695  AddSection("Projects");
696  AddSection("Buttons");
697  AddSection("Containers");
698  AddSection("Bars");
699  AddSection("Input");
700  AddSection("Complex Input");
701  AddSection("Display");
702  AddSection("Dialogs");
703 
704  // create an empty section
705  AddSection("User's Macros");
706  TGShutterItem *item = fShutter->GetItem("User's Macros");
709 
710  TGuiBldAction *act = new TGuiBldAction("TGMainFrame", "Empty Frame",
711  kGuiBldProj);
712  act->fAct = "empty";
713  act->fPic = "bld_mainframe.xpm";
714  AddAction(act, "Projects");
715 
716  act = new TGuiBldAction("TGMainFrame", "Horizontal Frame", kGuiBldProj);
717  act->fAct = "horizontal";
718  act->fPic = "bld_mainframe.xpm";
719  AddAction(act, "Projects");
720 
721  act = new TGuiBldAction("TGMainFrame", "Vertical Frame", kGuiBldProj);
722  act->fAct = "vertical";
723  act->fPic = "bld_mainframe.xpm";
724  AddAction(act, "Projects");
725 
726  // Standard
727  act = new TGuiBldAction("TGTextButton", "Text Button", kGuiBldCtor);
728  act->fAct = "new TGTextButton()";
729  act->fPic = "bld_textbutton.xpm";
730  AddAction(act, "Buttons");
731 
732  act = new TGuiBldAction("TGCheckButton", "Check Button", kGuiBldCtor);
733  act->fAct = "new TGCheckButton()";
734  act->fPic = "bld_checkbutton.xpm";
735  AddAction(act, "Buttons");
736 
737  act = new TGuiBldAction("TGRadioButton", "Radio Button", kGuiBldCtor);
738  act->fAct = "new TGRadioButton()";
739  act->fPic = "bld_radiobutton.xpm";
740  AddAction(act, "Buttons");
741 
742  act = new TGuiBldAction("TGPictureButton", "Picture Button", kGuiBldCtor);
743  act->fAct = "new TGPictureButton()";
744  act->fPic = "bld_image.xpm";
745  AddAction(act, "Buttons");
746 
747  act = new TGuiBldAction("TGTextEntry", "Text Entry", kGuiBldCtor);
748  act->fAct = "new TGTextEntry()";
749  act->fPic = "bld_entry.xpm";
750  AddAction(act, "Input");
751 
752  act = new TGuiBldAction("TGTextEdit", "Text Edit", kGuiBldCtor);
753  act->fAct = "TRootGuiBuilder::BuildTextEdit()";
754  act->fPic = "bld_text.xpm";
755  AddAction(act, "Input");
756 
757  act = new TGuiBldAction("TGNumberEntry", "Number Entry", kGuiBldCtor);
758  act->fAct = "new TGNumberEntry()";
759  act->fPic = "bld_numberentry.xpm";
760  AddAction(act, "Input");
761 
762  act = new TGuiBldAction("TGComboBox", "Combo Box", kGuiBldCtor);
763  act->fAct = "TRootGuiBuilder::BuildComboBox()";
764  act->fPic = "bld_combobox.xpm";
765  AddAction(act, "Input");
766 
767  act = new TGuiBldAction("TGListBox", "List Box", kGuiBldCtor);
768  act->fAct = "TRootGuiBuilder::BuildListBox()";
769  act->fPic = "bld_listbox.xpm";
770  AddAction(act, "Input");
771 
772  act = new TGuiBldAction("TGHSlider", "Horizontal Slider", kGuiBldCtor);
773  act->fAct = "new TGHSlider()";
774  act->fPic = "bld_hslider.xpm";
775  AddAction(act, "Input");
776 
777  act = new TGuiBldAction("TGVSlider", "Vertical Slider", kGuiBldCtor);
778  act->fAct = "new TGVSlider()";
779  act->fPic = "bld_vslider.xpm";
780  AddAction(act, "Input");
781 
782  act = new TGuiBldAction("TGHScrollBar", "HScrollbar", kGuiBldCtor);
783  act->fAct = "TRootGuiBuilder::BuildHScrollBar()";
784  act->fPic = "bld_hscrollbar.xpm";
785  AddAction(act, "Input");
786 
787  act = new TGuiBldAction("TGVScrollBar", "VScrollbar", kGuiBldCtor);
788  act->fAct = "TRootGuiBuilder::BuildVScrollBar()";
789  act->fPic = "bld_vscrollbar.xpm";
790  AddAction(act, "Input");
791 
792  act = new TGuiBldAction("TGListTree", "List Tree", kGuiBldCtor);
793  act->fAct = "TRootGuiBuilder::BuildListTree()";
794  act->fPic = "bld_listtree.xpm";
795  AddAction(act, "Complex Input");
796 
797  act = new TGuiBldAction("TGLabel", "Text Label", kGuiBldCtor);
798  act->fAct = "new TGLabel()";
799  act->fPic = "bld_label.xpm";
800  AddAction(act, "Display");
801 
802  act = new TGuiBldAction("TGIcon", "Icon", kGuiBldCtor);
803  act->fAct = "new TGIcon()";
804  act->fPic = "bld_image.xpm";
805  AddAction(act, "Display");
806 
807  act = new TGuiBldAction("TGHorizontal3DLine", "Horizontal Line",
808  kGuiBldCtor);
809  act->fAct = "TRootGuiBuilder::BuildH3DLine()";
810  act->fPic = "bld_hseparator.xpm";
811  AddAction(act, "Display");
812 
813  act = new TGuiBldAction("TGVertical3DLine", "Vertical Line", kGuiBldCtor);
814  act->fAct = "TRootGuiBuilder::BuildV3DLine()";
815  act->fPic = "bld_vseparator.xpm";
816  AddAction(act, "Display");
817 
818  act = new TGuiBldAction("TGStatusBar", "Status Bar", kGuiBldCtor);
819  act->fAct = "new TGStatusBar()";
820  act->fPic = "bld_statusbar.xpm";
822  AddAction(act, "Bars");
823 
824  act = new TGuiBldAction("TGHProgressBar", "HProgress Bar", kGuiBldCtor);
825  act->fAct = "TRootGuiBuilder::BuildHProgressBar()";
826  act->fPic = "bld_hprogressbar.xpm";
827  AddAction(act, "Display");
828 
829  act = new TGuiBldAction("TGVProgressBar", "VProgress Bar", kGuiBldCtor);
830  act->fAct = "TRootGuiBuilder::BuildVProgressBar()";
831  act->fPic = "bld_vprogressbar.xpm";
832  AddAction(act, "Display");
833 
834  act = new TGuiBldAction("TRootEmbeddedCanvas", "Embed Canvas", kGuiBldCtor);
835  act->fAct = "new TRootEmbeddedCanvas()";
836  act->fPic = "bld_embedcanvas.xpm";
837  AddAction(act, "Display");
838 
839  // Containers
840  act = new TGuiBldAction("TGHorizontalFrame", "Horizontal Frame",
841  kGuiBldCtor);
842  act->fAct = "new TGHorizontalFrame(0,200,100)";
843  act->fPic = "bld_hbox.xpm";
844  AddAction(act, "Containers");
845 
846  act = new TGuiBldAction("TGVerticalFrame", "Vertical Frame", kGuiBldCtor);
847  act->fAct = "new TGVerticalFrame(0,100,200)";
848  act->fPic = "bld_vbox.xpm";
849  AddAction(act, "Containers");
850 
851  act = new TGuiBldAction("TGGroupFrame", "Group Frame", kGuiBldCtor);
852  act->fAct = "new TGGroupFrame()";
853  act->fPic = "bld_groupframe.xpm";
854  AddAction(act, "Containers");
855 
856  act = new TGuiBldAction("TGTab", "Tabbed Frame", kGuiBldCtor);
857  act->fAct = "TRootGuiBuilder::BuildTab()";
858  act->fPic = "bld_tab.xpm";
859  AddAction(act, "Containers");
860 
861  act = new TGuiBldAction("TGShutter", "Shutter", kGuiBldCtor);
862  act->fAct = "TRootGuiBuilder::BuildShutter()";
863  act->fPic = "bld_shutter.png";
864  AddAction(act, "Containers");
865 
866 
867  act = new TGuiBldAction("TGCanvas", "Scrolled Canvas", kGuiBldCtor);
868  act->fAct = "TRootGuiBuilder::BuildCanvas()";
869  act->fPic = "bld_canvas.xpm";
870  AddAction(act, "Containers");
871 /*
872  act = new TGuiBldAction("TGVSplitter", "Horizontal Panes", kGuiBldFunc);
873  act->fAct = "TRootGuiBuilder::VSplitter()";
874  act->fPic = "bld_hpaned.xpm";
875  AddAction(act, "Containers");
876 
877  act = new TGuiBldAction("TGHSplitter", "Vertical Panes", kGuiBldFunc);
878  act->fAct = "TRootGuiBuilder::HSplitter()";
879  act->fPic = "bld_vpaned.xpm";
880  AddAction(act, "Containers");
881 */
882  act = new TGuiBldAction("TGColorSelect", "Color Selector", kGuiBldFunc);
883  act->fAct = "new TGColorSelect()";
884  act->fPic = "bld_colorselect.xpm";
885  AddAction(act, "Dialogs");
886 
887  fShutter->Resize(140, fShutter->GetHeight());
888 
889  fStatusBar = new TGStatusBar(this, 40, 10);
891  0, 0, 3, 0));
892 
893  PropagateBgndColor(this, GetBgnd());
894  SetEditDisabled(kEditDisable); // disable editting to all subframes
895 
896  MapSubwindows();
897 
898  Int_t qq;
899  UInt_t ww;
900  UInt_t hh;
901  gVirtualX->GetWindowSize(gVirtualX->GetDefaultRootWindow(), qq, qq, ww, hh);
902  MoveResize(100, 100, ww - 200, hh - 200);
903  SetWMPosition(100, 100);
904 
905  SetWindowName("ROOT GuiBuilder");
906  SetIconName("ROOT GuiBuilder");
907  fIconPic = SetIconPixmap("bld_rgb.xpm");
908  SetClassHints("ROOT", "GuiBuilder");
909 
910  fSelected = 0;
911  Update();
912 
913  fMenuFile->Connect("Activated(Int_t)", "TRootGuiBuilder", this,
914  "HandleMenu(Int_t)");
915  fMenuWindow->Connect("Activated(Int_t)", "TRootGuiBuilder", this,
916  "HandleMenu(Int_t)");
917  fMenuHelp->Connect("Activated(Int_t)", "TRootGuiBuilder", this,
918  "HandleMenu(Int_t)");
919 
920  // doesn't work properly on Windows...
921  if (gVirtualX->InheritsFrom("TGX11"))
922  BindKeys();
923  UpdateStatusBar("Ready");
924  MapRaised();
925 
927 }
928 
929 ////////////////////////////////////////////////////////////////////////////////
930 /// Destructor.
931 
933 {
934  if (fIconPic) gClient->FreePicture(fIconPic);
935  delete fMenuFile;
936  delete fMenuWindow;
937  delete fMenuHelp;
938  gGuiBuilder = 0;
939 }
940 
941 ////////////////////////////////////////////////////////////////////////////////
942 /// Close GUI builder via window manager "Close" button.
943 
945 {
946  TGWindow *root = (TGWindow*)fClient->GetRoot();
947  if (root) root->SetEditable(kFALSE);
948 
949  fEditor->Reset();
950 
951  if (fMain->GetNumberOfFrames() == 0) {
955  } else {
959  }
960 
962  if (btn) {
964  }
965  fClosing = 1;
966  fMain->CloseAll();
967  if (fClosing == -1) {
968  fClosing = 0;
969  return;
970  }
972  Hide();
973 }
974 
975 ////////////////////////////////////////////////////////////////////////////////
976 /// Find action by name
977 
978 TGButton *TRootGuiBuilder::FindActionButton(const char *name, const char *sect)
979 {
980  if (!name || !sect) return 0;
981 
982  TGShutterItem *item = fShutter->GetItem(sect);
983  if (!item) return 0;
984 
986  TGHorizontalFrame *hf;
987  TGFrameElement *fe;
988 
989  TIter next(cont->GetList());
990  TGLabel *lb;
991  TGButton *btn;
992 
993  while ((fe = (TGFrameElement*)next())) {
994  hf = (TGHorizontalFrame*)fe->fFrame;
995  btn = (TGButton*)((TGFrameElement*)hf->GetList()->First())->fFrame;
996  lb = (TGLabel*)((TGFrameElement*)hf->GetList()->Last())->fFrame;
997  if (*(lb->GetText()) == name) {
998  return (TGButton*)btn;
999  }
1000  }
1001  return 0;
1002 }
1003 
1004 ////////////////////////////////////////////////////////////////////////////////
1005 /// Add new action to widget palette.
1006 
1007 void TRootGuiBuilder::AddAction(TGuiBldAction *act, const char *sect)
1008 {
1009  if (!act || !sect) return;
1010 
1011  TGShutterItem *item = fShutter->GetItem(sect);
1012  TGButton *btn = 0;
1013 
1014  if (!item) return;
1015  TGCompositeFrame *cont = (TGCompositeFrame *)item->GetContainer();
1017 
1018  const TGPicture *pic = 0;
1019  if (!act->fPicture) {
1020  act->fPicture = fClient->GetPicture(act->fPic);
1021  }
1022  pic = act->fPicture;
1023 
1024  TGHorizontalFrame *hf = new TGHorizontalFrame(cont);
1025 
1026  if (pic) {
1027  btn = new TGPictureButton(hf, pic);
1028  } else {
1029  btn = new TGTextButton(hf, act->GetName());
1030  }
1031 
1032  btn->SetToolTipText(act->GetTitle(), 200);
1033  btn->SetUserData((void*)act);
1034  btn->Connect("Clicked()", "TRootGuiBuilder", this, "HandleButtons()");
1035 
1036  hf->AddFrame(btn, new TGLayoutHints(kLHintsTop | kLHintsCenterY,3,3,3,3));
1037 
1038  TGLabel *lb = new TGLabel(hf, act->fType != kGuiBldMacro ? act->GetTitle() :
1039  act->GetName());
1040  lb->SetBackgroundColor(cont->GetBackground());
1041  hf->AddFrame(lb, new TGLayoutHints(kLHintsTop | kLHintsCenterY,3,3,3,3));
1042  hf->SetBackgroundColor(cont->GetBackground());
1043 
1044  // disable edit
1047 
1048  cont->AddFrame(hf, new TGLayoutHints(kLHintsExpandX | kLHintsTop, 2, 2, 2, 0));
1049  cont->MapSubwindows();
1050  cont->Resize(); // invoke Layout()
1051 }
1052 
1053 ////////////////////////////////////////////////////////////////////////////////
1054 /// Add new shutter item.
1055 
1056 void TRootGuiBuilder::AddSection(const char *sect)
1057 {
1058  static int id = 10000;
1059  TGShutterItem *item = new TGShutterItem(fShutter, new TGHotString(sect),
1060  id++);
1061  fShutter->AddItem(item);
1062  item->Connect("Selected()", "TRootGuiBuilder", this, "HandleMenu(=3)");
1063 }
1064 
1065 ////////////////////////////////////////////////////////////////////////////////
1066 /// Handle buttons in the GUI builder's widget palette.
1067 
1069 {
1070  TGFrame *parent;
1071 
1072  if (fActionButton) {
1073  parent = (TGFrame*)fActionButton->GetParent();
1074  parent->ChangeOptions(parent->GetOptions() & ~kSunkenFrame);
1075  fClient->NeedRedraw(parent, kTRUE);
1076  }
1077 
1078  if (!fClient->IsEditable()) {
1080  }
1081 
1084  parent = (TGFrame*)fActionButton->GetParent();
1085 
1086  parent->ChangeOptions(parent->GetOptions() | kSunkenFrame);
1087  fClient->NeedRedraw(parent, kTRUE);
1088 
1089  if (act) {
1090  fAction = act;
1091  fManager->UngrabFrame();
1093  }
1094 }
1095 
1096 ////////////////////////////////////////////////////////////////////////////////
1097 /// Execute an action.
1098 
1100 {
1101  if (!fAction || fAction->fAct.IsNull()) return 0;
1102 
1103  TGFrame *ret = 0;
1104 
1105  if (!fClient->IsEditable() && (fAction->fType != kGuiBldMacro)) {
1106  TGMdiFrame *current = fMain->GetCurrent();
1107  if (current) current->SetEditable(kTRUE);
1108  }
1109 
1110  TString s = "";
1111 
1112  switch (fAction->fType) {
1113  case kGuiBldProj:
1114  s = fAction->fAct.Data();
1115  NewProject(s);
1116  fAction = 0;
1117  break;
1118  case kGuiBldMacro:
1119  {
1120  TGWindow *root = (TGWindow*)fClient->GetRoot();
1121  if (root) root->SetEditable(kFALSE);
1122  gROOT->Macro(fAction->fAct.Data());
1123  if (root) root->SetEditable(kTRUE);
1124  fAction = 0;
1125  break;
1126  }
1127  default:
1128  ret = (TGFrame *)gROOT->ProcessLineFast(fAction->fAct.Data());
1129  break;
1130  }
1131 
1132  Update();
1133 
1134  return ret;
1135 }
1136 
1137 ////////////////////////////////////////////////////////////////////////////////
1138 /// Inititiate GUI Builder menus.
1139 
1141 {
1142  fMenuFile = new TGuiBldPopupMenu();
1143  fMenuFile->AddEntry(new TGHotString("&Edit (Ctrl+double-click)"),
1144  kGUIBLD_FILE_START, 0,
1145  fClient->GetPicture("bld_edit.png"));
1146  fMenuFile->AddEntry(new TGHotString("&Stop (Ctrl+double-click)"),
1147  kGUIBLD_FILE_STOP, 0,
1148  fClient->GetPicture("bld_stop.png"));
1152  fMenuFile->AddEntry(new TGHotString("&New Project"), kGUIBLD_FILE_NEW,
1153  0, fClient->GetPicture("bld_new.png"));
1155  0, fClient->GetPicture("bld_open.png"));
1157  0, fClient->GetPicture("bld_delete.png"));
1158  fMenuFile->AddEntry(new TGHotString("&Save project as"), kGUIBLD_FILE_SAVE,
1159  0, fClient->GetPicture("bld_save.png"));
1163  0, fClient->GetPicture("bld_exit.png"));
1164 /*
1165  fMenuEdit = new TGuiBldPopupMenu();
1166  fMenuEdit->AddSeparator();
1167  fMenuEdit->AddEntry(new TGHotString("&Preferences ..."), kGUIBLD_EDIT_PREF);
1168 */
1169  fMenuWindow = new TGuiBldPopupMenu();
1170  fMenuWindow->AddEntry(new TGHotString("Tile &Horizontally"),
1172  fMenuWindow->AddEntry(new TGHotString("Tile &Vertically"),
1174  fMenuWindow->AddEntry(new TGHotString("&Cascade"),
1177  //fMenuWindow->AddPopup(new TGHotString("&Windows"), fMain->GetWinListMenu());
1178  fMenuWindow->AddEntry(new TGHotString("&Arrange icons"),
1181  fMenuWindow->AddEntry(new TGHotString("&Opaque resize"),
1184 
1185  fMenuHelp = new TGuiBldPopupMenu();
1189  //fMenuHelp->AddSeparator();
1190  //fMenuHelp->AddEntry(new TGHotString("&Send Bug Report"),kGUIBLD_HELP_BUG);
1191 
1193 
1194  TGuiBldMenuTitle *title;
1195  title = new TGuiBldMenuTitle(bar, new TGHotString("&File"), fMenuFile);
1196  bar->AddTitle(title, new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0));
1197 
1198  //title = new TGuiBldMenuTitle(bar, new TGHotString("&Edit"), fMenuEdit);
1199  //bar->AddTitle(title, new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0));
1200 
1201  title = new TGuiBldMenuTitle(bar, new TGHotString("&Windows"), fMenuWindow);
1202  bar->AddTitle(title, new TGLayoutHints(kLHintsTop | kLHintsLeft,0,4,0,0));
1203 
1204  title = new TGuiBldMenuTitle(bar, new TGHotString("&Help"), fMenuHelp);
1205  bar->AddTitle(title, new TGLayoutHints(kLHintsTop | kLHintsRight,4,4,0,0));
1206 
1209 }
1210 
1211 ////////////////////////////////////////////////////////////////////////////////
1212 /// Set selected frame.
1213 
1215 {
1216  fSelected = f;
1217  Update();
1218 }
1219 
1220 ////////////////////////////////////////////////////////////////////////////////
1221 /// Enable toolbar buttons for alignment.
1222 
1224 {
1225  TGButton *btn = 0;
1226 
1227  btn = fToolBar->GetButton(kUpAct);
1228  if (btn) {
1229  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1230  }
1231 
1232  btn = fToolBar->GetButton(kDownAct);
1233  if (btn) {
1234  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1235  }
1236 
1237  btn = fToolBar->GetButton(kRightAct);
1238  if (btn) {
1239  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1240  }
1241 
1242  btn = fToolBar->GetButton(kLeftAct);
1243  if (btn) {
1244  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1245  }
1246 
1247  btn = fToolBar->GetButton(kDeleteAct);
1248  if (btn) {
1249  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1250  }
1251 
1252  btn = fToolBar->GetButton(kGrabAct);
1253  if (btn) {
1254  btn->SetState(kButtonUp);
1255  }
1256 
1257  btn = fToolBar->GetButton(kCropAct);
1258  if (btn) {
1259  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1260  }
1261 
1262 }
1263 
1264 ////////////////////////////////////////////////////////////////////////////////
1265 /// Enable/disable toolbar buttons according to the selected frame.
1266 
1268 {
1270 
1271  TGButton *btn = 0;
1272 
1273  if (!fSelected) {
1274  btn = fToolBar->GetButton(kCompactAct);
1275  if (btn) btn->SetState(kButtonDisabled);
1276 
1277  btn = fToolBar->GetButton(kLayoutVAct);
1278  if (btn) btn->SetState(kButtonDisabled);
1279 
1280  btn = fToolBar->GetButton(kLayoutHAct);
1281  if (btn) btn->SetState(kButtonDisabled);
1282 
1284  if (btn) btn->SetState(kButtonDisabled);
1285  return;
1286  }
1287 
1288  Bool_t comp = kFALSE;
1289  TGLayoutManager *lm = 0;
1290  Bool_t hor = kFALSE;
1291  Bool_t fixed = kFALSE;
1292  Bool_t enable = on;
1293  Bool_t compact_disable = kTRUE;
1294 
1296  lm = ((TGCompositeFrame*)fSelected)->GetLayoutManager();
1297  comp = kTRUE;
1298  hor = lm && lm->InheritsFrom(TGHorizontalLayout::Class());
1299  fixed = !fManager->CanChangeLayout(fSelected);
1300  compact_disable = !fManager->CanCompact(fSelected);
1301  } else {
1302  enable = kFALSE;
1303  }
1304 
1305  btn = fToolBar->GetButton(kCompactAct);
1306  if (btn) btn->SetState(enable && comp && !fixed && !compact_disable ?
1308 
1309  btn = fToolBar->GetButton(kLayoutHAct);
1310  if (btn) {
1311  btn->SetState(enable && comp && !hor && !fixed ? kButtonUp :
1312  kButtonDisabled);
1313  }
1314 
1315  btn = fToolBar->GetButton(kLayoutVAct);
1316  if (btn) {
1317  btn->SetState(enable && comp && hor && !fixed ? kButtonUp :
1318  kButtonDisabled);
1319  }
1320 
1322  if (btn) {
1323  btn->SetState(enable && comp && !fixed ? kButtonUp : kButtonDisabled);
1324  }
1325 /*
1326  btn = fToolBar->GetButton(kGrabAct);
1327  if (btn) {
1328  btn->SetState(enable && comp ? kButtonDown : kButtonUp);
1329  TGToolTip *tt = btn->GetToolTip();
1330  tt->SetText(btn->IsDown() ? "Drop Frames (Ctrl-Return)" :
1331  "Grab Selected Frames (Return)");
1332  }
1333 */
1334 }
1335 
1336 ////////////////////////////////////////////////////////////////////////////////
1337 /// Enable/disable toolbar buttons according to the selected frame.
1338 
1340 {
1341  TGButton *btn = 0;
1342 
1343  Bool_t lasso = fManager->IsLassoDrawn() && on;
1344 
1345  btn = fToolBar->GetButton(kReplaceAct);
1346  if (btn) {
1347  btn->SetState(!on ? kButtonDisabled : kButtonUp);
1348  }
1349 
1350  btn = fToolBar->GetButton(kCutAct);
1351  if (btn) {
1352  btn->SetState(!on || lasso ? kButtonDisabled : kButtonUp);
1353  }
1354 
1355  btn = fToolBar->GetButton(kDropAct);
1356  if (btn) {
1357  btn->SetState(!on || lasso ? kButtonDisabled : kButtonUp);
1358  }
1359 
1360  btn = fToolBar->GetButton(kCopyAct);
1361  if (btn) {
1362  btn->SetState(!on || lasso ? kButtonDisabled : kButtonUp);
1363  }
1364 
1365  btn = fToolBar->GetButton(kPasteAct);
1366  if (btn) {
1367  btn->SetState(!on || !fManager->IsPasteFrameExist() ?
1369  }
1370 
1371  btn = fToolBar->GetButton(kCropAct);
1372  if (btn) {
1373  btn->SetState(!on && !lasso ? kButtonDisabled : kButtonUp);
1374  }
1375 
1376  btn = fToolBar->GetButton(kDeleteAct);
1377  if (btn) {
1378  btn->SetState(!on && !lasso ? kButtonDisabled : kButtonUp);
1379  }
1380 }
1381 
1382 ////////////////////////////////////////////////////////////////////////////////
1383 /// Update gui builder.
1384 
1386 {
1387  if (!fManager) {
1388  return;
1389  }
1390 
1395  fManager->GetSelected() ||
1397 
1398  if (fActionButton) {
1399  TGFrame *parent = (TGFrame*)fActionButton->GetParent();
1400  parent->ChangeOptions(parent->GetOptions() & ~kSunkenFrame);
1401  fClient->NeedRedraw(parent, kTRUE);
1402  }
1403 
1404  if (!fClient->IsEditable()) {
1405  UpdateStatusBar("");
1408  fEditable = 0;
1409  //fShutter->SetSelectedItem(fShutter->GetItem("Projects"));
1410  } else {
1413  }
1414 
1416  fActionButton = 0;
1417 }
1418 
1419 ////////////////////////////////////////////////////////////////////////////////
1420 /// Return the status of the selected mode.
1421 
1423 {
1424  TGButton *btn = 0;
1425  btn = fToolBar->GetButton(kSelectAct);
1426 
1427  if (!btn) return kFALSE;
1428 
1429  return btn->IsDown();
1430 }
1431 
1432 ////////////////////////////////////////////////////////////////////////////////
1433 /// Return the status of the grab mode.
1434 
1436 {
1438 
1439  if (!btn) return kFALSE;
1440 
1441  return btn->IsDown();
1442 }
1443 
1444 ////////////////////////////////////////////////////////////////////////////////
1445 class TGuiBldSaveFrame : public TGMainFrame {
1446 
1447 public:
1448  TGuiBldSaveFrame(const TGWindow *p, UInt_t w , UInt_t h) :
1449  TGMainFrame(p, w, h) {}
1450  void SetList(TList *li) { fList = li; }
1451 };
1452 
1453 static const char *gSaveMacroTypes[] = {
1454  "Macro files", "*.[C|c]*",
1455  "All files", "*",
1456  0, 0
1457 };
1458 
1459 ////////////////////////////////////////////////////////////////////////////////
1460 /// Handle keys.
1461 
1463 {
1464  if (event->fType == kGKeyPress) {
1465  UInt_t keysym;
1466  char str[2];
1467  gVirtualX->LookupString(event, str, sizeof(str), keysym);
1468 
1469  if (event->fState & kKeyControlMask) {
1470  if (str[0] == 19) { // ctrl-s
1471  if (fMain->GetCurrent()) {
1472  return SaveProject(event);
1473  } else {
1474  return kFALSE; //TGMainFrame::HandleKey(event);
1475  }
1476  } else if (str[0] == 14) { //ctrl-n
1477  return NewProject(); //event not needed
1478  } else if (str[0] == 15) { // ctrl-o
1479  return OpenProject(event);
1480  }
1481  }
1482  fManager->HandleKey(event);
1483  return TGMainFrame::HandleKey(event);
1484  }
1485  return kTRUE;
1486 }
1487 
1488 ////////////////////////////////////////////////////////////////////////////////
1489 /// Create a new project.
1490 
1492 {
1493  TGWindow *root = (TGWindow*)fClient->GetRoot();
1494 
1495  if (root) root->SetEditable(kFALSE);
1496  fEditable = new TGMdiFrame(fMain, 500, 400, kOwnBackground);
1500  fEditable->SetEditDisabled(0); // enable editting
1501  fEditable->MapRaised();
1504 
1505  if (type == "horizontal") {
1506  TGHorizontalFrame *hor = new TGHorizontalFrame(fEditable, 100, 100);
1508  kLHintsExpandY, 1, 1, 1, 1));
1509  hor->SetEditable(kTRUE);
1510  fClient->NeedRedraw(hor, kTRUE);
1512  fEditable->MapWindow();
1515  fEditable->Layout();
1516  }
1517  else if (type == "vertical") {
1518  TGVerticalFrame *vert = new TGVerticalFrame(fEditable, 100, 100);
1520  kLHintsExpandY,1,1,1,1));
1521  vert->SetEditable(kTRUE);
1522  fClient->NeedRedraw(vert, kTRUE);
1524  fEditable->MapWindow();
1527  fEditable->Layout();
1528 
1529  } else {
1531  }
1536 
1537 
1539  return kTRUE;
1540 }
1541 
1542 ////////////////////////////////////////////////////////////////////////////////
1543 /// Open new gui builder project.
1544 
1546 {
1547 
1549  if (btn) {
1550  btn->SetBackgroundColor(GetBgnd());
1551  fClient->NeedRedraw(btn, kTRUE);
1552  }
1553 
1554  TGFileInfo fi;
1555  static TString dir(".");
1556  static Bool_t overwr = kFALSE;
1557  TString fname;
1558 
1560  fi.SetIniDir(dir);
1561  fi.fOverwrite = overwr;
1562  TGWindow *root = (TGWindow*)fClient->GetRoot();
1563  root->SetEditable(kFALSE);
1564 
1565  new TGFileDialog(fClient->GetDefaultRoot(), this, kFDOpen, &fi);
1566 
1567  if (!fi.fFilename) {
1568  root->SetEditable(kTRUE);
1569  return kFALSE;
1570  }
1571 
1572  dir = fi.fIniDir;
1573  overwr = fi.fOverwrite;
1574  fname = fi.fFilename;
1575 
1576  if (fname.EndsWith(".C", TString::kIgnoreCase) || fname.EndsWith(".cxx") ||
1577  fname.EndsWith(".cpp") || fname.EndsWith(".cc")) {
1578  NewProject(); // create new project
1579  gROOT->Macro(fname.Data()); // put content of the macro as child frame
1580  } else {
1581  Int_t retval;
1582  new TGMsgBox(fClient->GetDefaultRoot(), this, "Error...",
1583  TString::Format("file (%s) must have source extension (.C, .c, .cxx, .cpp, .cc)",
1585  &retval);
1586 
1587  if (retval == kMBRetry) {
1588  OpenProject(event);
1589  }
1590  }
1591 
1595 
1596  return kTRUE;
1597 }
1598 
1599 ////////////////////////////////////////////////////////////////////////////////
1600 /// Save selected project.
1601 
1603 {
1605  if (btn) {
1606  btn->SetBackgroundColor(GetBgnd());
1607  fClient->NeedRedraw(btn, kTRUE);
1608  }
1609 
1610  TGMdiFrame *savfr = fMain->GetCurrent();
1611  if (!savfr) return kFALSE;
1612 
1613  static TImage *img = 0;
1614 
1615  if (!img) {
1616  img = TImage::Create();
1617  }
1618  img->FromWindow(savfr->GetParent()->GetId());
1619 
1620  TGWindow *root = (TGWindow*)fClient->GetRoot();
1621  TGFileInfo fi;
1622  static TString dir(".");
1623  static Bool_t overwr = kFALSE;
1624  TString fname;
1625  root->SetEditable(kFALSE);
1626 
1628  fi.SetIniDir(dir);
1629  fi.fOverwrite = overwr;
1630 
1631  new TGFileDialog(fClient->GetDefaultRoot(), this, kFDSave, &fi);
1632 
1633  if (!fi.fFilename) {
1634  root->SetEditable(kTRUE);
1635  SetEditable(kTRUE);
1636  return kFALSE;
1637  }
1638 
1639  dir = fi.fIniDir;
1640  overwr = fi.fOverwrite;
1641  fname = gSystem->UnixPathName(fi.fFilename);
1642 
1643  if (fname.EndsWith(".C", TString::kIgnoreCase) || fname.EndsWith(".cxx") ||
1644  fname.EndsWith(".cpp") || fname.EndsWith(".cc")) {
1645  TGuiBldSaveFrame *main = new TGuiBldSaveFrame(fClient->GetDefaultRoot(),
1646  savfr->GetWidth(),
1647  savfr->GetHeight());
1648  TList *list = main->GetList();
1649  TString name = savfr->GetName();
1650  savfr->SetName(main->GetName());
1651  main->SetList(savfr->GetList());
1652  main->SetLayoutBroken(savfr->IsLayoutBroken());
1653  main->SaveSource(fname.Data(), "keep_names");
1654  savfr->SetWindowName(fname.Data());
1655  main->SetList(list);
1656 
1657  main->SetMWMHints(kMWMDecorAll, kMWMFuncAll,
1659  main->SetWMSize(main->GetWidth(), main->GetHeight());
1660  main->SetWMSizeHints(main->GetDefaultWidth(), main->GetDefaultHeight(),
1661  10000, 10000, 0, 0);
1662  main->SetWindowName(fname.Data());
1663  main->SetIconName(fname.Data());
1664  main->SetClassHints(fname.Data(), fname.Data());
1665  // some problems here under win32
1666  if (gVirtualX->InheritsFrom("TGX11")) main->SetIconPixmap("bld_rgb.xpm");
1667 
1668  savfr->SetName(name.Data());
1669 
1670  AddMacro(fname.Data(), img);
1671  delete main;
1672  } else {
1673  Int_t retval;
1674  new TGMsgBox(fClient->GetDefaultRoot(), this, "Error...",
1675  TString::Format("file (%s) must have source extension (.C, .c, .cxx, .cpp, .cc)",
1677  &retval);
1678  if (retval == kMBRetry) {
1679  SaveProject(event);
1680  }
1682  }
1684  return kTRUE;
1685 }
1686 
1687 ////////////////////////////////////////////////////////////////////////////////
1688 /// Add macro to "User's Macros" section
1689 /// Input img must be static - do not delete it.
1690 
1691 void TRootGuiBuilder::AddMacro(const char *macro, TImage *img)
1692 {
1693  if (!img || !img->GetWidth() || !img->GetHeight()) {
1694  return;
1695  }
1696 
1697  UInt_t w = 100;
1698  Float_t ratio = Float_t(w)/img->GetWidth();
1699  Float_t rh = img->GetHeight()*ratio;
1700  UInt_t h = UInt_t(rh);
1701  img->Scale(w, h);
1702  img->Merge(img, "overlay");
1703 
1704  static int i = 0;
1705  const TGPicture *pic = fClient->GetPicturePool()->GetPicture(
1706  TString::Format("%s;%d", macro, i++),
1707  img->GetPixmap(),img->GetMask());
1708  const char *name = gSystem->BaseName(macro);
1709 
1710  TGButton *btn = FindActionButton(name, "User's Macros");
1711  TGuiBldAction *act = 0;
1712 
1713  if (!btn) {
1714  act = new TGuiBldAction(name, macro, kGuiBldMacro);
1715  act->fAct = macro;
1716  act->fPic = macro;
1717  act->fPicture = pic;
1718 
1719  AddAction(act, "User's Macros");
1720  } else {
1721  act = (TGuiBldAction*)btn->GetUserData();
1722  act->fAct = macro;
1723  act->fPic = macro;
1724  act->fPicture = pic;
1725 
1726  if (btn->InheritsFrom(TGPictureButton::Class())) {
1727  btn->Resize(w, h);
1728  fClient->FreePicture(((TGPictureButton*)btn)->GetPicture());
1729  ((TGPictureButton*)btn)->SetPicture(pic);
1730  }
1731  }
1733 }
1734 
1735 ////////////////////////////////////////////////////////////////////////////////
1736 /// Find the editable frame.
1737 
1739 {
1740  const TGWindow *parent = win;
1741  TGMdiFrame *ret = 0;
1742 
1743  while (parent && (parent != fClient->GetDefaultRoot())) {
1744  if (parent->InheritsFrom(TGMdiFrame::Class())) {
1745  ret = (TGMdiFrame*)parent;
1746  return ret;
1747  }
1748  parent = parent->GetParent();
1749  }
1750  return 0;
1751 }
1752 
1753 ////////////////////////////////////////////////////////////////////////////////
1754 /// Switch image of toolbar edit button according to the current state.
1755 
1757 {
1758  static const TGPicture *start = fClient->GetPicture("bld_edit.png");
1759  static const TGPicture *stop = fClient->GetPicture("bld_stop.png");
1760 
1761  if (fClient->IsEditable()) {
1763  fStartButton->SetPicture(stop);
1765  fStartButton->SetToolTipText("Stop Edit (Ctrl-Dbl-Click)");
1766  } else {
1767  if (fMain->GetNumberOfFrames() < 1) {
1769  } else {
1771  fStartButton->SetPicture(start);
1773  fStartButton->SetToolTipText("Start Edit (Ctrl-Dbl-Click)");
1774  }
1775  }
1776 
1778 }
1779 
1780 ////////////////////////////////////////////////////////////////////////////////
1781 /// Handle menu items.
1782 
1784 {
1785  TGWindow *root = (TGWindow*)fClient->GetRoot();
1786  TRootHelpDialog *hd;
1787 
1788  switch (id) {
1789  case kGUIBLD_FILE_START:
1790  if (fClient->IsEditable()) {
1791  break;
1792  }
1793  fEditable = fMain->GetCurrent();
1794  if (fEditable) {
1796  } //else if (!fMain->GetCurrent()) {
1797  //NewProject();
1798  //}
1799  UpdateStatusBar("Start edit");
1803  break;
1804 
1805  case kGUIBLD_FILE_STOP:
1806  if (!fClient->IsEditable()) {
1807  break;
1808  }
1810 
1811  if (fEditable) {
1812  root->SetEditable(kFALSE);
1813 
1814  UpdateStatusBar("Stop edit");
1817  fEditable = 0;
1819  }
1820  fEditor->Reset();
1821  break;
1822 
1823  case kGUIBLD_FILE_NEW:
1824  NewProject();
1826  break;
1827 
1828  case kGUIBLD_FILE_CLOSE:
1830  if (fEditable && (fEditable == fMain->GetCurrent())) {
1831  root->SetEditable(kFALSE);
1832  }
1833  fEditor->Reset();
1834  UpdateStatusBar("");
1835  fMain->Close(fMain->GetCurrent());
1836 
1837  if (fMain->GetNumberOfFrames() <= 1) {
1841  }
1842 
1843  if (fClient->IsEditable()) {
1846  } else {
1849  }
1851  break;
1852 
1853  case kGUIBLD_FILE_EXIT:
1854  CloseWindow();
1855  break;
1856 
1857  case kGUIBLD_FILE_OPEN:
1858  OpenProject();
1860  break;
1861 
1862  case kGUIBLD_FILE_SAVE:
1863  SaveProject();
1865  break;
1866 
1867  case kGUIBLD_WINDOW_HOR:
1868  fMain->TileHorizontal();
1869  break;
1870 
1871  case kGUIBLD_WINDOW_VERT:
1872  fMain->TileVertical();
1873  break;
1874 
1876  fMain->Cascade();
1877  break;
1878 
1881  break;
1882 
1883  case kGUIBLD_WINDOW_OPAQUE:
1887  } else {
1890  }
1891  break;
1892  case kGUIBLD_HELP_CONTENTS:
1893  root->SetEditable(kFALSE);
1894  hd = new TRootHelpDialog(this, "Help on Gui Builder...", 600, 400);
1895  hd->SetText(gHelpBuilder);
1896  hd->SetEditDisabled();
1897  hd->Popup();
1898  root->SetEditable(kTRUE);
1899  break;
1900 
1901  case kGUIBLD_HELP_ABOUT:
1902  root->SetEditable(kFALSE);
1903  hd = new TRootHelpDialog(this, "About Gui Builder...", 520, 160);
1904  hd->SetEditDisabled();
1906  hd->Popup();
1907  root->SetEditable(kTRUE);
1908  break;
1909 
1910  default:
1911  fMain->SetCurrent(id);
1912  break;
1913  }
1914 }
1915 
1916 ////////////////////////////////////////////////////////////////////////////////
1917 /// Handler before closing MDI frame.
1918 
1920 {
1921  int retval;
1922  if (fClosing == -1)
1923  return;
1924  TGMdiFrame *mdiframe = (TGMdiFrame *)gTQSender;
1926  new TGMsgBox(gClient->GetDefaultRoot(), this,
1927  "Closing project", "Do you want to save the project before closing?",
1928  kMBIconExclamation, kMBYes | kMBNo | kMBCancel, &retval);
1929 
1931  if (retval == kMBYes) {
1932  SaveProject();
1933  }
1934  if (retval == kMBCancel) {
1935  fClosing = -1;
1936  if (!fClient->IsEditable())
1938  return;
1939  }
1940  fEditor->RemoveFrame(mdiframe);
1941  mdiframe->CloseWindow();
1942 }
1943 
1944 ////////////////////////////////////////////////////////////////////////////////
1945 /// Handler for closed MDI frame.
1946 
1948 {
1949  fEditable = 0;
1950 
1951  if (fClient->IsEditable()) {
1955  } else {
1958  }
1959  fEditor->Reset();
1960  UpdateStatusBar("");
1961 
1962  if (fMain->GetNumberOfFrames() == 0) {
1967  return;
1968  }
1969 }
1970 
1971 ////////////////////////////////////////////////////////////////////////////////
1972 /// Update information shown on the status bar.
1973 
1975 {
1976  if (!fStatusBar) return;
1977 
1978  const char *text = 0;
1979 
1980  if (!txt) {
1981  TObject *o = (TObject *)gTQSender;
1982 
1983  if (o && o->InheritsFrom(TGToolTip::Class())) {
1984  TGToolTip *tip = (TGToolTip*)o;
1985  text = tip->GetText()->Data();
1986  }
1987  } else {
1988  text = txt;
1989  }
1991 }
1992 
1993 ////////////////////////////////////////////////////////////////////////////////
1994 /// Clear information shown in the status bar.
1995 
1997 {
1998  if (!fStatusBar) return;
1999 
2000  fStatusBar->SetText("");
2001 }
2002 
2003 ////////////////////////////////////////////////////////////////////////////////
2004 /// Keyborad key binding.
2005 
2007 {
2008  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_a),
2010 
2011  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_n),
2013 
2014  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_o),
2016 
2017  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Return),
2019 
2020  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Return),
2021  0, kTRUE);
2022 
2023  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Enter),
2025 
2026  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Enter),
2027  0, kTRUE);
2028 
2029  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_x),
2031 
2032  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_c),
2034 
2035  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_v),
2037 
2038  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_r),
2040 
2041  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_z),
2043 
2044  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_z),
2046 
2047  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_b),
2049 
2050  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_l),
2052 
2053  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_g),
2055 
2056  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_h),
2058 
2059  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Delete),
2060  0, kTRUE);
2061 
2062  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Backspace),
2063  0, kTRUE);
2064 
2065  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Space),
2066  0, kTRUE);
2067 
2068  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Left),
2069  0, kTRUE);
2070 
2071  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Right),
2072  0, kTRUE);
2073 
2074  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Up),
2075  0, kTRUE);
2076 
2077  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Down),
2078  0, kTRUE);
2079 
2080  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Left),
2081  kKeyShiftMask, kTRUE);
2082 
2083  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Right),
2084  kKeyShiftMask, kTRUE);
2085 
2086  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Up),
2087  kKeyShiftMask, kTRUE);
2088 
2089  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Down),
2090  kKeyShiftMask, kTRUE);
2091 
2092  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Delete),
2093  kKeyShiftMask, kTRUE);
2094 
2095  gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Backspace),
2096  kKeyShiftMask, kTRUE);
2097 }
2098 
2099 ////////////////////////////////////////////////////////////////////////////////
2100 /// Create new vertical splitter (TGVSplitter).
2101 
2103 {
2104  TGHorizontalFrame *ret = new TGHorizontalFrame();
2105  ret->SetCleanup(kDeepCleanup);
2106  TGVerticalFrame *v1 = new TGVerticalFrame(ret, 40, 10, kSunkenFrame |
2107  kFixedWidth);
2109  //v1->SetEditDisabled(kEditDisableGrab);
2110 
2111  TGVSplitter *splitter = new TGVSplitter(ret);
2112  splitter->SetFrame(v1, kTRUE);
2114  splitter->SetEditDisabled(kEditDisableBtnEnable);
2115 
2116  TGVerticalFrame *v2 = new TGVerticalFrame(ret, 10, 10, kSunkenFrame);
2117  v2->ChangeOptions(kSunkenFrame);
2119  kLHintsExpandY));
2120  //v2->SetEditDisabled(kEditDisableGrab);
2122 
2123  ret->MapSubwindows();
2124  ret->SetLayoutBroken(kFALSE);
2125  return ret;
2126 }
2127 
2128 ////////////////////////////////////////////////////////////////////////////////
2129 /// Creates new horizontal splitter (TGHSplitter).
2130 
2132 {
2133  TGVerticalFrame *ret = new TGVerticalFrame();
2134  ret->SetCleanup(kDeepCleanup);
2135  TGHorizontalFrame *v1 = new TGHorizontalFrame(ret, 10, 40, kSunkenFrame |
2136  kFixedHeight);
2138  //v1->SetEditDisabled(kEditDisableGrab);
2139 
2140  TGHSplitter *splitter = new TGHSplitter(ret);
2141  splitter->SetFrame(v1, kTRUE);
2143  splitter->SetEditDisabled(kEditDisable);
2144 
2145  TGHorizontalFrame *v2 = new TGHorizontalFrame(ret, 10, 10);
2146  v2->ChangeOptions(kSunkenFrame);
2148  kLHintsExpandY));
2149  //v2->SetEditDisabled(kEditDisableGrab);
2151 
2152  ret->MapSubwindows();
2153  ret->SetLayoutBroken(kFALSE);
2154  return ret;
2155 }
2156 
2157 ////////////////////////////////////////////////////////////////////////////////
2158 /// Hide builder.
2159 
2161 {
2162  //fMain->CloseAll();
2163  UnmapWindow();
2164 }
2165 
2166 ////////////////////////////////////////////////////////////////////////////////
2167 /// Return default background color.
2168 
2170 {
2171  return GetDefaultFrameBackground();
2172 
2173  static ULong_t gPixel = 0;
2174 
2175  if (gPixel) return gPixel;
2176 
2177  Float_t r, g, b;
2178 
2179  r = 232./255;
2180  g = 232./255;
2181  b = 222./255;
2182 
2183  gPixel = TColor::RGB2Pixel(r, g, b);
2184  return gPixel;
2185 }
2186 
2187 ////////////////////////////////////////////////////////////////////////////////
2188 /// Return background GC.
2189 
2191 {
2192  if (fgBgnd) return fgBgnd;
2193 
2194  fgBgnd = new TGGC(TGFrame::GetBckgndGC());
2195 
2196  Pixel_t back = GetBgnd();
2197  fgBgnd->SetBackground(back);
2198  fgBgnd->SetForeground(back);
2199 
2200  return fgBgnd;
2201 }
2202 
2203 ////////////////////////////////////////////////////////////////////////////////
2204 /// Set a background color to frame and all its subframes.
2205 
2207 {
2208  if (!frame) return;
2209 
2210  frame->SetBackgroundColor(color);
2211  if (!frame->InheritsFrom(TGCompositeFrame::Class())) return;
2212 
2213  TIter next(((TGCompositeFrame*)frame)->GetList());
2214  TGFrameElement *fe;
2215 
2216  while ((fe = (TGFrameElement*)next())) {
2217  if (fe->fFrame->GetBackground() == TGFrame::GetWhitePixel()) {
2218  continue;
2219  }
2220  PropagateBgndColor(fe->fFrame, color);
2221  }
2222 }
2223 
2224 ////////////////////////////////////////////////////////////////////////////////
2225 /// Return background color for popup menus.
2226 
2228 {
2229  return GetDefaultFrameBackground();
2230 
2231  static ULong_t gPixel = 0;
2232 
2233  if (gPixel) return gPixel;
2234 
2235  Float_t r, g, b;
2236 
2237  r = 250./255;
2238  g = 250./255;
2239  b = 250./255;
2240 
2241  gPixel = TColor::RGB2Pixel(r, g, b);
2242 
2243  return gPixel;
2244 }
2245 
2246 ////////////////////////////////////////////////////////////////////////////////
2247 /// Return background GC for popup menus.
2248 
2250 {
2251  if (fgBgndPopup) return fgBgndPopup;
2252 
2254 
2255  Pixel_t back = GetPopupBgnd();
2256  fgBgndPopup->SetBackground(back);
2257  fgBgndPopup->SetForeground(back);
2258 
2259  return fgBgndPopup;
2260 }
2261 
2262 ////////////////////////////////////////////////////////////////////////////////
2263 /// Return highlighted color for popup menu entry.
2264 
2266 {
2268 
2269  static ULong_t gPixel = 0;
2270 
2271  if (gPixel) return gPixel;
2272 
2273  Float_t r, g, b;
2274 
2275  r = 120./255;
2276  g = 120./255;
2277  b = 222./255;
2278 
2279  gPixel = TColor::RGB2Pixel(r, g, b);
2280 
2281  return gPixel;
2282 }
2283 
2284 ////////////////////////////////////////////////////////////////////////////////
2285 /// Return background GC for highlighted popup menu entry.
2286 
2288 {
2289  if (fgBgndPopupHlght) return fgBgndPopupHlght;
2290 
2292 
2293  Pixel_t back = GetPopupHlght();
2296 
2297  return fgBgndPopupHlght;
2298 }
2299 
2300 ////////////////////////////////////////////////////////////////////////////////
2301 /// Return style popup menu.
2302 
2304 {
2305  return new TGuiBldPopupMenu();
2306 }
2307 
2308 ////////////////////////////////////////////////////////////////////////////////
2309 /// Helper method used in guibuilding
2310 
2312 {
2313  TGCanvas *canvas = new TGCanvas(gClient->GetRoot(), 100, 100);
2314  TGListTree *lt = new TGListTree(canvas, kHorizontalFrame);
2315  lt->AddItem(0, "Entry 1");
2316  lt->AddItem(0, "Entry 2");
2317  lt->AddItem(0, "Entry 3");
2318  lt->AddItem(0, "Entry 4");
2319  lt->AddItem(0, "Entry 5");
2320  canvas->Resize(100, 60);
2321  canvas->MapSubwindows();
2322 
2323  return canvas;
2324 }
2325 
2326 ////////////////////////////////////////////////////////////////////////////////
2327 /// Helper method used in guibuilding to create TGCanvas widget
2328 
2330 {
2331  TGCanvas *canvas = new TGCanvas(gClient->GetRoot(), 100, 100);
2332  TGCompositeFrame *cont = new TGCompositeFrame(canvas->GetViewPort(),
2333  200, 200, kHorizontalFrame |
2334  kOwnBackground);
2335 
2336  cont->SetCleanup(kDeepCleanup);
2337  cont->SetLayoutManager(new TGTileLayout(cont, 8));
2338  cont->AddFrame(new TGTextButton(cont, "Button1"));
2339  cont->AddFrame(new TGTextButton(cont, "Button2"));
2340  cont->AddFrame(new TGTextButton(cont, "Button3"));
2341  cont->AddFrame(new TGTextButton(cont, "Button4"));
2342 
2343  canvas->SetContainer(cont);
2344  return canvas;
2345 }
2346 
2347 ////////////////////////////////////////////////////////////////////////////////
2348 /// Helper method used in guibuilding to create TGShutter widget
2349 
2351 {
2352  TGShutterItem *item;
2353  TGCompositeFrame *container;
2354  const TGPicture *buttonpic;
2355  TGPictureButton *button;
2356 
2358  TGShutter *shut = new TGShutter();
2359 
2360  item = shut->AddPage("Histograms");
2361  container = (TGCompositeFrame *)item->GetContainer();
2362  buttonpic = gClient->GetPicture("h1_s.xpm");
2363 
2364  if (buttonpic) {
2365  button = new TGPictureButton(container, buttonpic);
2366  button->SetToolTipText("TH1");
2367  container->AddFrame(button, l);
2368  }
2369  buttonpic = gClient->GetPicture("h2_s.xpm");
2370 
2371  if (buttonpic) {
2372  button = new TGPictureButton(container, buttonpic);
2373  button->SetToolTipText("TH2");
2374  container->AddFrame(button, l);
2375  }
2376  buttonpic = gClient->GetPicture("h3_s.xpm");
2377 
2378  if (buttonpic) {
2379  button = new TGPictureButton(container, buttonpic);
2380  button->SetToolTipText("TH3");
2381  container->AddFrame(button, l);
2382  }
2383  buttonpic = gClient->GetPicture("profile_s.xpm");
2384 
2385  if (buttonpic) {
2386  button = new TGPictureButton(container, buttonpic);
2387  button->SetToolTipText("TProfile");
2388  container->AddFrame(button, l);
2389  }
2390 
2391  // new page
2392  item = shut->AddPage("Functions");
2393  container = (TGCompositeFrame *)item->GetContainer();
2394  buttonpic = gClient->GetPicture("f1_s.xpm");
2395 
2396  if (buttonpic) {
2397  button = new TGPictureButton(container, buttonpic);
2398  button->SetToolTipText("TF1");
2399  container->AddFrame(button, l);
2400  }
2401  buttonpic = gClient->GetPicture("f2_s.xpm");
2402 
2403  if (buttonpic) {
2404  button = new TGPictureButton(container, buttonpic);
2405  button->SetToolTipText("TF2");
2406  container->AddFrame(button, l);
2407  }
2408 
2409  // new page
2410  item = shut->AddPage("Trees");
2411  container = (TGCompositeFrame *)item->GetContainer();
2412  buttonpic = gClient->GetPicture("ntuple_s.xpm");
2413 
2414  if (buttonpic) {
2415  button = new TGPictureButton(container, buttonpic);
2416  button->SetToolTipText("TNtuple");
2417  container->AddFrame(button, l);
2418  }
2419  buttonpic = gClient->GetPicture("tree_s.xpm");
2420 
2421  if (buttonpic) {
2422  button = new TGPictureButton(container, buttonpic);
2423  button->SetToolTipText("TTree");
2424  container->AddFrame(button, l);
2425  }
2426  buttonpic = gClient->GetPicture("chain_s.xpm");
2427 
2428  if (buttonpic) {
2429  button = new TGPictureButton(container, buttonpic);
2430  button->SetToolTipText("TChain");
2431  container->AddFrame(button, l);
2432  }
2433 
2434  shut->MapSubwindows();
2435  return shut;
2436 }
2437 
2438 ////////////////////////////////////////////////////////////////////////////////
2439 /// Helper method to create TGTextEdit widget
2440 
2442 {
2443  TGTextEdit *te = new TGTextEdit();
2444 
2445  te->AddLine("all work and no play makes jack a pretty");
2446  te->AddLine("dull boy. all work and no play makes jack");
2447  te->AddLine("a pretty dull boy. all work and no play ");
2448  te->AddLine("makes jack a pretty dull boy. all work");
2449  te->AddLine("and no play makes jack a pretty dull boy.");
2450 
2451  te->MapSubwindows();
2452  te->Layout();
2453  te->Resize(100, 60);
2454 
2455  return te;
2456 }
2457 
2458 ////////////////////////////////////////////////////////////////////////////////
2459 /// Helper method to create TGTab widget
2460 
2462 {
2463  TGTab *tab = new TGTab();
2464 
2465  tab->AddTab("Tab1");
2466  tab->AddTab("Tab2");
2467  tab->MapSubwindows();
2468 
2469  return tab;
2470 }
2471 
2472 ////////////////////////////////////////////////////////////////////////////////
2473 /// Helper method to create TGListBox widget
2474 
2476 {
2477  TGListBox *lb = new TGListBox();
2478 
2479  lb->AddEntry("Entry 1", 0);
2480  lb->AddEntry("Entry 2", 1);
2481  lb->AddEntry("Entry 3", 2);
2482  lb->AddEntry("Entry 4", 3);
2483  lb->AddEntry("Entry 5", 4);
2484  lb->AddEntry("Entry 6", 5);
2485  lb->AddEntry("Entry 7", 6);
2486  lb->MapSubwindows();
2487 
2488  lb->Resize(100,100);
2489 
2490  return lb;
2491 }
2492 
2493 ////////////////////////////////////////////////////////////////////////////////
2494 /// Helper method to create TGComboBox widget
2495 
2497 {
2498  TGComboBox *cb = new TGComboBox();
2499 
2500  cb->AddEntry("Entry 1 ", 0);
2501  cb->AddEntry("Entry 2 ", 1);
2502  cb->AddEntry("Entry 3 ", 2);
2503  cb->AddEntry("Entry 4 ", 3);
2504  cb->AddEntry("Entry 5 ", 4);
2505  cb->AddEntry("Entry 6 ", 5);
2506  cb->AddEntry("Entry 7 ", 6);
2507  cb->MapSubwindows();
2508 
2510  int max_ascent, max_descent;
2511  gVirtualX->GetFontProperties(fs, max_ascent, max_descent);
2512 
2513  cb->Resize(cb->GetListBox()->GetDefaultWidth(), max_ascent+max_descent+7);
2514  return cb;
2515 }
2516 
2517 ////////////////////////////////////////////////////////////////////////////////
2518 /// Helper method to create TGHorizontal3DLine widget.
2519 
2521 {
2522  TGHorizontal3DLine *l = new TGHorizontal3DLine(0, 100, 2);
2523  l->Resize(100, 2);
2524 
2525  return l;
2526 }
2527 
2528 ////////////////////////////////////////////////////////////////////////////////
2529 /// Helper method to create TGVertical3DLine widget.
2530 
2532 {
2534  l->Resize(2, 100);
2535 
2536  return l;
2537 }
2538 
2539 ////////////////////////////////////////////////////////////////////////////////
2540 /// Helper method to create TGHScrollBar
2541 
2543 {
2544  TGHScrollBar *b = new TGHScrollBar();
2545 
2546  b->Resize(100, b->GetDefaultHeight());
2547  b->SetRange(100, 20);
2548  b->MapSubwindows();
2549 
2550  return b;
2551 }
2552 
2553 ////////////////////////////////////////////////////////////////////////////////
2554 /// Helper method to create TGVScrollBar
2555 
2557 {
2558  TGVScrollBar *b = new TGVScrollBar();
2559 
2560  b->Resize(b->GetDefaultWidth(), 100);
2561  b->MapSubwindows();
2562  b->SetRange(100, 20);
2563 
2564  return b;
2565 }
2566 
2567 ////////////////////////////////////////////////////////////////////////////////
2568 /// Helper method to create TGHProgressBar
2569 
2571 {
2572  TGHProgressBar *b = new TGHProgressBar();
2573 
2574  b->Resize(100, b->GetDefaultHeight());
2575  b->SetPosition(25);
2576  b->Format("%.2f");
2577  b->SetFillType(TGProgressBar::kBlockFill);
2578 
2579  return b;
2580 }
2581 
2582 ////////////////////////////////////////////////////////////////////////////////
2583 /// Helper method to create TGVProgressBar
2584 
2586 {
2587  TGVProgressBar *b = new TGVProgressBar();
2588 
2589  b->Resize(b->GetDefaultWidth(), 100);
2590  b->SetPosition(25);
2591  b->SetFillType(TGProgressBar::kBlockFill);
2592 
2593  return b;
2594 }
2595 
2596 
TGComboBox.h
kKey_Down
@ kKey_Down
Definition: KeySymbols.h:49
TGuiBldEditor::RemoveFrame
void RemoveFrame(TGFrame *)
Remove a frame.
Definition: TGuiBldEditor.cxx:290
TRootHelpDialog::Popup
void Popup()
Show help dialog.
Definition: TRootHelpDialog.cxx:68
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
l
auto * l
Definition: textangle.C:4
TGMdiFrame::SetMdiHints
virtual void SetMdiHints(ULong_t mdihints)
Set MDI hints, also used to identify titlebar buttons.
Definition: TGMdiFrame.cxx:93
Event_t::fType
EGEventType fType
Definition: GuiTypes.h:174
TRootGuiBuilder::fEditable
TGMdiFrame * fEditable
Definition: TRootGuiBuilder.h:84
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGListBox
Definition: TGListBox.h:288
TGShutterItem::GetContainer
TGFrame * GetContainer() const
Definition: TGShutter.h:59
TGPopupMenu::fEntrySep
UInt_t fEntrySep
Definition: TGMenu.h:148
TGuiBldDragManager::CanChangeLayout
Bool_t CanChangeLayout(TGWindow *w) const
kTRUE - if it's possible to switch disable/enable layout
Definition: TGuiBldDragManager.cxx:4829
TGPopupMenu::IsEntryChecked
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1844
Event_t::fState
UInt_t fState
Definition: GuiTypes.h:180
TRootGuiBuilder::fEditor
TGuiBldEditor * fEditor
Definition: TRootGuiBuilder.h:85
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:412
TGTextView::AddLine
virtual void AddLine(const char *string)
Add a line of text to the view widget.
Definition: TGTextView.cxx:228
TGWindow::SetEditable
virtual void SetEditable(Bool_t on=kTRUE)
Definition: TGWindow.h:115
TGPictureButton::SetPicture
virtual void SetPicture(const TGPicture *new_pic)
Change a picture in a picture button.
Definition: TGButton.cxx:993
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:250
TRootGuiBuilder::BuildV3DLine
static TGFrame * BuildV3DLine()
Helper method to create TGVertical3DLine widget.
Definition: TRootGuiBuilder.cxx:2531
TGToolBar::SetId
virtual void SetId(TGButton *button, Long_t id)
changes id for button.
Definition: TGToolBar.cxx:171
kCompactAct
@ kCompactAct
Definition: TGuiBldDragManager.h:49
kMenuHideMask
@ kMenuHideMask
Definition: TGMenu.h:46
kKey_Delete
@ kKey_Delete
Definition: KeySymbols.h:39
kKey_x
@ kKey_x
Definition: KeySymbols.h:187
TRootGuiBuilder::Hide
virtual void Hide()
Hide builder.
Definition: TRootGuiBuilder.cxx:2160
kMenuPopup
@ kMenuPopup
Definition: TGMenu.h:50
TGWindow
Definition: TGWindow.h:31
kDeleteAct
@ kDeleteAct
Definition: TGuiBldDragManager.h:50
kLHintsCenterX
@ kLHintsCenterX
Definition: TGLayout.h:38
TGShutter::GetItem
TGShutterItem * GetItem(const char *name)
returns a shutter item by name (name is hot string of shutter item)
Definition: TGShutter.cxx:301
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGMdiMainFrame::GetNumberOfFrames
Long_t GetNumberOfFrames() const
Definition: TGMdiMainFrame.h:213
ToolBarData_t::fPixmap
const char * fPixmap
Definition: TGToolBar.h:33
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TGMenuTitle::DoRedraw
virtual void DoRedraw()
Draw a menu title.
Definition: TGMenu.cxx:2087
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:347
TGShutter::AddItem
virtual void AddItem(TGShutterItem *item)
Add shutter item to shutter frame.
Definition: TGShutter.cxx:72
TGMenuEntry::GetShortcutText
const char * GetShortcutText() const
Definition: TGMenu.h:97
TGMainFrame
Definition: TGFrame.h:444
TGVScrollBar
Definition: TGScrollBar.h:183
TGPictureButton::DoRedraw
virtual void DoRedraw()
Redraw picture button.
Definition: TGButton.cxx:1017
kEditableAct
@ kEditableAct
Definition: TGuiBldDragManager.h:47
TGMdiFrame::CloseWindow
virtual Bool_t CloseWindow()
Close MDI frame window.
Definition: TGMdiFrame.cxx:74
TGFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:306
TGMdiMainFrame::Close
virtual Int_t Close(TGMdiFrame *frame)
Close MDI child window mdiframe.
Definition: TGMdiMainFrame.cxx:958
kGUIBLD_WINDOW_CASCADE
@ kGUIBLD_WINDOW_CASCADE
Definition: TRootGuiBuilder.h:43
TGButton::IsDown
virtual Bool_t IsDown() const
Definition: TGButton.cxx:254
TGPicture
Definition: TGPicture.h:36
f
#define f(i)
Definition: RSha256.hxx:122
TRootGuiBuilder::IsSelectMode
virtual Bool_t IsSelectMode() const
Return the status of the selected mode.
Definition: TRootGuiBuilder.cxx:1422
TImage::Merge
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:297
kPasteAct
@ kPasteAct
Definition: TGuiBldDragManager.h:48
TGHorizontal3DLine
Definition: TG3DLine.h:29
kLeaveNotify
@ kLeaveNotify
Definition: GuiTypes.h:60
TGMainFrame::SetIconName
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1762
TGToolTip::SetDelay
void SetDelay(Long_t delayms)
Set delay in milliseconds.
Definition: TGToolTip.cxx:396
TImage::Create
static TImage * Create()
Create an image.
Definition: TImage.cxx:35
TRootGuiBuilder::GetBgnd
static ULong_t GetBgnd()
Return default background color.
Definition: TRootGuiBuilder.cxx:2169
TSystem::BaseName
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:933
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TRootGuiBuilder::PropagateBgndColor
static void PropagateBgndColor(TGFrame *frame, Pixel_t color)
Set a background color to frame and all its subframes.
Definition: TRootGuiBuilder.cxx:2206
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)
TGMainFrame::SetIconPixmap
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition: TGFrame.cxx:1777
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
TGShutter.h
TString::Data
const char * Data() const
Definition: TString.h:369
kUndoAct
@ kUndoAct
Definition: TGuiBldDragManager.h:53
kKey_Up
@ kKey_Up
Definition: KeySymbols.h:47
TRootGuiBuilder::~TRootGuiBuilder
virtual ~TRootGuiBuilder()
Destructor.
Definition: TRootGuiBuilder.cxx:932
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:40
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TGDockableFrame::SetWindowName
void SetWindowName(const char *name)
Set window name so it appear as title of the undock window.
Definition: TGDockableFrame.cxx:442
TGLayout.h
kCropAct
@ kCropAct
Definition: TGuiBldDragManager.h:48
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TRootGuiBuilder::GetPopupBgndGC
static TGGC * GetPopupBgndGC()
Return background GC for popup menus.
Definition: TRootGuiBuilder.cxx:2249
TGuiBldDragManager::CanCompact
Bool_t CanCompact(TGWindow *w) const
kTRUE is frame could be compacted/"layouted"
Definition: TGuiBldDragManager.cxx:4848
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
kGUIBLD_FILE_SAVE
@ kGUIBLD_FILE_SAVE
Definition: TRootGuiBuilder.h:37
kMBCancel
@ kMBCancel
Definition: TGMsgBox.h:48
TGuiBldEditor::Reset
void Reset()
Reset the editor.
Definition: TGuiBldEditor.cxx:480
TGMsgBox
Definition: TGMsgBox.h:63
FontStruct_t
Handle_t FontStruct_t
Definition: GuiTypes.h:38
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TGStatusBar.h
TRootGuiBuilder::CreatePopup
static TGPopupMenu * CreatePopup()
Return style popup menu.
Definition: TRootGuiBuilder.cxx:2303
TGCompositeFrame::SetEditable
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:933
TGHotString
Definition: TGString.h:52
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:37
TGuiBldDragManager::SetBuilder
void SetBuilder(TRootGuiBuilder *b)
Definition: TGuiBldDragManager.h:218
TGToolTip::GetText
const TGString * GetText() const
Get the tool tip text.
Definition: TGToolTip.cxx:427
TGWindow::kEditDisableLayout
@ kEditDisableLayout
Definition: TGWindow.h:61
TRootGuiBuilder::EnableEditButtons
void EnableEditButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
Definition: TRootGuiBuilder.cxx:1339
TGMenuEntry::GetEx
Int_t GetEx() const
Definition: TGMenu.h:103
TRootGuiBuilder::Update
virtual void Update()
Update gui builder.
Definition: TRootGuiBuilder.cxx:1385
TGMdiFrame::SetWindowName
void SetWindowName(const char *name)
Set MDI window name (set titlebar title).
Definition: TGMdiFrame.cxx:102
TGLabel
Definition: TGLabel.h:32
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
TRootGuiBuilder::ChangeSelected
virtual void ChangeSelected(TGFrame *f)
Set selected frame.
Definition: TRootGuiBuilder.cxx:1214
TGMdiMenuBar::GetMenuBar
TGMenuBar * GetMenuBar() const
Definition: TGMdiMenu.h:73
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
TGToolBar
Definition: TGToolBar.h:42
TGuiBldDragManager::IsPasteFrameExist
Bool_t IsPasteFrameExist()
Return kTRUE if paste frame exist.
Definition: TGuiBldDragManager.cxx:5788
GCValues_t
Definition: GuiTypes.h:223
TRootGuiBuilder::GetBgndGC
static TGGC * GetBgndGC()
Return background GC.
Definition: TRootGuiBuilder.cxx:2190
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TRootGuiBuilder::BuildListBox
static TGFrame * BuildListBox()
Helper method to create TGListBox widget.
Definition: TRootGuiBuilder.cxx:2475
TGWindow::kEditDisable
@ kEditDisable
Definition: TGWindow.h:58
TGuiBldEditor::SwitchLayout
void SwitchLayout()
Popup dialog to set layout of editted frame off.
Definition: TGuiBldEditor.cxx:495
TGMdiFrame::DontCallClose
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition: TGMdiFrame.cxx:85
gToolBarData
static ToolBarData_t gToolBarData[]
Definition: TRootGuiBuilder.cxx:191
kMenuSeparator
@ kMenuSeparator
Definition: TGMenu.h:47
Float_t
float Float_t
Definition: RtypesCore.h:57
TGTextButton
Definition: TGButton.h:142
kLeftAct
@ kLeftAct
Definition: TGuiBldDragManager.h:51
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TGClient::IsEditable
Bool_t IsEditable() const
Definition: TGClient.h:98
TRootGuiBuilder::FindEditableMdiFrame
TGMdiFrame * FindEditableMdiFrame(const TGWindow *win)
Find the editable frame.
Definition: TRootGuiBuilder.cxx:1738
gTQSender
R__EXTERN void * gTQSender
Definition: TQObject.h:44
kGrabAct
@ kGrabAct
Definition: TGuiBldDragManager.h:50
kUpAct
@ kUpAct
Definition: TGuiBldDragManager.h:51
gDragManager
R__EXTERN TVirtualDragManager * gDragManager
Definition: TVirtualDragManager.h:82
Int_t
int Int_t
Definition: RtypesCore.h:45
TRootGuiBuilder
Definition: TRootGuiBuilder.h:65
TRootGuiBuilder::IsGrabButtonDown
virtual Bool_t IsGrabButtonDown() const
Return the status of the grab mode.
Definition: TRootGuiBuilder.cxx:1435
TGFileInfo::SetIniDir
void SetIniDir(const char *inidir)
Set directory name.
Definition: TGFileDialog.cxx:115
TGListTree
Definition: TGListTree.h:210
TGVProgressBar
Definition: TGProgressBar.h:134
TGTextEdit.h
TGMenuEntry
Definition: TGMenu.h:69
TGMdiMainFrame::TileVertical
virtual void TileVertical()
Definition: TGMdiMainFrame.h:194
TImage
Definition: TImage.h:29
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
kMBYes
@ kMBYes
Definition: TGMsgBox.h:42
TGCompositeFrame::SetLayoutBroken
virtual void SetLayoutBroken(Bool_t on=kTRUE)
Set broken layout. No Layout method is called.
Definition: TGFrame.cxx:997
kMdiOpaque
@ kMdiOpaque
Definition: TGMdiMainFrame.h:76
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1007
TGMdiMainFrame::TileHorizontal
virtual void TileHorizontal()
Definition: TGMdiMainFrame.h:193
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:60
TGPicture::Draw
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:57
x
Double_t x[n]
Definition: legend1.C:17
TGDockableFrame.h
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TRootGuiBuilder::HandleMenu
virtual void HandleMenu(Int_t id)
Handle menu items.
Definition: TRootGuiBuilder.cxx:1783
TRootGuiBuilder::VSplitter
static TGFrame * VSplitter()
Create new vertical splitter (TGVSplitter).
Definition: TRootGuiBuilder.cxx:2102
TGToolTip
Definition: TGToolTip.h:35
TList::Last
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:692
gSaveMacroTypes
static const char * gSaveMacroTypes[]
Definition: TRootGuiBuilder.cxx:1453
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1749
TGStatusBar::SetText
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
Definition: TGStatusBar.cxx:144
TColor.h
TImage::GetHeight
virtual UInt_t GetHeight() const
Definition: TImage.h:229
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
kGUIBLD_FILE_START
@ kGUIBLD_FILE_START
Definition: TRootGuiBuilder.h:35
TVirtualX.h
TGProgressBar::kBlockFill
@ kBlockFill
Definition: TGProgressBar.h:41
TRootGuiBuilder::EnableSelectedButtons
void EnableSelectedButtons(Bool_t on=kTRUE)
Enable/disable toolbar buttons according to the selected frame.
Definition: TRootGuiBuilder.cxx:1267
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:309
gGuiBuilder
R__EXTERN TGuiBuilder * gGuiBuilder
Definition: TGuiBuilder.h:73
TGVertical3DLine
Definition: TG3DLine.h:44
TColor::Number2Pixel
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2013
kLayoutVAct
@ kLayoutVAct
Definition: TGuiBldDragManager.h:53
TGHorizontalFrame
Definition: TGFrame.h:423
TRootHelpDialog::SetText
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
Definition: TRootHelpDialog.cxx:76
TGFrame::GetBackground
virtual Pixel_t GetBackground() const
Definition: TGFrame.h:217
TGWindow::SetBackgroundPixmap
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
Definition: TGWindow.cxx:229
kReplaceAct
@ kReplaceAct
Definition: TGuiBldDragManager.h:51
TGListTree::AddItem
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Definition: TGListTree.cxx:1965
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TGMdi.h
TGPopupMenu::DrawEntry
virtual void DrawEntry(TGMenuEntry *entry)
Draw popup menu entry.
Definition: TGMenu.cxx:1505
TGPopupMenu::DisableEntry
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1723
kMenuActiveMask
@ kMenuActiveMask
Definition: TGMenu.h:41
TGMenuEntry::GetType
EMenuEntryType GetType() const
Definition: TGMenu.h:99
gHelpAboutBuilder
const char gHelpAboutBuilder[]
Definition: TRootGuiBuilder.cxx:177
kSaveAct
@ kSaveAct
Definition: TGuiBldDragManager.h:50
kSelectAct
@ kSelectAct
Definition: TGuiBldDragManager.h:54
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:720
TString
Definition: TString.h:136
kMBNo
@ kMBNo
Definition: TGMsgBox.h:43
TRootGuiBuilder::CloseWindow
virtual void CloseWindow()
Close GUI builder via window manager "Close" button.
Definition: TRootGuiBuilder.cxx:944
TGFrame
Definition: TGFrame.h:105
kNewAct
@ kNewAct
Definition: TGuiBldDragManager.h:52
TGeant4Unit::bar
static constexpr double bar
Definition: TGeant4SystemOfUnits.h:227
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGuiBldAction::fAct
TString fAct
Definition: TGuiBuilder.h:36
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
TGuiBldAction::fPic
const char * fPic
Definition: TGuiBuilder.h:37
TGPopupMenu::UnCheckEntry
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1806
EButtonState
EButtonState
Definition: TGButton.h:52
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
kGUIBLD_WINDOW_VERT
@ kGUIBLD_WINDOW_VERT
Definition: TRootGuiBuilder.h:42
TGClient::GetPicturePool
TGPicturePool * GetPicturePool() const
Definition: TGClient.h:135
text
TText * text
Definition: entrylist_figure1.C:10
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
b
#define b(i)
Definition: RSha256.hxx:118
TGToolBar.h
TGButton::fBgndColor
Pixel_t fBgndColor
Definition: TGButton.h:81
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:229
bool
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
TGCompositeFrame::fList
TList * fList
Definition: TGFrame.h:329
TGPopupMenu::AddEntry
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:989
kMdiNonOpaque
@ kMdiNonOpaque
Definition: TGMdiMainFrame.h:77
id
XFontStruct * id
Definition: TGX11.cxx:109
TGFileDialog.h
TGWindow::kEditDisableBtnEnable
@ kEditDisableBtnEnable
Definition: TGWindow.h:65
kKey_o
@ kKey_o
Definition: KeySymbols.h:178
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:119
kKey_Right
@ kKey_Right
Definition: KeySymbols.h:48
TImage.h
TGLayoutManager
Definition: TGLayout.h:142
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TRootGuiBuilder::HandleButtons
virtual void HandleButtons()
Handle buttons in the GUI builder's widget palette.
Definition: TRootGuiBuilder.cxx:1068
kGUIBLD_HELP_ABOUT
@ kGUIBLD_HELP_ABOUT
Definition: TRootGuiBuilder.h:48
TGShutter::AddPage
virtual TGShutterItem * AddPage(const char *item="Page")
Add new page (shutter item)
Definition: TGShutter.cxx:144
TROOT.h
kKey_b
@ kKey_b
Definition: KeySymbols.h:165
TGMenuEntry::GetPic
const TGPicture * GetPic() const
Definition: TGMenu.h:107
TGMenuEntry::GetShortcut
TGString * GetShortcut() const
Definition: TGMenu.h:102
TGStatusBar
Definition: TGStatusBar.h:29
TGuiBldEditor.h
gClient
#define gClient
Definition: TGClient.h:166
kLHintsBottom
@ kLHintsBottom
Definition: TGLayout.h:42
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
TGDockableFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *hints)
Add frame to dockable frame container. Frame and hints are NOT adopted.
Definition: TGDockableFrame.cxx:273
TGPopupMenu::EnableEntry
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition: TGMenu.cxx:1704
TRootGuiBuilder::fToolBar
TGToolBar * fToolBar
Definition: TRootGuiBuilder.h:72
TRootGuiBuilder::BuildTextEdit
static TGFrame * BuildTextEdit()
Helper method to create TGTextEdit widget.
Definition: TRootGuiBuilder.cxx:2441
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:324
TGPopupMenu::AddSeparator
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1059
TRootGuiBuilder::TGuiBldDragManager
friend class TGuiBldDragManager
Definition: TRootGuiBuilder.h:67
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:740
TGuiBldDragManager::HandleKey
Bool_t HandleKey(Event_t *)
Handle key event.
Definition: TGuiBldDragManager.cxx:2299
TGCompositeFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1028
TRootGuiBuilder::fToolDock
TGDockableFrame * fToolDock
Definition: TRootGuiBuilder.h:75
TGHotString::Draw
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw a hot string and underline the hot character.
Definition: TGString.cxx:170
TGMdiMainFrame::GetCurrent
TGMdiFrame * GetCurrent() const
Return pointer on current (active) MDI child window.
Definition: TGMdiMainFrame.cxx:1047
TGTextEdit
Definition: TGTextEdit.h:32
TGWindow::SetName
virtual void SetName(const char *name)
Definition: TGWindow.h:122
TGFileInfo::fOverwrite
Bool_t fOverwrite
Definition: TGFileDialog.h:65
kOpenAct
@ kOpenAct
Definition: TGuiBldDragManager.h:53
TG3DLine.h
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGHProgressBar
Definition: TGProgressBar.h:106
TGPicturePool::GetPicture
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:80
TRootGuiBuilder::SwitchToolbarButton
virtual void SwitchToolbarButton()
Switch image of toolbar edit button according to the current state.
Definition: TRootGuiBuilder.cxx:1756
kGUIBLD_WINDOW_ARRANGE
@ kGUIBLD_WINDOW_ARRANGE
Definition: TRootGuiBuilder.h:45
TGMainFrame::SetClassHints
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1817
TRootGuiBuilder::NewProject
virtual Bool_t NewProject(TString type="")
Create a new project.
Definition: TRootGuiBuilder.cxx:1491
TRootGuiBuilder::fgBgndPopupHlght
static TGGC * fgBgndPopupHlght
Definition: TRootGuiBuilder.h:92
kGUIBLD_FILE_CLOSE
@ kGUIBLD_FILE_CLOSE
Definition: TRootGuiBuilder.h:33
kLHintsNormal
@ kLHintsNormal
Definition: TGLayout.h:45
TGMenuTitle
Definition: TGMenu.h:248
kFixedHeight
@ kFixedHeight
Definition: GuiTypes.h:389
TGuiBldDragManager::SetEditable
void SetEditable(Bool_t on=kTRUE)
Grab server.
Definition: TGuiBldDragManager.cxx:4616
kKey_l
@ kKey_l
Definition: KeySymbols.h:175
TGMdiMainFrame::Cascade
virtual void Cascade()
Definition: TGMdiMainFrame.h:192
TRootGuiBuilder::FindActionButton
TGButton * FindActionButton(const char *name, const char *section)
Find action by name.
Definition: TRootGuiBuilder.cxx:978
TSystem.h
kMWMInputFullApplicationModal
@ kMWMInputFullApplicationModal
Definition: TGFrame.h:69
kGUIBLD_HELP_CONTENTS
@ kGUIBLD_HELP_CONTENTS
Definition: TRootGuiBuilder.h:47
kMenuLabel
@ kMenuLabel
Definition: TGMenu.h:48
TRootGuiBuilder::EnableLassoButtons
void EnableLassoButtons(Bool_t on=kTRUE)
Enable toolbar buttons for alignment.
Definition: TRootGuiBuilder.cxx:1223
TRootGuiBuilder::BuildH3DLine
static TGFrame * BuildH3DLine()
Helper method to create TGHorizontal3DLine widget.
Definition: TRootGuiBuilder.cxx:2520
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:41
h
#define h(i)
Definition: RSha256.hxx:124
kGKeyPress
@ kGKeyPress
Definition: GuiTypes.h:59
TImage::Scale
virtual void Scale(UInt_t, UInt_t)
Definition: TImage.h:141
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
TGVerticalFrame
Definition: TGFrame.h:412
kMenuEntry
@ kMenuEntry
Definition: TGMenu.h:49
kButtonEngaged
@ kButtonEngaged
Definition: TGButton.h:61
TGGC
Definition: TGGC.h:31
TGTab::AddTab
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:343
TGShutterItem
Definition: TGShutter.h:39
TRootGuiBuilder::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle keys.
Definition: TRootGuiBuilder.cxx:1462
kMenuEnableMask
@ kMenuEnableMask
Definition: TGMenu.h:42
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGHScrollBar
Definition: TGScrollBar.h:160
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
TGMdiFrame
Definition: TGMdiFrame.h:51
TRootGuiBuilder::SaveProject
virtual Bool_t SaveProject(Event_t *event=0)
Save selected project.
Definition: TRootGuiBuilder.cxx:1602
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:41
TGMdiMainFrame
Definition: TGMdiMainFrame.h:138
TRootGuiBuilder::fMenuFile
TGPopupMenu * fMenuFile
Definition: TRootGuiBuilder.h:78
TRootGuiBuilder::UpdateStatusBar
virtual void UpdateStatusBar(const char *text=0)
Update information shown on the status bar.
Definition: TRootGuiBuilder.cxx:1974
TRootGuiBuilder::GetPopupBgnd
static ULong_t GetPopupBgnd()
Return background color for popup menus.
Definition: TRootGuiBuilder.cxx:2227
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGMdiMainFrame::ArrangeMinimized
virtual void ArrangeMinimized()
This is an attempt to an "smart" minimized window re-arrangement.
Definition: TGMdiMainFrame.cxx:675
TRootGuiBuilder::fMain
TGMdiMainFrame * fMain
Definition: TRootGuiBuilder.h:74
TImage::GetMask
virtual Pixmap_t GetMask()
Definition: TImage.h:236
main
int main(int argc, char **argv)
Definition: histspeedtest.cxx:752
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:39
TRootGuiBuilder::fgBgndPopup
static TGGC * fgBgndPopup
Definition: TRootGuiBuilder.h:91
GCValues_t::fFont
FontH_t fFont
Definition: GuiTypes.h:241
TGFileInfo
Definition: TGFileDialog.h:54
TRootGuiBuilder::fStatusBar
TGStatusBar * fStatusBar
Definition: TRootGuiBuilder.h:82
TGLayoutHints
Definition: TGLayout.h:57
TRootHelpDialog.h
TRootGuiBuilder::AddAction
virtual void AddAction(TGuiBldAction *act, const char *sect)
Add new action to widget palette.
Definition: TRootGuiBuilder.cxx:1007
TRootGuiBuilder::BuildComboBox
static TGFrame * BuildComboBox()
Helper method to create TGComboBox widget.
Definition: TRootGuiBuilder.cxx:2496
TRootGuiBuilder::HandleWindowClosed
virtual void HandleWindowClosed(Int_t id)
Handler for closed MDI frame.
Definition: TRootGuiBuilder.cxx:1947
TGuiBldAction::fHints
TGLayoutHints * fHints
Definition: TGuiBuilder.h:39
TGMenuEntry::GetStatus
virtual Int_t GetStatus() const
Definition: TGMenu.h:98
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
TGDockableFrame
Definition: TGDockableFrame.h:93
TGTab
Definition: TGTab.h:62
kGCFont
const Mask_t kGCFont
Definition: GuiTypes.h:299
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
kKey_g
@ kKey_g
Definition: KeySymbols.h:170
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TGTab.h
TRootGuiBuilder::BuildTab
static TGFrame * BuildTab()
Helper method to create TGTab widget.
Definition: TRootGuiBuilder.cxx:2461
TRootGuiBuilder::AddSection
virtual void AddSection(const char *sect)
Add new shutter item.
Definition: TRootGuiBuilder.cxx:1056
TGButton::SetUserData
virtual void SetUserData(void *userData)
Definition: TGButton.h:107
TGComboBox::GetListBox
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
kGridAct
@ kGridAct
Definition: TGuiBldDragManager.h:52
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:44
TGTextLBEntry::GetDefaultFontStruct
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
Definition: TGListBox.cxx:190
TRootGuiBuilder::BuildListTree
static TGFrame * BuildListTree()
Helper method used in guibuilding.
Definition: TRootGuiBuilder.cxx:2311
kKey_n
@ kKey_n
Definition: KeySymbols.h:177
kGUIBLD_WINDOW_HOR
@ kGUIBLD_WINDOW_HOR
Definition: TRootGuiBuilder.h:41
kMenuDefaultMask
@ kMenuDefaultMask
Definition: TGMenu.h:43
KeySymbols.h
TGFrame::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *)
Definition: TGFrame.h:188
TGListBox.h
TGButton::GetUserData
virtual void * GetUserData() const
Definition: TGButton.h:108
kFDSave
@ kFDSave
Definition: TGFileDialog.h:45
TRootGuiBuilder::BuildVProgressBar
static TGFrame * BuildVProgressBar()
Helper method to create TGVProgressBar.
Definition: TRootGuiBuilder.cxx:2585
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:760
kGuiBldFunc
@ kGuiBldFunc
Definition: TGuiBuilder.h:32
TGCompositeFrame::SetLayoutManager
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:985
kKeyPressMask
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
gHelpBuilder
const char gHelpBuilder[]
Definition: TRootGuiBuilder.cxx:121
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGTileLayout
Definition: TGLayout.h:276
TGPopupMenu::CheckEntry
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1781
TRootGuiBuilder::InitMenu
void InitMenu()
Inititiate GUI Builder menus.
Definition: TRootGuiBuilder.cxx:1140
TRootGuiBuilder::GetPopupHlghtGC
static TGGC * GetPopupHlghtGC()
Return background GC for highlighted popup menu entry.
Definition: TRootGuiBuilder.cxx:2287
kBreakLayoutAct
@ kBreakLayoutAct
Definition: TGuiBldDragManager.h:52
unsigned int
kKey_r
@ kKey_r
Definition: KeySymbols.h:181
TRootGuiBuilder::fMenuBar
TGMdiMenuBar * fMenuBar
Definition: TRootGuiBuilder.h:77
TGComboBox
Definition: TGComboBox.h:67
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
TRootGuiBuilder::BuildShutter
static TGFrame * BuildShutter()
Helper method used in guibuilding to create TGShutter widget.
Definition: TRootGuiBuilder.cxx:2350
TGuiBldEditor
Definition: TGuiBldEditor.h:39
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
kKey_Return
@ kKey_Return
Definition: KeySymbols.h:36
TGProgressBar.h
kGuiBldCtor
@ kGuiBldCtor
Definition: TGuiBuilder.h:31
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
kKeyControlMask
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
TRootGuiBuilder::AddMacro
virtual void AddMacro(const char *macro, TImage *img)
Add macro to "User's Macros" section Input img must be static - do not delete it.
Definition: TRootGuiBuilder.cxx:1691
TGuiBldDragManager::SetPropertyEditor
void SetPropertyEditor(TGuiBldEditor *e)
Helper method.
Definition: TGuiBldDragManager.cxx:4882
TGMdiMainFrame::SetCurrent
Bool_t SetCurrent(TGMdiFrameList *newcurrent)
Set current (active) MDI child window (by frame list).
Definition: TGMdiMainFrame.cxx:329
TImage::GetWidth
virtual UInt_t GetWidth() const
Definition: TImage.h:228
TGLabel.h
TRootGuiBuilder::ExecuteAction
virtual TGFrame * ExecuteAction()
Execute an action.
Definition: TRootGuiBuilder.cxx:1099
kRedoAct
@ kRedoAct
Definition: TGuiBldDragManager.h:53
TGMenuEntry::GetEy
Int_t GetEy() const
Definition: TGMenu.h:104
kKey_v
@ kKey_v
Definition: KeySymbols.h:185
kKey_Left
@ kKey_Left
Definition: KeySymbols.h:46
TGFileInfo::fIniDir
char * fIniDir
Definition: TGFileDialog.h:62
TRootGuiBuilder::fMenuWindow
TGPopupMenu * fMenuWindow
Definition: TRootGuiBuilder.h:79
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:84
kKey_Enter
@ kKey_Enter
Definition: KeySymbols.h:37
TGButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:357
kGuiBldMacro
@ kGuiBldMacro
Definition: TGuiBuilder.h:32
TRootGuiBuilder::BuildCanvas
static TGFrame * BuildCanvas()
Helper method used in guibuilding to create TGCanvas widget.
Definition: TRootGuiBuilder.cxx:2329
TGFileInfo::fFileTypes
const char ** fFileTypes
Definition: TGFileDialog.h:63
TGHSplitter
Definition: TGSplitter.h:100
TRootGuiBuilder::BindKeys
void BindKeys()
Keyborad key binding.
Definition: TRootGuiBuilder.cxx:2006
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
kMenuRadioMask
@ kMenuRadioMask
Definition: TGMenu.h:45
kCutAct
@ kCutAct
Definition: TGuiBldDragManager.h:48
v1
@ v1
Definition: rootcling_impl.cxx:3637
TQObject::Connect
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:864
TGCompositeFrame::IsLayoutBroken
virtual Bool_t IsLayoutBroken() const
Definition: TGFrame.h:394
TRootGuiBuilder::fgBgnd
static TGGC * fgBgnd
Definition: TRootGuiBuilder.h:90
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
kGUIBLD_FILE_EXIT
@ kGUIBLD_FILE_EXIT
Definition: TRootGuiBuilder.h:34
kRightAct
@ kRightAct
Definition: TGuiBldDragManager.h:51
TGMdiMainFrame::GetContainer
TGFrame * GetContainer() const
Definition: TGMdiMainFrame.h:204
TGPictureButton
Definition: TGButton.h:228
ToolBarData_t
Definition: TGToolBar.h:32
TRootGuiBuilder::fClosing
Int_t fClosing
Definition: TRootGuiBuilder.h:88
TSystem::UnixPathName
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1061
kKey_z
@ kKey_z
Definition: KeySymbols.h:189
TGMsgBox.h
TGLabel::GetText
const TGString * GetText() const
Definition: TGLabel.h:82
GCValues_t::fMask
Mask_t fMask
Definition: GuiTypes.h:250
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGFrame::MoveResize
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:614
TGPicture::GetPicture
Pixmap_t GetPicture() const
Definition: TGPicture.h:65
TRootGuiBuilder::fIconPic
const TGPicture * fIconPic
Definition: TRootGuiBuilder.h:86
TGGC::SetBackground
void SetBackground(Pixel_t v)
Set background color.
Definition: TGGC.cxx:288
v2
@ v2
Definition: rootcling_impl.cxx:3638
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:277
TGuiBldAction
Definition: TGuiBuilder.h:32
kKey_h
@ kKey_h
Definition: KeySymbols.h:171
kMWMFuncAll
@ kMWMFuncAll
Definition: TGFrame.h:58
kKey_Backspace
@ kKey_Backspace
Definition: KeySymbols.h:35
TObject
Definition: TObject.h:37
TGuiBuilder::fAction
TGuiBldAction * fAction
Definition: TGuiBuilder.h:53
TRootGuiBuilder::GetPopupHlght
static ULong_t GetPopupHlght()
Return highlighted color for popup menu entry.
Definition: TRootGuiBuilder.cxx:2265
TGSplitter.h
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:114
TGToolTip.h
TRootGuiBuilder::fSelected
TGFrame * fSelected
Definition: TRootGuiBuilder.h:83
TGButton.h
kKey_Space
@ kKey_Space
Definition: KeySymbols.h:99
TGListTree.h
kMWMDecorAll
@ kMWMDecorAll
Definition: TGFrame.h:72
TGuiBldAction::fType
Int_t fType
Definition: TGuiBuilder.h:35
TGPopupMenu
Definition: TGMenu.h:123
TImage::GetPixmap
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
Event_t
Definition: GuiTypes.h:173
TGToolBar::AddButton
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:91
name
char name[80]
Definition: TGX11.cxx:110
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:51
TGString::Draw
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
Definition: TGString.cxx:51
kKey_a
@ kKey_a
Definition: KeySymbols.h:164
TGuiBldEditor::SetEmbedded
void SetEmbedded(Bool_t e=kTRUE)
Definition: TGuiBldEditor.h:71
TGCanvas::SetContainer
virtual void SetContainer(TGFrame *f)
Definition: TGCanvas.h:232
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:694
TGFrameElement
Definition: TGLayout.h:112
kCopyAct
@ kCopyAct
Definition: TGuiBldDragManager.h:48
kGUIBLD_WINDOW_OPAQUE
@ kGUIBLD_WINDOW_OPAQUE
Definition: TRootGuiBuilder.h:44
TRootGuiBuilder::MaybeCloseWindow
virtual void MaybeCloseWindow()
Handler before closing MDI frame.
Definition: TRootGuiBuilder.cxx:1919
TGMdiMainFrame::SetResizeMode
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set MDI windows resize mode (opaque or transparent).
Definition: TGMdiMainFrame.cxx:151
TRootGuiBuilder::BuildHProgressBar
static TGFrame * BuildHProgressBar()
Helper method to create TGHProgressBar.
Definition: TRootGuiBuilder.cxx:2570
TIter
Definition: TCollection.h:233
TRootGuiBuilder::BuildVScrollBar
static TGFrame * BuildVScrollBar()
Helper method to create TGVScrollBar.
Definition: TRootGuiBuilder.cxx:2556
TGFrame::GetDefaultSelectedBackground
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
Definition: TGFrame.cxx:681
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TGuiBldDragManager::UngrabFrame
void UngrabFrame()
Ungrab/Unselect selected/grabbed frame.
Definition: TGuiBldDragManager.cxx:1398
TGResourcePool.h
TImage::FromWindow
virtual void FromWindow(Drawable_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:244
kLayoutHAct
@ kLayoutHAct
Definition: TGuiBldDragManager.h:53
kDownAct
@ kDownAct
Definition: TGuiBldDragManager.h:51
TRootGuiBuilder::HSplitter
static TGFrame * HSplitter()
Creates new horizontal splitter (TGHSplitter).
Definition: TRootGuiBuilder.cxx:2131
TRootGuiBuilder::fShutter
TGShutter * fShutter
Definition: TRootGuiBuilder.h:73
TColor::RGB2Pixel
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
Definition: TColor.cxx:2051
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1057
TGuiBldAction::fPicture
const TGPicture * fPicture
Definition: TGuiBuilder.h:38
TGShutter
Definition: TGShutter.h:69
kGuiBldProj
@ kGuiBldProj
Definition: TGuiBuilder.h:31
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
TGMenuBar
Definition: TGMenu.h:304
kEnterWindowMask
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
type
int type
Definition: TGX11.cxx:121
TGButton
Definition: TGButton.h:68
TGCompositeFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
TGTextView::Layout
virtual void Layout()
Layout the components of view.
Definition: TGTextView.cxx:1328
TRootGuiBuilder::BuildHScrollBar
static TGFrame * BuildHScrollBar()
Helper method to create TGHScrollBar.
Definition: TRootGuiBuilder.cxx:2542
TGWindow::fEditDisabled
UInt_t fEditDisabled
Definition: TGWindow.h:40
kGUIBLD_FILE_STOP
@ kGUIBLD_FILE_STOP
Definition: TRootGuiBuilder.h:36
kMBRetry
@ kMBRetry
Definition: TGMsgBox.h:46
TRootGuiBuilder::EraseStatusBar
virtual void EraseStatusBar()
Clear information shown in the status bar.
Definition: TRootGuiBuilder.cxx:1996
kDropAct
@ kDropAct
Definition: TGuiBldDragManager.h:48
TGVSplitter
Definition: TGSplitter.h:63
kGUIBLD_FILE_NEW
@ kGUIBLD_FILE_NEW
Definition: TRootGuiBuilder.h:32
TRootGuiBuilder::fStartButton
TGPictureButton * fStartButton
Definition: TRootGuiBuilder.h:87
TGCanvas::GetViewPort
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:227
Class
void Class()
Definition: Class.C:29
kMenuCheckedMask
@ kMenuCheckedMask
Definition: TGMenu.h:44
TGListBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1212
TGCompositeFrame
Definition: TGFrame.h:324
TGClient::GetRoot
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:225
TGCanvas
Definition: TGCanvas.h:202
ROOT::Math::detail::sep
@ sep
Definition: GenVectorIO.h:55
TGuiBuilder
Definition: TGuiBuilder.h:50
TGPicture::GetHeight
UInt_t GetHeight() const
Definition: TGPicture.h:64
TGuiBldDragManager::IsLassoDrawn
Bool_t IsLassoDrawn() const
Definition: TGuiBldDragManager.h:192
splitter
REAL splitter
Definition: triangle.c:616
TGuiBldDragManager::GetSelected
TGFrame * GetSelected() const
Return the current grabbed/selected frame.
Definition: TGuiBldDragManager.cxx:5228
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1242
TGuiBldDragManager.h
kEndEditAct
@ kEndEditAct
Definition: TGuiBldDragManager.h:51
TRootGuiBuilder::TRootGuiBuilder
TRootGuiBuilder(const TGWindow *p=0)
Create GUI builder application.
Definition: TRootGuiBuilder.cxx:581
TRootGuiBuilder::fMenuHelp
TGPopupMenu * fMenuHelp
Definition: TRootGuiBuilder.h:81
kKeyShiftMask
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:62
TGToolBar::GetButton
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:156
TGMainFrame::HandleKey
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1567
TList
Definition: TList.h:44
kKey_c
@ kKey_c
Definition: KeySymbols.h:166
TGMainFrame::SetWMPosition
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1840
TRootGuiBuilder::fManager
TGuiBldDragManager * fManager
Definition: TRootGuiBuilder.h:70
kGUIBLD_FILE_OPEN
@ kGUIBLD_FILE_OPEN
Definition: TRootGuiBuilder.h:51
TRootGuiBuilder::fActionButton
TGButton * fActionButton
Definition: TRootGuiBuilder.h:71
TRootGuiBuilder.h
TGCanvas::MapSubwindows
virtual void MapSubwindows()
Map all canvas sub windows.
Definition: TGCanvas.cxx:2161
TRootHelpDialog
Definition: TRootHelpDialog.h:31
kMdiDefaultHints
@ kMdiDefaultHints
Definition: TGMdiMainFrame.h:66
TRootGuiBuilder::OpenProject
virtual Bool_t OpenProject(Event_t *event=0)
Open new gui builder project.
Definition: TRootGuiBuilder.cxx:1545
gROOT
#define gROOT
Definition: TROOT.h:406
TGMdiMainFrame::CloseAll
virtual void CloseAll()
Close all MDI child windows.
Definition: TGMdiMainFrame.cxx:1138
TGFileDialog
Definition: TGFileDialog.h:80
TGuiBldDragManager
Definition: TGuiBldDragManager.h:58
kFDOpen
@ kFDOpen
Definition: TGFileDialog.h:44
int
TGMenuEntry::GetLabel
TGHotString * GetLabel() const
Definition: TGMenu.h:101
TGFileInfo::fFilename
char * fFilename
Definition: TGFileDialog.h:61
TGMdiMenuBar
Definition: TGMdiMenu.h:53
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415
g
#define g(i)
Definition: RSha256.hxx:123