Logo ROOT  
Reference Guide
TGSplitFrame.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Bertrand Bellenot 23/01/2008
3
4/*************************************************************************
5 * Copyright (C) 1995-2008, 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#include "TGFrame.h"
13#include "TGLayout.h"
14#include "TGMenu.h"
15#include "TGSplitter.h"
16#include "TGSplitFrame.h"
17#include "TGInputDialog.h"
18#include "TGResourcePool.h"
19#include "TRootContextMenu.h"
20#include "TClassMenuItem.h"
21#include "TContextMenu.h"
22#include "TString.h"
23#include "TClass.h"
24#include "TList.h"
25#include "Riostream.h"
26#include "TVirtualX.h"
27
28
31
32////////////////////////////////////////////////////////////////////////////////
33/// Create a split frame tool tip. P is the tool tips parent window (normally
34/// fClient->GetRoot() and f is the frame to which the tool tip is associated.
35
38{
42 attr.fSaveUnder = kTRUE;
43
44 gVirtualX->ChangeWindowAttributes(fId, &attr);
46
48 fRectGC.SetForeground(0x99ff99);
49
50 TClass *cl = TClass::GetClass("TGSplitFrame");
52 TList *ml = cl->GetMenuList();
53 ((TClassMenuItem *)ml->At(1))->SetTitle("Cleanup Frame");
54 ((TClassMenuItem *)ml->At(2))->SetTitle("Close and Collapse");
55 ((TClassMenuItem *)ml->At(3))->SetTitle("Undock Frame");
56 ((TClassMenuItem *)ml->At(4))->SetTitle("Dock Frame Back");
57 ((TClassMenuItem *)ml->At(5))->SetTitle("Switch to Main");
58 ((TClassMenuItem *)ml->At(6))->SetTitle("Horizontally Split...");
59 ((TClassMenuItem *)ml->At(7))->SetTitle("Vertically Split...");
60 fContextMenu = new TContextMenu("SplitFrameContextMenu", "Actions");
64 if (f) Resize(f->GetWidth()/10, f->GetHeight()/10);
66
67 fWindow = f;
68 fX = fY = -1;
69}
70
71////////////////////////////////////////////////////////////////////////////////
72/// TGSplitTool destructor.
73
75{
76 delete fContextMenu;
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// Add a rectangle representation of a split frame in the map, together
81/// with the frame itself.
82
84{
85 TGRectMap *rect = new TGRectMap(x, y, w, h);
86 fMap.Add(rect, frame);
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Redraw split frame tool.
91
93{
94 TGRectMap *rect;
95 TMapIter next(&fMap);
96 while ((rect = (TGRectMap*)next())) {
97 gVirtualX->FillRectangle(fId, GetBckgndGC()(), rect->fX,
98 rect->fY, rect->fW, rect->fH);
99 gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY,
100 rect->fW, rect->fH);
101 }
102 DrawBorder();
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Draw border of tool window.
107
109{
110 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
111 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
112 gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
113 gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
114}
115
116////////////////////////////////////////////////////////////////////////////////
117/// Handle mouse click events in the tool.
118
120{
121 if (event->fType != kButtonPress)
122 return kTRUE;
123 Int_t px = 0, py = 0;
124 Window_t wtarget;
125 TGRectMap *rect;
126 TGSplitFrame *frm = 0;
127 TMapIter next(&fMap);
128 while ((rect = (TGRectMap*)next())) {
129 if (rect->Contains(event->fX, event->fY)) {
130 frm = (TGSplitFrame *)fMap.GetValue((const TObject *)rect);
131 gVirtualX->TranslateCoordinates(event->fWindow,
132 gClient->GetDefaultRoot()->GetId(),
133 event->fX, event->fY, px, py, wtarget);
134 fContextMenu->Popup(px, py, frm);
135 // connect PoppedDown signal to close the tool window
136 // when the menu is closed
138 ((TGPopupMenu *)menu)->Connect("PoppedDown()", "TGSplitTool", this, "Hide()");
139 return kTRUE;
140 }
141 }
142 Hide();
143 return kTRUE;
144}
145
146////////////////////////////////////////////////////////////////////////////////
147/// handle mouse motion events
148
150{
151 static TGRectMap *rect = 0, *oldrect = 0;
152 TMapIter next(&fMap);
153 while ((rect = (TGRectMap*)next())) {
154 if (rect->Contains(event->fX, event->fY)) {
155 // if inside a rectangle, highlight it
156 if (rect != oldrect) {
157 if (oldrect) {
158 gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX,
159 oldrect->fY, oldrect->fW, oldrect->fH);
160 gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY,
161 oldrect->fW, oldrect->fH);
162 }
163 gVirtualX->FillRectangle(fId, fRectGC(), rect->fX, rect->fY, rect->fW,
164 rect->fH);
165 gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY,
166 rect->fW, rect->fH);
167 oldrect = rect;
168 }
169 return kTRUE;
170 }
171 }
172 if (oldrect) {
173 gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX,
174 oldrect->fY, oldrect->fW, oldrect->fH);
175 gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY,
176 oldrect->fW, oldrect->fH);
177 }
178 return kTRUE;
179}
180////////////////////////////////////////////////////////////////////////////////
181/// Hide tool window. Use this method to hide the tool in a client class.
182
184{
185 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
186 fMap.Delete();
187 UnmapWindow();
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Reset tool tip popup delay timer. Use this method to activate tool tip
192/// in a client class.
193
195{
196 fMap.Delete();
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Set popup position within specified frame (as specified in the ctor).
201/// To get back default behaviour (in the middle just below the designated
202/// frame) set position to -1,-1.
203
205{
206 fX = x;
207 fY = y;
208
209 if (fX < -1)
210 fX = 0;
211 if (fY < -1)
212 fY = 0;
213
214 if (fWindow) {
215 if (fX > (Int_t) fWindow->GetWidth())
216 fX = fWindow->GetWidth();
217 if (fY > (Int_t) fWindow->GetHeight())
218 fY = fWindow->GetHeight();
219 }
220}
221
222////////////////////////////////////////////////////////////////////////////////
223/// Show tool window.
224
226{
227 Move(x, y);
228 MapWindow();
229 RaiseWindow();
230
231 // last argument kFALSE forces all specified events to this window
234 kTRUE, kFALSE);
235 // Long_t args[2];
236 // args[0] = x;
237 // args[1] = y;
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Default constructor.
242
244 UInt_t options) : TGCompositeFrame(p, w, h, options),
245 fFrame(0), fSplitter(0), fFirst(0), fSecond(0)
246{
247 fSplitTool = new TGSplitTool(gClient->GetDefaultRoot(), this);
248 fHRatio = fWRatio = 0.0;
249 fUndocked = 0;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Destructor. Make cleanup.
256
258{
259 delete fSplitTool;
260 Cleanup();
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Add a frame in the split frame using layout hints l.
265
267{
269 fFrame = f;
270}
271
272////////////////////////////////////////////////////////////////////////////////
273/// Add a frame in the split frame using layout hints l.
274
276{
278 if (f == fFrame)
279 fFrame = 0;
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Recursively cleanup child frames.
284
286{
288 fFirst = 0;
289 fSecond = 0;
290 fSplitter = 0;
291 fUndocked = 0;
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// Return the top level split frame.
296
298{
299 TGSplitFrame *top = this;
300 TGWindow *w = (TGWindow *)GetParent();
301 TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
302 while (p) {
303 top = p;
304 w = (TGWindow *)p->GetParent();
305 p = dynamic_cast<TGSplitFrame *>(w);
306 }
307 return top;
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Close (unmap and remove from the list of frames) the frame contained in
312/// this split frame.
313
315{
316 if (fFrame) {
319 }
320 fFrame = 0;
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// Close (unmap, remove from the list of frames and destroy) the frame
325/// contained in this split frame. Then unsplit the parent frame.
326
328{
329 if (!fSplitter || !fFirst || !fSecond) {
330 TGSplitFrame *parent = (TGSplitFrame *)GetParent();
331 if (parent->GetFirst() && parent->GetSecond()) {
332 if (parent->GetFirst() == this)
333 parent->UnSplit("first");
334 else if (parent->GetSecond() == this)
335 parent->UnSplit("second");
336 }
337 }
338}
339////////////////////////////////////////////////////////////////////////////////
340/// Emit Undocked() signal.
341
343{
344 Emit("Docked(TGFrame*)", (Long_t)frame);
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Extract the frame contained in this split frame an reparent it in a
349/// transient frame. Keep a pointer on the transient frame to be able to
350/// swallow the child frame back to this.
351
353{
354 if (fFrame) {
356 fUndocked = new TGTransientFrame(gClient->GetDefaultRoot(), GetMainFrame(), 800, 600);
359 // Layout...
361 fUndocked->Layout();
364 fUndocked->Connect("CloseWindow()", "TGSplitFrame", this, "SwallowBack()");
366 }
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Handles resize events for this frame.
371/// This is needed to keep as much as possible the sizes ratio between
372/// all subframes.
373
375{
376 if (!fFirst) {
377 // case of resizing a frame with the splitter (and not from parent)
378 TGWindow *w = (TGWindow *)GetParent();
379 TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
380 if (p) {
381 if (p->GetFirst()) {
382 // set the correct ratio for this child
383 Float_t hratio = (Float_t)p->GetFirst()->GetHeight() / (Float_t)p->GetHeight();
384 Float_t wratio = (Float_t)p->GetFirst()->GetWidth() / (Float_t)p->GetWidth();
385 p->SetHRatio(hratio);
386 p->SetWRatio(wratio);
387 }
388 }
389 return kTRUE;
390 }
391 // case of resize event comes from the parent (i.e. by rezing TGMainFrame)
392 if ((fHRatio > 0.0) && (fWRatio > 0.0)) {
397 }
398 // memorize the actual ratio for next resize event
401 fClient->NeedRedraw(this);
402 if (!gVirtualX->InheritsFrom("TGX11"))
403 Layout();
404 return kTRUE;
405}
406
407////////////////////////////////////////////////////////////////////////////////
408/// Horizontally split the frame.
409
411{
412 // return if already split
413 if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
414 return;
415 UInt_t height = (h > 0) ? h : fHeight/2;
416 // set correct option (vertical frame)
418 // create first split frame with fixed height - required for the splitter
419 fFirst = new TGSplitFrame(this, fWidth, height, kSunkenFrame | kFixedHeight);
420 // create second split frame
421 fSecond = new TGSplitFrame(this, fWidth, height, kSunkenFrame);
422 // create horizontal splitter
423 fSplitter = new TGHSplitter(this, 4, 4);
424 // set the splitter's frame to the first one
426 fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this,
427 "OnSplitterClicked(Event_t*)");
428 // add all frames
434}
435
436////////////////////////////////////////////////////////////////////////////////
437/// Vertically split the frame.
438
440{
441 // return if already split
442 if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
443 return;
444 UInt_t width = (w > 0) ? w : fWidth/2;
445 // set correct option (horizontal frame)
447 // create first split frame with fixed width - required for the splitter
449 // create second split frame
451 // create vertical splitter
452 fSplitter = new TGVSplitter(this, 4, 4);
453 // set the splitter's frame to the first one
455 fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this,
456 "OnSplitterClicked(Event_t*)");
457 // add all frames
463}
464
465////////////////////////////////////////////////////////////////////////////////
466/// Map this split frame in the small overview tooltip.
467
469{
470 Int_t px = 0, py = 0;
471 Int_t rx = 0, ry = 0;
472 Int_t cx, cy, cw, ch;
473 Window_t wtarget;
474 if (!fFirst && !fSecond) {
475 TGSplitFrame *parent = dynamic_cast<TGSplitFrame *>((TGFrame *)fParent);
476 if (parent && parent->fSecond == this) {
477 if (parent->GetOptions() & kVerticalFrame)
478 ry = parent->GetFirst()->GetHeight();
479 if (parent->GetOptions() & kHorizontalFrame)
480 rx = parent->GetFirst()->GetWidth();
481 }
482 gVirtualX->TranslateCoordinates(GetId(), top->GetId(),
483 fX, fY, px, py, wtarget);
484 cx = ((px-rx)/10)+2;
485 cy = ((py-ry)/10)+2;
486 cw = (fWidth/10)-4;
487 ch = (fHeight/10)-4;
488 top->GetSplitTool()->AddRectangle(this, cx, cy, cw, ch);
489 return;
490 }
491 if (fFirst)
493 if (fSecond)
495}
496
497////////////////////////////////////////////////////////////////////////////////
498/// Handle mouse click events on the splitter.
499
501{
502 Int_t px = 0, py = 0;
503 Window_t wtarget;
504 if (event->fType != kButtonPress)
505 return;
506 if (event->fCode != kButton3)
507 return;
508 gVirtualX->TranslateCoordinates(event->fWindow,
509 gClient->GetDefaultRoot()->GetId(),
510 event->fX, event->fY, px, py, wtarget);
511 TGSplitFrame *top = GetTopFrame();
512 top->GetSplitTool()->Reset();
513 top->GetSplitTool()->Resize(1+top->GetWidth()/10, 1+top->GetHeight()/10);
514 top->MapToSPlitTool(top);
515 top->GetSplitTool()->Show(px, py);
516}
517
518////////////////////////////////////////////////////////////////////////////////
519/// Horizontally split the frame, and if it contains a child frame, ask
520/// the user where to keep it (top or bottom). This is the method used
521/// via the context menu.
522
524{
525 char side[200];
526 snprintf(side, 200, "top");
527 if (fFrame) {
528 new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
529 "In which side the actual frame has to be kept (top / bottom)",
530 side, side);
531 if ( strcmp(side, "") == 0 ) // Cancel button was pressed
532 return;
533 }
534 SplitHorizontal(side);
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Horizontally split the frame, and if it contains a child frame, ask
539/// the user where to keep it (top or bottom). This method is the actual
540/// implementation.
541
542void TGSplitFrame::SplitHorizontal(const char *side)
543{
544 if (fFrame) {
545 TGFrame *frame = fFrame;
546 frame->UnmapWindow();
547 frame->ReparentWindow(gClient->GetDefaultRoot());
549 HSplit();
550 if (!strcmp(side, "top")) {
551 frame->ReparentWindow(GetFirst());
553 }
554 else if (!strcmp(side, "bottom")) {
555 frame->ReparentWindow(GetSecond());
557 }
558 }
559 else {
560 HSplit();
561 }
563 Layout();
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Vertically split the frame, and if it contains a child frame, ask
568/// the user where to keep it (left or right). This is the method used
569/// via the context menu.
570
572{
573 char side[200];
574 snprintf(side, 200, "left");
575 if (fFrame) {
576 new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
577 "In which side the actual frame has to be kept (left / right)",
578 side, side);
579 if ( strcmp(side, "") == 0 ) // Cancel button was pressed
580 return;
581 }
582 SplitVertical(side);
583}
584
585////////////////////////////////////////////////////////////////////////////////
586/// Vertically split the frame, and if it contains a child frame, ask
587/// the user where to keep it (left or right). This method is the actual
588/// implementation.
589
590void TGSplitFrame::SplitVertical(const char *side)
591{
592 if (fFrame) {
593 TGFrame *frame = fFrame;
594 frame->UnmapWindow();
595 frame->ReparentWindow(gClient->GetDefaultRoot());
597 VSplit();
598 if (!strcmp(side, "left")) {
599 frame->ReparentWindow(GetFirst());
601 }
602 else if (!strcmp(side, "right")) {
603 frame->ReparentWindow(GetSecond());
605 }
606 }
607 else {
608 VSplit();
609 }
611 Layout();
612}
613
614////////////////////////////////////////////////////////////////////////////////
615/// Swallow back the child frame previously extracted, and close its
616/// parent (transient frame).
617
619{
620 if (!fUndocked) {
621 fUndocked = dynamic_cast<TGTransientFrame *>((TQObject*)gTQSender);
622 }
623 if (fUndocked) {
624 TGFrameElement *el = dynamic_cast<TGFrameElement*>(fUndocked->GetList()->First());
625 if (!el || !el->fFrame) return;
626 TGSplitFrame *frame = (TGSplitFrame *)el->fFrame;
627 frame->UnmapWindow();
628 fUndocked->RemoveFrame(frame);
629 frame->ReparentWindow(this);
631 // Layout...
633 Layout();
635 fUndocked = 0;
636 Docked(frame);
637 }
638}
639
640////////////////////////////////////////////////////////////////////////////////
641/// Switch (exchange) two frames.
642/// frame is the source, dest is the destination (the new parent)
643/// prev is the frame that has to be exchanged with the source
644/// (the one actually in the destination)
645
647 TGFrame *prev)
648{
649 // get parent of the source (its container)
650 TGCompositeFrame *parent = (TGCompositeFrame *)frame->GetParent();
651
652 // unmap the window (to avoid flickering)
653 prev->UnmapWindow();
654 // remove it from the destination frame
655 dest->RemoveFrame(prev);
656 // temporary reparent it to root (desktop window)
657 prev->ReparentWindow(gClient->GetDefaultRoot());
658
659 // now unmap the source window (still to avoid flickering)
660 frame->UnmapWindow();
661 // remove it from its parent (its container)
662 parent->RemoveFrame(frame);
663 // reparent it to the target location
664 frame->ReparentWindow(dest);
665 // add it to its new parent (for layout managment)
666 dest->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
667 // Layout...
668 frame->Resize(dest->GetDefaultSize());
669 dest->MapSubwindows();
670 dest->Layout();
671
672 // now put back the previous one in the previous source parent
673 // reparent to the previous source container
674 prev->ReparentWindow(parent);
675 // add it to the frame (for layout managment)
677 // Layout...
678 prev->Resize(parent->GetDefaultSize());
679 parent->MapSubwindows();
680 parent->Layout();
681}
682
683////////////////////////////////////////////////////////////////////////////////
684/// Switch the actual embedded frame to the main (first) split frame.
685
687{
688 TGFrame *source = fFrame;
690 TGFrame *prev = (TGFrame *)(dest->GetFrame());
691 if ((source != prev) && (source != dest))
692 SwitchFrames(source, dest, prev);
693}
694
695////////////////////////////////////////////////////////////////////////////////
696/// Emit Undocked() signal.
697
699{
700 Emit("Undocked(TGFrame*)", (Long_t)frame);
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Close (unmap and remove from the list of frames) the frame contained in
705/// this split frame.
706
707void TGSplitFrame::UnSplit(const char *which)
708{
709 TGCompositeFrame *keepframe = 0;
710 TGSplitFrame *kframe = 0, *dframe = 0;
711 if (!strcmp(which, "first")) {
712 dframe = GetFirst();
713 kframe = GetSecond();
714 }
715 else if (!strcmp(which, "second")) {
716 dframe = GetSecond();
717 kframe = GetFirst();
718 }
719 if (!kframe || !dframe)
720 return;
721 keepframe = (TGCompositeFrame *)kframe->GetFrame();
722 if (keepframe) {
723 keepframe->UnmapWindow();
724 keepframe->ReparentWindow(gClient->GetDefaultRoot());
725 kframe->RemoveFrame(keepframe);
726 }
727 Cleanup();
728 if (keepframe) {
729 keepframe->ReparentWindow(this);
731 }
733 Layout();
734}
735
736////////////////////////////////////////////////////////////////////////////////
737/// Save a splittable frame as a C++ statement(s) on output stream out.
738
739void TGSplitFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
740{
742
743 out << std::endl << " // splittable frame" << std::endl;
744 out << " TGSplitFrame *";
745 out << GetName() << " = new TGSplitFrame(" << fParent->GetName()
746 << "," << GetWidth() << "," << GetHeight();
747
749 if (!GetOptions()) {
750 out << ");" << std::endl;
751 } else {
752 out << "," << GetOptionString() <<");" << std::endl;
753 }
754 } else {
755 out << "," << GetOptionString() << ",ucolor);" << std::endl;
756 }
757 if (option && strstr(option, "keep_names"))
758 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
759
760 // setting layout manager if it differs from the main frame type
761 // coverity[returned_null]
762 // coverity[dereference]
764 if ((GetOptions() & kHorizontalFrame) &&
766 ;
767 } else if ((GetOptions() & kVerticalFrame) &&
769 ;
770 } else {
771 out << " " << GetName() <<"->SetLayoutManager(";
772 lm->SavePrimitive(out, option);
773 out << ");"<< std::endl;
774 }
775
776 SavePrimitiveSubframes(out, option);
777}
void Class()
Definition: Class.C:29
@ kButtonPress
Definition: GuiTypes.h:59
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:148
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
const Mask_t kWASaveUnder
Definition: GuiTypes.h:149
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
@ kRaisedFrame
Definition: GuiTypes.h:384
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedHeight
Definition: GuiTypes.h:389
@ kFixedSize
Definition: GuiTypes.h:390
const Handle_t kNone
Definition: GuiTypes.h:87
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
@ kFillSolid
Definition: GuiTypes.h:50
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
@ kButton3
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
@ kLocalCleanup
Definition: TGFrame.h:50
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
R__EXTERN void * gTQSender
Definition: TQObject.h:44
#define gVirtualX
Definition: TVirtualX.h:338
T1 fFirst
Definition: X11Events.mm:86
T2 fSecond
Definition: X11Events.mm:87
#define snprintf
Definition: civetweb.c:1540
Describes one element of the context menu associated to a class The menu item may describe.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition: TClass.cxx:4304
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition: TClass.cxx:4246
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2948
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
virtual TContextMenuImp * GetContextMenuImp()
Definition: TContextMenu.h:83
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual TGLayoutManager * GetLayoutManager() const
Definition: TGFrame.h:375
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SavePrimitiveSubframes(std::ostream &out, Option_t *option="")
Auxilary protected method used to save subframes.
Definition: TGFrame.cxx:2625
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:1027
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
TGFrame * fFrame
Definition: TGLayout.h:119
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:323
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:719
Int_t fX
Definition: TGFrame.h:110
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:227
UInt_t fHeight
Definition: TGFrame.h:113
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:667
virtual UInt_t GetOptions() const
Definition: TGFrame.h:222
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2464
Int_t fY
Definition: TGFrame.h:111
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:749
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:577
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t fWidth
Definition: TGFrame.h:112
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:271
virtual void MapWindow()
map window
Definition: TGFrame.h:229
UInt_t GetWidth() const
Definition: TGFrame.h:249
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2437
virtual void SetHeight(UInt_t h)
Definition: TGFrame.h:272
Pixel_t fBackground
Definition: TGFrame.h:120
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:759
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition: TGGC.cxx:343
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:276
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1730
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
UInt_t fH
Definition: TGSplitFrame.h:32
Int_t fX
Definition: TGSplitFrame.h:29
Bool_t Contains(Int_t px, Int_t py) const
Definition: TGSplitFrame.h:40
UInt_t fW
Definition: TGSplitFrame.h:31
Int_t fY
Definition: TGSplitFrame.h:30
Pixel_t GetTipBgndColor() const
Cursor_t GetGrabCursor() const
void MapToSPlitTool(TGSplitFrame *top)
Map this split frame in the small overview tooltip.
virtual void Cleanup()
Recursively cleanup child frames.
virtual void VSplit(UInt_t w=0)
Vertically split the frame.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a splittable frame as a C++ statement(s) on output stream out.
TGSplitFrame * GetFirst() const
Definition: TGSplitFrame.h:105
void OnSplitterClicked(Event_t *event)
Handle mouse click events on the splitter.
virtual ~TGSplitFrame()
Destructor. Make cleanup.
void SplitVertical(const char *side="left")
Vertically split the frame, and if it contains a child frame, ask the user where to keep it (left or ...
void SwitchToMain()
Switch the actual embedded frame to the main (first) split frame.
void SetHRatio(Float_t r)
Definition: TGSplitFrame.h:116
TGSplitFrame * fSecond
Definition: TGSplitFrame.h:88
TGSplitTool * GetSplitTool() const
Definition: TGSplitFrame.h:109
virtual void RemoveFrame(TGFrame *f)
Add a frame in the split frame using layout hints l.
virtual void HSplit(UInt_t h=0)
Horizontally split the frame.
TGSplitFrame * GetTopFrame()
Return the top level split frame.
void SetWRatio(Float_t r)
Definition: TGSplitFrame.h:117
void SwallowBack()
Swallow back the child frame previously extracted, and close its parent (transient frame).
TGFrame * GetFrame() const
Definition: TGSplitFrame.h:106
TGSplitTool * fSplitTool
Definition: TGSplitFrame.h:89
TGTransientFrame * fUndocked
Definition: TGSplitFrame.h:85
TGSplitter * fSplitter
Definition: TGSplitFrame.h:86
TGSplitFrame(const TGSplitFrame &)
void Docked(TGFrame *frame)
Emit Undocked() signal.
void Undocked(TGFrame *frame)
Emit Undocked() signal.
TGFrame * fFrame
Definition: TGSplitFrame.h:84
static void SwitchFrames(TGFrame *frame, TGCompositeFrame *dest, TGFrame *prev)
Switch (exchange) two frames.
void Close()
Close (unmap and remove from the list of frames) the frame contained in this split frame.
TGSplitFrame * fFirst
Definition: TGSplitFrame.h:87
virtual Bool_t HandleConfigureNotify(Event_t *)
Handles resize events for this frame.
Float_t fHRatio
Definition: TGSplitFrame.h:91
void SplitHorizontal(const char *side="top")
Horizontally split the frame, and if it contains a child frame, ask the user where to keep it (top or...
Float_t fWRatio
Definition: TGSplitFrame.h:90
TGSplitFrame * GetSecond() const
Definition: TGSplitFrame.h:107
void ExtractFrame()
Extract the frame contained in this split frame an reparent it in a transient frame.
void SplitVer()
Vertically split the frame, and if it contains a child frame, ask the user where to keep it (left or ...
void UnSplit(const char *which)
Close (unmap and remove from the list of frames) the frame contained in this split frame.
void CloseAndCollapse()
Close (unmap, remove from the list of frames and destroy) the frame contained in this split frame.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add a frame in the split frame using layout hints l.
void SplitHor()
Horizontally split the frame, and if it contains a child frame, ask the user where to keep it (top or...
Bool_t HandleMotion(Event_t *event)
handle mouse motion events
void Show(Int_t x, Int_t y)
Show tool window.
virtual ~TGSplitTool()
TGSplitTool destructor.
void AddRectangle(TGFrame *frm, Int_t x, Int_t y, Int_t w, Int_t h)
Add a rectangle representation of a split frame in the map, together with the frame itself.
void DrawBorder()
Draw border of tool window.
void SetPosition(Int_t x, Int_t y)
Set popup position within specified frame (as specified in the ctor).
void DoRedraw()
Redraw split frame tool.
void Reset()
Reset tool tip popup delay timer.
const TGFrame * fWindow
Definition: TGSplitFrame.h:50
TGSplitTool(const TGSplitTool &)
Bool_t HandleButton(Event_t *event)
Handle mouse click events in the tool.
void Hide()
Hide tool window. Use this method to hide the tool in a client class.
TContextMenu * fContextMenu
Definition: TGSplitFrame.h:53
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:142
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:326
const TGWindow * fParent
Definition: TGWindow.h:36
const TGWindow * GetParent() const
Definition: TGWindow.h:84
virtual void RaiseWindow()
raise window
Definition: TGWindow.cxx:198
A doubly linked list.
Definition: TList.h:44
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:356
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
Iterator of map.
Definition: TMap.h:147
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition: TMap.cxx:54
void Delete(Option_t *option="")
Remove all (key,value) pairs from the map AND delete the keys when they are allocated on the heap.
Definition: TMap.cxx:134
virtual void SetOwnerValue(Bool_t enable=kTRUE)
Set whether this map is the owner (enable==true) of its values.
Definition: TMap.cxx:341
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
Mother of all ROOT objects.
Definition: TObject.h:37
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TObject.cxx:664
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:48
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
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:866
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
Window_t fWindow
Definition: GuiTypes.h:175
Int_t fX
Definition: GuiTypes.h:177
UInt_t fCode
Definition: GuiTypes.h:179
Bool_t fOverrideRedirect
Definition: GuiTypes.h:106
auto * l
Definition: textangle.C:4
#define dest(otri, vertexptr)
Definition: triangle.c:1040