Logo ROOT  
Reference Guide
TGDockableFrame.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Abdelhalim Ssadik 07/07/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  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 
24 /** \class TGDockableFrame
25  \ingroup guiwidgets
26 
27 A frame with handles that allow it to be
28 undocked (i.e. put in a transient frame of its own) and to be docked
29 again or hidden and shown again. It uses the TGDockButton, which is
30 a button with two vertical bars (||) and TGDockHideButton, which is
31 a button with a small triangle. The TGUndockedFrame is a transient
32 frame that on closure will put the frame back in the dock.
33 
34 */
35 
36 
37 #include "TColor.h"
38 #include "TGFrame.h"
39 #include "TGWidget.h"
40 #include "TGButton.h"
41 #include "TGDockableFrame.h"
42 #include "TGWindow.h"
43 #include "TList.h"
44 #include "TVirtualX.h"
45 
46 #include <iostream>
47 
48 
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Create a dock button (i.e. button with two vertical bars).
56 
58  TGButton (p, id, GetDefaultGC()(), kChildFrame)
59 {
61  fMouseOn = kFALSE;
62  Resize(10, GetDefaultHeight());
63 
65 
66  Float_t r, g, b, h, l, s;
68  TColor::RGB2HLS(r, g, b, h, l, s);
69  l = l + (1. - l) * 45. / 100.;
70  TColor::HLS2RGB(h, l, s, r, g, b);
72 
74  SetWindowName();
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Delete dock button.
79 
81 {
82 }
83 
84 ////////////////////////////////////////////////////////////////////////////////
85 /// Handle dock button crossing events.
86 
88 {
90  if (event->fType == kLeaveNotify) {
91  fMouseOn = kFALSE;
92  } else if (event->fType == kEnterNotify) {
93  fMouseOn = kTRUE;
94  }
95  if (IsEnabled())
96  fClient->NeedRedraw(this);
97 
98  return kTRUE;
99 }
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// Draw borders of dock button.
103 
105 {
106  int options = GetOptions();
107 
109  ;
110  else if (fMouseOn == kTRUE && IsEnabled()) {
113  } else {
116  }
117  gVirtualX->ClearWindow(fId);
119 
120  ChangeOptions(options);
121 }
122 
123 ////////////////////////////////////////////////////////////////////////////////
124 /// Draw the dock button, i.e. two vertical lines.
125 
127 {
128  int x = 1, y = 0;
129 
130  DrawBorder();
131  if (fState == kButtonDown || fState == kButtonEngaged) { ++x; ++y; }
132 
133  for (int i = 0; i < 5; i +=4) {
134  gVirtualX->DrawLine(fId, GetHilightGC()(), i+x, y+1, i+x, fHeight-y-3);
135  gVirtualX->DrawLine(fId, GetShadowGC()(), i+x+1, y+1, i+x+1, fHeight-y-3);
136  }
137 }
138 
139 
140 ////////////////////////////////////////////////////////////////////////////////
141 /// Create a dock hide button (i.e. button with small triangle).
142 
144  TGDockButton (p, 2)
145 {
146  Resize(10, 8);
147  fAspectRatio = 0;
148  SetWindowName();
149 }
150 
151 ////////////////////////////////////////////////////////////////////////////////
152 /// Draw dock hide button.
153 
155 {
156  int x = 1, y = 0;
157 
158  DrawBorder();
159  if (fState == kButtonDown || fState == kButtonEngaged) { ++x; ++y; }
160 
161  if (fAspectRatio) {
162  gVirtualX->DrawLine(fId, GetBlackGC()(), x+1, y+1, x+5, y+3);
163  gVirtualX->DrawLine(fId, GetBlackGC()(), x+1, y+5, x+5, y+3);
164  gVirtualX->DrawLine(fId, GetHilightGC()(), x, y+1, x, y+5);
165  } else {
166  gVirtualX->DrawLine(fId, GetHilightGC()(), x+5, y+1, x+1, y+3);
167  gVirtualX->DrawLine(fId, GetHilightGC()(), x+5, y+5, x+1, y+3);
168  gVirtualX->DrawLine(fId, GetBlackGC()(), x+6, y+1, x+6, y+5);
169  }
170 }
171 
172 
173 ////////////////////////////////////////////////////////////////////////////////
174 /// Create the undocked (transient) frame.
175 
177  TGTransientFrame(p, dockable ? dockable->GetMainFrame() : 0, 10, 10)
178 {
179  SetWindowName("");
180  fDockable = dockable;
181 
187  SetWindowName();
188 }
189 
190 ////////////////////////////////////////////////////////////////////////////////
191 /// Delete undocked frame. Puts back dockable frame in its original container.
192 
194 {
195  if (fDockable && !fDockable->fDeleted) {
197  }
198 }
199 
200 ////////////////////////////////////////////////////////////////////////////////
201 /// Fix the size of the undocked frame so it cannot be changed via the WM.
202 
204 {
208 }
209 
210 ////////////////////////////////////////////////////////////////////////////////
211 /// Close undocked frame (called via WM close button).
212 
214 {
215  DeleteWindow();
216 }
217 
218 
219 ////////////////////////////////////////////////////////////////////////////////
220 /// Create a dockable frame widget.
221 
222 TGDockableFrame::TGDockableFrame(const TGWindow *p, int id, UInt_t /*options*/)
224 {
226 
229  fLb = new TGLayoutHints(kLHintsExpandY | kLHintsLeft, 0, 2, 0, 0);
231 
232  fButtons = new TGCompositeFrame(this, 10, 10, kVerticalFrame);
233  fButtons->SetCleanup();
238 
240 
241  fContainer = new TGCompositeFrame(this, 10, 10);
242 
244 
245  fEnableHide = kTRUE;
247  fHidden = kFALSE;
248  fFrame = 0;
249  fDeleted = kFALSE;
250  fFixedSize = kTRUE;
251 
252  fDockButton->Associate(this);
253  fHideButton->Associate(this);
254 
255  MapSubwindows();
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// Cleanup dockable frame.
262 
264 {
265  // Just set the flag and delete fFrame. The other components
266  // are deleted in TGCompositeFrame destructor.
267  if (fFrame) {
268  fDeleted = kTRUE;
269  delete fFrame;
270  }
271 }
272 
273 ////////////////////////////////////////////////////////////////////////////////
274 /// Add frame to dockable frame container. Frame and hints are NOT adopted.
275 
277 {
278  f->ReparentWindow(fContainer);
279  fContainer->AddFrame(f, fHints = hints);
280  fContainer->Layout();
281 }
282 
283 ////////////////////////////////////////////////////////////////////////////////
284 /// Undock container.
285 
287 {
288  int ax, ay;
289  Window_t wdummy;
290 
291  if (fFrame || !fEnableUndock) return;
292 
295 
300 
301  gVirtualX->TranslateCoordinates(GetId(), fClient->GetDefaultRoot()->GetId(), fX,
302  fY + fFrame->GetHeight(), ax, ay, wdummy);
303 
305 
307  fFrame->Resize(size);
308  if (fFixedSize)
309  fFrame->FixSize();
310  fFrame->MapWindow();
311  fFrame->Move(ax, ay);
312 
313  if (((TGFrame *)fParent)->IsComposite()) // paranoia check
314  ((TGCompositeFrame *)fParent)->HideFrame(this);
315 
316  Layout();
317 
319  Undocked();
320 }
321 
322 ////////////////////////////////////////////////////////////////////////////////
323 /// Dock container back to TGDockableFrame.
324 
326 {
327  if (!fFrame) return;
328  if (del) {
329  delete fFrame; // this will call DockContainer again with del = kFALSE
330  return;
331  }
332 
334  fContainer->ReparentWindow(this);
336 
337  // kludge! (for special case)
339 
340  Layout();
341  if (((TGFrame *)fParent)->IsComposite()) // paranoia check
342  ((TGCompositeFrame *)fParent)->ShowFrame(this);
343 
344  // fFrame is just being deleted (we're here called by TGUndockedFrame's
345  // destructor) so just set it NULL below to avoid eventual problems in
346  // TGDockableFrame's destructor.
347 
348  fFrame = 0;
349 
351  Docked();
352 }
353 
354 ////////////////////////////////////////////////////////////////////////////////
355 /// Show dock container.
356 
358 {
359  if (!fHidden) return;
360 
364  if (((TGFrame *)fParent)->IsComposite()) // paranoia check
365  ((TGCompositeFrame *)fParent)->Layout();
366  fHidden = kFALSE;
367 
369 }
370 
371 ////////////////////////////////////////////////////////////////////////////////
372 /// Hide dock container.
373 
375 {
376  if (fHidden || !fEnableHide) return;
377 
381  if (((TGFrame *)fParent)->IsComposite()) // paranoia check
382  ((TGCompositeFrame *)fParent)->Layout();
383  fHidden = kTRUE;
384 
386 }
387 
388 ////////////////////////////////////////////////////////////////////////////////
389 /// Process dockable frame messages.
390 
392 {
393  switch (GET_MSG(msg)) {
394  case kC_COMMAND:
395  switch (GET_SUBMSG(msg)) {
396  case kCM_BUTTON:
397  switch (parm1) {
398  case 1:
399  if (!fHidden) UndockContainer();
400  break;
401  case 2:
402  if (!fHidden)
403  HideContainer();
404  else
405  ShowContainer();
406  break;
407  }
408  break;
409  }
410  break;
411  }
412 
413  return kTRUE;
414 }
415 
416 ////////////////////////////////////////////////////////////////////////////////
417 /// Enable undocking.
418 
420 {
421  fEnableUndock = onoff;
422  if (onoff)
424  else
426  Layout();
427 }
428 
429 ////////////////////////////////////////////////////////////////////////////////
430 /// Enable hiding.
431 
433 {
434  fEnableHide = onoff;
435  if (onoff)
437  else
439  Layout();
440 }
441 
442 ////////////////////////////////////////////////////////////////////////////////
443 /// Set window name so it appear as title of the undock window.
444 
446 {
447  fDockName = "";
448  if (name) {
449  fDockName = name;
451  }
452 }
453 
454 ////////////////////////////////////////////////////////////////////////////////
455 /// Save a dockable frame widget as a C++ statement(s) on output stream out.
456 
457 void TGDockableFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
458 {
459  char quote = '"';
460 
461  out << std::endl << " // dockable frame" << std::endl;
462  out << " TGDockableFrame *";
463  out << GetName()<<" = new TGDockableFrame(" << fParent->GetName();
464 
465  if (GetOptions() == kHorizontalFrame) {
466  if (fWidgetId == -1) {
467  out << ");" << std::endl;
468  } else {
469  out << "," << fWidgetId << ");" << std::endl;
470  }
471  } else {
472  out << "," << fWidgetId << "," << GetOptionString() << ");" << std::endl;
473  }
474  if (option && strstr(option, "keep_names"))
475  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
476 
477  if (GetContainer()->GetList()->First()) {
478  out << " TGCompositeFrame *" << GetContainer()->GetName() << " = "
479  << GetName() << "->GetContainer();" << std::endl;
480 
481  TGFrameElement *el;
482  TIter next(GetContainer()->GetList());
483 
484  while ((el = (TGFrameElement *) next())) {
485  el->fFrame->SavePrimitive(out, option);
486  out << " " << GetName() << "->AddFrame(" << el->fFrame->GetName();
487  el->fLayout->SavePrimitive(out, option);
488  out << ");"<< std::endl;
489  }
490  }
491  out << std::endl << " // next lines belong to the dockable frame widget" << std::endl;
492  if (EnableUndock())
493  out << " " << GetName() << "->EnableUndock(kTRUE);" << std::endl;
494  else
495  out << " " << GetName() << "->EnableUndock(kFALSE);" << std::endl;
496 
497  if (EnableHide())
498  out << " " << GetName() << "->EnableHide(kTRUE);" << std::endl;
499  else
500  out << " " << GetName() << "->EnableHide(kFALSE);" << std::endl;
501 
502  if (fDockName != "")
503  out << " " << GetName() << "->SetWindowName(" << quote << fDockName
504  << quote << ");" << std::endl;
505 
506  if (IsUndocked())
507  out << " " << GetName() << "->UndockContainer();" << std::endl;
508  else
509  out << " " << GetName() << "->DockContainer();" << std::endl;
510 
511  if (IsHidden())
512  out << " " << GetName() << "->HideContainer();" << std::endl;
513 
514  out << std::endl;
515 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
l
auto * l
Definition: textangle.C:4
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:236
TGTransientFrame
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:498
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:110
TGFrame::fY
Int_t fY
frame y position
Definition: TGFrame.h:86
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
TGDockableFrame::~TGDockableFrame
virtual ~TGDockableFrame()
Cleanup dockable frame.
Definition: TGDockableFrame.cxx:263
TGFrameElement::fLayout
TGLayoutHints * fLayout
Definition: TGLayout.h:114
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:310
TGDockButton::~TGDockButton
virtual ~TGDockButton()
Delete dock button.
Definition: TGDockableFrame.cxx:80
TGDockableFrame::UndockContainer
void UndockContainer()
Undock container.
Definition: TGDockableFrame.cxx:286
TGDockableFrame::fLb
TGLayoutHints * fLb
Definition: TGDockableFrame.h:102
TGFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:321
f
#define f(i)
Definition: RSha256.hxx:104
TGDockableFrame::fDeleted
Bool_t fDeleted
kTRUE if it is being deleted
Definition: TGDockableFrame.h:93
TGDimension
Definition: TGDimension.h:18
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
Option_t
const char Option_t
Definition: RtypesCore.h:66
kLeaveNotify
@ kLeaveNotify
Definition: GuiTypes.h:61
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TGDockHideButton::SetAspectRatio
void SetAspectRatio(Int_t a)
Definition: TGDockableFrame.h:56
TGDockButton::DrawBorder
virtual void DrawBorder()
Draw borders of dock button.
Definition: TGDockableFrame.cxx:104
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
TGDockableFrame::SetWindowName
void SetWindowName(const char *name)
Set window name so it appear as title of the undock window.
Definition: TGDockableFrame.cxx:445
TGFrame::GetSize
TGDimension GetSize() const
Definition: TGFrame.h:230
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
TGUndockedFrame::~TGUndockedFrame
virtual ~TGUndockedFrame()
Delete undocked frame. Puts back dockable frame in its original container.
Definition: TGDockableFrame.cxx:193
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
kDOCK_HIDE
@ kDOCK_HIDE
Definition: WidgetMessageTypes.h:90
kDOCK_DOCK
@ kDOCK_DOCK
Definition: WidgetMessageTypes.h:87
r
ROOT::R::TRInterface & r
Definition: Object.C:4
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
TGDockButton::fHiBg
ULong_t fHiBg
highlighted background color
Definition: TGDockableFrame.h:32
TGDockableFrame::fFrame
TGUndockedFrame * fFrame
undocked frame
Definition: TGDockableFrame.h:100
TGDockHideButton
Definition: TGDockableFrame.h:47
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:191
TGDockableFrame::TGUndockedFrame
friend class TGUndockedFrame
Definition: TGDockableFrame.h:83
TGFrame::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a frame widget as a C++ statement(s) on output stream out.
Definition: TGFrame.cxx:3207
TGMainFrame::SetWMSizeHints
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1880
TGDockableFrame::fDockName
TString fDockName
name of frame
Definition: TGDockableFrame.h:95
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGDockableFrame::Docked
virtual void Docked()
Definition: TGDockableFrame.h:112
TGWidget
The widget base class.
Definition: TGWidget.h:43
TGDockableFrame::fButtons
TGCompositeFrame * fButtons
container containing dock and hide buttons
Definition: TGDockableFrame.h:97
TGDockButton::TGDockButton
TGDockButton(const TGCompositeFrame *p=nullptr, Int_t id=1)
Create a dock button (i.e. button with two vertical bars).
Definition: TGDockableFrame.cxx:57
TGDockableFrame::fHints
TGLayoutHints * fHints
layout hints
Definition: TGDockableFrame.h:101
kDOCK_UNDOCK
@ kDOCK_UNDOCK
Definition: WidgetMessageTypes.h:88
TGCompositeFrame::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1022
event
Definition: triangle.c:553
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:61
x
Double_t x[n]
Definition: legend1.C:17
TGDockableFrame::TGDockableFrame
TGDockableFrame(const TGDockableFrame &)=delete
TGCompositeFrame::IsComposite
Bool_t IsComposite() const
Definition: TGFrame.h:353
TGDockableFrame.h
TGDockableFrame::fEnableHide
Bool_t fEnableHide
if frame can be hidden
Definition: TGDockableFrame.h:91
TList.h
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TColor.h
TVirtualX.h
TGDockButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle dock button crossing events.
Definition: TGDockableFrame.cxx:87
TGDockableFrame::IsHidden
Bool_t IsHidden() const
Definition: TGDockableFrame.h:129
TGDockHideButton::DoRedraw
virtual void DoRedraw()
Draw dock hide button.
Definition: TGDockableFrame.cxx:154
TGDockableFrame::fFixedSize
Bool_t fFixedSize
kTRUE if fixed size when undocked
Definition: TGDockableFrame.h:94
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
TGFrame::DrawBorder
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:421
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
TGUndockedFrame::TGUndockedFrame
TGUndockedFrame(const TGUndockedFrame &)=delete
kMWMFuncMinimize
@ kMWMFuncMinimize
Definition: TGFrame.h:52
TGDockableFrame::Undocked
virtual void Undocked()
Definition: TGDockableFrame.h:113
b
#define b(i)
Definition: RSha256.hxx:100
TGWindow.h
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
bool
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:168
id
XFontStruct * id
Definition: TGX11.cxx:109
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:112
kMWMDecorMenu
@ kMWMDecorMenu
Definition: TGFrame.h:67
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
kMWMInputModeless
@ kMWMInputModeless
Definition: TGFrame.h:57
kMWMDecorResizeH
@ kMWMDecorResizeH
Definition: TGFrame.h:65
TGDockableFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *hints)
Add frame to dockable frame container. Frame and hints are NOT adopted.
Definition: TGDockableFrame.cxx:276
TGDockableFrame::fLc
TGLayoutHints * fLc
layout hints
Definition: TGDockableFrame.h:102
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
TGCompositeFrame::ChangeOptions
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1043
TGUndockedFrame::CloseWindow
void CloseWindow()
Close undocked frame (called via WM close button).
Definition: TGDockableFrame.cxx:213
TColor::Pixel2RGB
static void Pixel2RGB(ULong_t pixel, Int_t &r, Int_t &g, Int_t &b)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
Definition: TColor.cxx:2098
TGDockableFrame::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a dockable frame widget as a C++ statement(s) on output stream out.
Definition: TGDockableFrame.cxx:457
TGDockableFrame::fEnableUndock
Bool_t fEnableUndock
if frame can be undocked
Definition: TGDockableFrame.h:92
h
#define h(i)
Definition: RSha256.hxx:106
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
window which handles widget events
Definition: TGWidget.h:48
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
kButtonEngaged
@ kButtonEngaged
Definition: TGButton.h:55
TGFrame::ReparentWindow
virtual void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0)
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition: TGFrame.h:202
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
TGDockableFrame::EnableHide
Bool_t EnableHide() const
Definition: TGDockableFrame.h:124
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGWidget::fWidgetFlags
Int_t fWidgetFlags
widget status flags (OR of EWidgetStatus)
Definition: TGWidget.h:47
TGCompositeFrame::HideFrame
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1190
TGFrame.h
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:37
kCM_BUTTON
@ kCM_BUTTON
Definition: WidgetMessageTypes.h:34
Long_t
long Long_t
Definition: RtypesCore.h:54
TGWidget::IsEnabled
Bool_t IsEnabled() const
Definition: TGWidget.h:69
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGDockButton::fNormBg
ULong_t fNormBg
normal background color
Definition: TGDockableFrame.h:31
TGDockableFrame
A frame with handles that allow it to be undocked (i.e.
Definition: TGDockableFrame.h:82
Window_t
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
kFixedSize
@ kFixedSize
Definition: GuiTypes.h:390
y
Double_t y[n]
Definition: legend1.C:17
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:31
TGDockableFrame::GetContainer
TGCompositeFrame * GetContainer() const
Definition: TGDockableFrame.h:134
TGLayoutHints::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save layout hints as a C++ statement(s) on output stream out.
Definition: TGLayout.cxx:975
TGUndockedFrame
Definition: TGDockableFrame.h:62
TGCompositeFrame::RemoveFrame
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1149
TGWidget.h
unsigned int
TGFrame::fX
Int_t fX
frame x position
Definition: TGFrame.h:85
kDOCK_SHOW
@ kDOCK_SHOW
Definition: WidgetMessageTypes.h:89
TGDockableFrame::EnableUndock
Bool_t EnableUndock() const
Definition: TGDockableFrame.h:122
TGDockHideButton::TGDockHideButton
TGDockHideButton(const TGCompositeFrame *p=nullptr)
Create a dock hide button (i.e. button with small triangle).
Definition: TGDockableFrame.cxx:143
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGDockableFrame::ProcessMessage
virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t)
Process dockable frame messages.
Definition: TGDockableFrame.cxx:391
TGDockableFrame::fDockButton
TGDockButton * fDockButton
dock button
Definition: TGDockableFrame.h:98
TGMainFrame::SetWMSize
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
Definition: TGFrame.cxx:1867
TGWidget::fWidgetId
Int_t fWidgetId
the widget id (used for event processing)
Definition: TGWidget.h:46
TGButton::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGButton.cxx:404
TGDockHideButton::fAspectRatio
Int_t fAspectRatio
triangle orientation
Definition: TGDockableFrame.h:49
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
TGDockableFrame::DockContainer
void DockContainer(Int_t del=kTRUE)
Dock container back to TGDockableFrame.
Definition: TGDockableFrame.cxx:325
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
kC_COMMAND
@ kC_COMMAND
Definition: WidgetMessageTypes.h:31
TGFrame::Move
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:593
kC_DOCK
@ kC_DOCK
Definition: WidgetMessageTypes.h:86
TGMainFrame::SetMWMHints
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
Definition: TGFrame.cxx:1842
TGDockableFrame::ShowContainer
void ShowContainer()
Show dock container.
Definition: TGDockableFrame.cxx:357
kMWMFuncAll
@ kMWMFuncAll
Definition: TGFrame.h:49
TGButton.h
kMWMDecorAll
@ kMWMDecorAll
Definition: TGFrame.h:63
TGButton::fState
EButtonState fState
button state
Definition: TGButton.h:75
Event_t
Event structure.
Definition: GuiTypes.h:174
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:111
TGDockableFrame::HideContainer
void HideContainer()
Hide dock container.
Definition: TGDockableFrame.cxx:374
name
char name[80]
Definition: TGX11.cxx:110
TGFrameElement
Definition: TGLayout.h:105
TGUndockedFrame::FixSize
void FixSize()
Fix the size of the undocked frame so it cannot be changed via the WM.
Definition: TGDockableFrame.cxx:203
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
TGDockableFrame::fContainer
TGCompositeFrame * fContainer
container containing dockable frame
Definition: TGDockableFrame.h:96
kMWMDecorMaximize
@ kMWMDecorMaximize
Definition: TGFrame.h:69
TIter
Definition: TCollection.h:233
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)=delete
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:2060
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1072
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TGFrame::fBackground
Pixel_t fBackground
frame background color
Definition: TGFrame.h:95
kMWMFuncResize
@ kMWMFuncResize
Definition: TGFrame.h:50
kEnterWindowMask
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:167
TGButton
A button abstract base class.
Definition: TGButton.h:68
TColor::RGB2HLS
static void RGB2HLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
Static method to compute HLS from RGB.
Definition: TColor.cxx:1603
TGUndockedFrame::fDockable
TGDockableFrame * fDockable
orignal dockable frame
Definition: TGDockableFrame.h:69
TGDockButton::DoRedraw
virtual void DoRedraw()
Draw the dock button, i.e. two vertical lines.
Definition: TGDockableFrame.cxx:126
kMWMFuncMaximize
@ kMWMFuncMaximize
Definition: TGFrame.h:53
TGDockButton
Definition: TGDockableFrame.h:28
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGDockableFrame::fHidden
Bool_t fHidden
if frame is hidden
Definition: TGDockableFrame.h:90
kMWMDecorMinimize
@ kMWMDecorMinimize
Definition: TGFrame.h:68
TGDockableFrame::fHideButton
TGDockHideButton * fHideButton
hide button
Definition: TGDockableFrame.h:99
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:190
TColor::HLS2RGB
static void HLS2RGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
Static method to compute RGB from HLS.
Definition: TColor.cxx:1463
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
TGDockButton::fMouseOn
Bool_t fMouseOn
true when mouse on button
Definition: TGDockableFrame.h:30
TGCompositeFrame::ShowFrame
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1204
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:108
TGDockableFrame::IsUndocked
Bool_t IsUndocked() const
Definition: TGDockableFrame.h:128
TGWindow::fParent
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
g
#define g(i)
Definition: RSha256.hxx:105