Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TVirtualX.h"
26#include "snprintf.h"
27
28#include <iostream>
29
30
33
34////////////////////////////////////////////////////////////////////////////////
35/// Create a split frame tool tip. P is the tool tips parent window (normally
36/// fClient->GetRoot() and f is the frame to which the tool tip is associated.
37
40{
44 attr.fSaveUnder = kTRUE;
45
46 gVirtualX->ChangeWindowAttributes(fId, &attr);
48
50 fRectGC.SetForeground(0x99ff99);
51
52 TClass *cl = TClass::GetClass("TGSplitFrame");
54 TList *ml = cl->GetMenuList();
55 ((TClassMenuItem *)ml->At(1))->SetTitle("Cleanup Frame");
56 ((TClassMenuItem *)ml->At(2))->SetTitle("Close and Collapse");
57 ((TClassMenuItem *)ml->At(3))->SetTitle("Undock Frame");
58 ((TClassMenuItem *)ml->At(4))->SetTitle("Dock Frame Back");
59 ((TClassMenuItem *)ml->At(5))->SetTitle("Switch to Main");
60 ((TClassMenuItem *)ml->At(6))->SetTitle("Horizontally Split...");
61 ((TClassMenuItem *)ml->At(7))->SetTitle("Vertically Split...");
62 fContextMenu = new TContextMenu("SplitFrameContextMenu", "Actions");
66 if (f) Resize(f->GetWidth()/10, f->GetHeight()/10);
68
69 fWindow = f;
70 fX = fY = -1;
71}
72
73////////////////////////////////////////////////////////////////////////////////
74/// TGSplitTool destructor.
75
77{
78 delete fContextMenu;
79}
80
81////////////////////////////////////////////////////////////////////////////////
82/// Add a rectangle representation of a split frame in the map, together
83/// with the frame itself.
84
86{
87 TGRectMap *rect = new TGRectMap(x, y, w, h);
88 fMap.Add(rect, frame);
89}
90
91////////////////////////////////////////////////////////////////////////////////
92/// Redraw split frame tool.
93
95{
96 TGRectMap *rect;
97 TMapIter next(&fMap);
98 while ((rect = (TGRectMap*)next())) {
99 gVirtualX->FillRectangle(fId, GetBckgndGC()(), rect->fX,
100 rect->fY, rect->fW, rect->fH);
101 gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY,
102 rect->fW, rect->fH);
103 }
104 DrawBorder();
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Draw border of tool window.
109
111{
112 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
113 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
114 gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
115 gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
116}
117
118////////////////////////////////////////////////////////////////////////////////
119/// Handle mouse click events in the tool.
120
122{
123 if (event->fType != kButtonPress)
124 return kTRUE;
125 Int_t px = 0, py = 0;
126 Window_t wtarget;
127 TGRectMap *rect;
128 TGSplitFrame *frm = 0;
129 TMapIter next(&fMap);
130 while ((rect = (TGRectMap*)next())) {
131 if (rect->Contains(event->fX, event->fY)) {
132 frm = (TGSplitFrame *)fMap.GetValue((const TObject *)rect);
133 gVirtualX->TranslateCoordinates(event->fWindow,
134 gClient->GetDefaultRoot()->GetId(),
135 event->fX, event->fY, px, py, wtarget);
136 fContextMenu->Popup(px, py, frm);
137 // connect PoppedDown signal to close the tool window
138 // when the menu is closed
140 ((TGPopupMenu *)menu)->Connect("PoppedDown()", "TGSplitTool", this, "Hide()");
141 return kTRUE;
142 }
143 }
144 Hide();
145 return kTRUE;
146}
147
148////////////////////////////////////////////////////////////////////////////////
149/// handle mouse motion events
150
152{
153 static TGRectMap *rect = 0, *oldrect = 0;
154 TMapIter next(&fMap);
155 while ((rect = (TGRectMap*)next())) {
156 if (rect->Contains(event->fX, event->fY)) {
157 // if inside a rectangle, highlight it
158 if (rect != oldrect) {
159 if (oldrect) {
160 gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX,
161 oldrect->fY, oldrect->fW, oldrect->fH);
162 gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY,
163 oldrect->fW, oldrect->fH);
164 }
165 gVirtualX->FillRectangle(fId, fRectGC(), rect->fX, rect->fY, rect->fW,
166 rect->fH);
167 gVirtualX->DrawRectangle(fId, GetBlackGC()(), rect->fX, rect->fY,
168 rect->fW, rect->fH);
169 oldrect = rect;
170 }
171 return kTRUE;
172 }
173 }
174 if (oldrect) {
175 gVirtualX->FillRectangle(fId, GetBckgndGC()(), oldrect->fX,
176 oldrect->fY, oldrect->fW, oldrect->fH);
177 gVirtualX->DrawRectangle(fId, GetBlackGC()(), oldrect->fX, oldrect->fY,
178 oldrect->fW, oldrect->fH);
179 }
180 return kTRUE;
181}
182////////////////////////////////////////////////////////////////////////////////
183/// Hide tool window. Use this method to hide the tool in a client class.
184
186{
187 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
188 fMap.Delete();
189 UnmapWindow();
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// Reset tool tip popup delay timer. Use this method to activate tool tip
194/// in a client class.
195
197{
198 fMap.Delete();
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Set popup position within specified frame (as specified in the ctor).
203/// To get back default behaviour (in the middle just below the designated
204/// frame) set position to -1,-1.
205
207{
208 fX = x;
209 fY = y;
210
211 if (fX < -1)
212 fX = 0;
213 if (fY < -1)
214 fY = 0;
215
216 if (fWindow) {
217 if (fX > (Int_t) fWindow->GetWidth())
218 fX = fWindow->GetWidth();
219 if (fY > (Int_t) fWindow->GetHeight())
220 fY = fWindow->GetHeight();
221 }
222}
223
224////////////////////////////////////////////////////////////////////////////////
225/// Show tool window.
226
228{
229 Move(x, y);
230 MapWindow();
231 RaiseWindow();
232
233 // last argument kFALSE forces all specified events to this window
236 kTRUE, kFALSE);
237 // Long_t args[2];
238 // args[0] = x;
239 // args[1] = y;
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Default constructor.
244
246 UInt_t options) : TGCompositeFrame(p, w, h, options),
247 fFrame(0), fSplitter(0), fFirst(0), fSecond(0)
248{
249 fSplitTool = new TGSplitTool(gClient->GetDefaultRoot(), this);
250 fHRatio = fWRatio = 0.0;
251 fUndocked = 0;
254}
255
256////////////////////////////////////////////////////////////////////////////////
257/// Destructor. Make cleanup.
258
260{
261 delete fSplitTool;
262 Cleanup();
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Add a frame in the split frame using layout hints l.
267
269{
271 fFrame = f;
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// Add a frame in the split frame using layout hints l.
276
278{
280 if (f == fFrame)
281 fFrame = 0;
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Recursively cleanup child frames.
286
288{
290 fFirst = 0;
291 fSecond = 0;
292 fSplitter = 0;
293 fUndocked = 0;
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Return the top level split frame.
298
300{
301 TGSplitFrame *top = this;
302 TGWindow *w = (TGWindow *)GetParent();
303 TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
304 while (p) {
305 top = p;
306 w = (TGWindow *)p->GetParent();
307 p = dynamic_cast<TGSplitFrame *>(w);
308 }
309 return top;
310}
311
312////////////////////////////////////////////////////////////////////////////////
313/// Close (unmap and remove from the list of frames) the frame contained in
314/// this split frame.
315
317{
318 if (fFrame) {
321 }
322 fFrame = 0;
323}
324
325////////////////////////////////////////////////////////////////////////////////
326/// Close (unmap, remove from the list of frames and destroy) the frame
327/// contained in this split frame. Then unsplit the parent frame.
328
330{
331 if (!fSplitter || !fFirst || !fSecond) {
332 TGSplitFrame *parent = (TGSplitFrame *)GetParent();
333 if (parent->GetFirst() && parent->GetSecond()) {
334 if (parent->GetFirst() == this)
335 parent->UnSplit("first");
336 else if (parent->GetSecond() == this)
337 parent->UnSplit("second");
338 }
339 }
340}
341////////////////////////////////////////////////////////////////////////////////
342/// Emit Undocked() signal.
343
345{
346 Emit("Docked(TGFrame*)", (Long_t)frame);
347}
348
349////////////////////////////////////////////////////////////////////////////////
350/// Extract the frame contained in this split frame an reparent it in a
351/// transient frame. Keep a pointer on the transient frame to be able to
352/// swallow the child frame back to this.
353
355{
356 if (fFrame) {
358 fUndocked = new TGTransientFrame(gClient->GetDefaultRoot(), GetMainFrame(), 800, 600);
361 // Layout...
363 fUndocked->Layout();
366 fUndocked->Connect("CloseWindow()", "TGSplitFrame", this, "SwallowBack()");
368 }
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Handles resize events for this frame.
373/// This is needed to keep as much as possible the sizes ratio between
374/// all subframes.
375
377{
378 if (!fFirst) {
379 // case of resizing a frame with the splitter (and not from parent)
380 TGWindow *w = (TGWindow *)GetParent();
381 TGSplitFrame *p = dynamic_cast<TGSplitFrame *>(w);
382 if (p) {
383 if (p->GetFirst()) {
384 // set the correct ratio for this child
385 Float_t hratio = (Float_t)p->GetFirst()->GetHeight() / (Float_t)p->GetHeight();
386 Float_t wratio = (Float_t)p->GetFirst()->GetWidth() / (Float_t)p->GetWidth();
387 p->SetHRatio(hratio);
388 p->SetWRatio(wratio);
389 }
390 }
391 return kTRUE;
392 }
393 // case of resize event comes from the parent (i.e. by rezing TGMainFrame)
394 if ((fHRatio > 0.0) && (fWRatio > 0.0)) {
399 }
400 // memorize the actual ratio for next resize event
403 fClient->NeedRedraw(this);
404 if (!gVirtualX->InheritsFrom("TGX11"))
405 Layout();
406 return kTRUE;
407}
408
409////////////////////////////////////////////////////////////////////////////////
410/// Horizontally split the frame.
411
413{
414 // return if already split
415 if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
416 return;
417 UInt_t height = (h > 0) ? h : fHeight/2;
418 // set correct option (vertical frame)
420 // create first split frame with fixed height - required for the splitter
421 fFirst = new TGSplitFrame(this, fWidth, height, kSunkenFrame | kFixedHeight);
422 // create second split frame
423 fSecond = new TGSplitFrame(this, fWidth, height, kSunkenFrame);
424 // create horizontal splitter
425 fSplitter = new TGHSplitter(this, 4, 4);
426 // set the splitter's frame to the first one
428 fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this,
429 "OnSplitterClicked(Event_t*)");
430 // add all frames
436}
437
438////////////////////////////////////////////////////////////////////////////////
439/// Vertically split the frame.
440
442{
443 // return if already split
444 if ((fSplitter != 0) || (fFirst != 0) || (fSecond != 0) || (fFrame != 0))
445 return;
446 UInt_t width = (w > 0) ? w : fWidth/2;
447 // set correct option (horizontal frame)
449 // create first split frame with fixed width - required for the splitter
451 // create second split frame
453 // create vertical splitter
454 fSplitter = new TGVSplitter(this, 4, 4);
455 // set the splitter's frame to the first one
457 fSplitter->Connect("ProcessedEvent(Event_t*)", "TGSplitFrame", this,
458 "OnSplitterClicked(Event_t*)");
459 // add all frames
465}
466
467////////////////////////////////////////////////////////////////////////////////
468/// Map this split frame in the small overview tooltip.
469
471{
472 Int_t px = 0, py = 0;
473 Int_t rx = 0, ry = 0;
474 Int_t cx, cy, cw, ch;
475 Window_t wtarget;
476 if (!fFirst && !fSecond) {
477 TGSplitFrame *parent = dynamic_cast<TGSplitFrame *>((TGFrame *)fParent);
478 if (parent && parent->fSecond == this) {
479 if (parent->GetOptions() & kVerticalFrame)
480 ry = parent->GetFirst()->GetHeight();
481 if (parent->GetOptions() & kHorizontalFrame)
482 rx = parent->GetFirst()->GetWidth();
483 }
484 gVirtualX->TranslateCoordinates(GetId(), top->GetId(),
485 fX, fY, px, py, wtarget);
486 cx = ((px-rx)/10)+2;
487 cy = ((py-ry)/10)+2;
488 cw = (fWidth/10)-4;
489 ch = (fHeight/10)-4;
490 top->GetSplitTool()->AddRectangle(this, cx, cy, cw, ch);
491 return;
492 }
493 if (fFirst)
495 if (fSecond)
497}
498
499////////////////////////////////////////////////////////////////////////////////
500/// Handle mouse click events on the splitter.
501
503{
504 Int_t px = 0, py = 0;
505 Window_t wtarget;
506 if (event->fType != kButtonPress)
507 return;
508 if (event->fCode != kButton3)
509 return;
510 gVirtualX->TranslateCoordinates(event->fWindow,
511 gClient->GetDefaultRoot()->GetId(),
512 event->fX, event->fY, px, py, wtarget);
513 TGSplitFrame *top = GetTopFrame();
514 top->GetSplitTool()->Reset();
515 top->GetSplitTool()->Resize(1+top->GetWidth()/10, 1+top->GetHeight()/10);
516 top->MapToSPlitTool(top);
517 top->GetSplitTool()->Show(px, py);
518}
519
520////////////////////////////////////////////////////////////////////////////////
521/// Horizontally split the frame, and if it contains a child frame, ask
522/// the user where to keep it (top or bottom). This is the method used
523/// via the context menu.
524
526{
527 char side[200];
528 snprintf(side, 200, "top");
529 if (fFrame) {
530 new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
531 "In which side the actual frame has to be kept (top / bottom)",
532 side, side);
533 if ( strcmp(side, "") == 0 ) // Cancel button was pressed
534 return;
535 }
536 SplitHorizontal(side);
537}
538
539////////////////////////////////////////////////////////////////////////////////
540/// Horizontally split the frame, and if it contains a child frame, ask
541/// the user where to keep it (top or bottom). This method is the actual
542/// implementation.
543
544void TGSplitFrame::SplitHorizontal(const char *side)
545{
546 if (fFrame) {
547 TGFrame *frame = fFrame;
548 frame->UnmapWindow();
549 frame->ReparentWindow(gClient->GetDefaultRoot());
551 HSplit();
552 if (!strcmp(side, "top")) {
553 frame->ReparentWindow(GetFirst());
555 }
556 else if (!strcmp(side, "bottom")) {
557 frame->ReparentWindow(GetSecond());
559 }
560 }
561 else {
562 HSplit();
563 }
565 Layout();
566}
567
568////////////////////////////////////////////////////////////////////////////////
569/// Vertically split the frame, and if it contains a child frame, ask
570/// the user where to keep it (left or right). This is the method used
571/// via the context menu.
572
574{
575 char side[200];
576 snprintf(side, 200, "left");
577 if (fFrame) {
578 new TGInputDialog(gClient->GetRoot(), GetTopFrame(),
579 "In which side the actual frame has to be kept (left / right)",
580 side, side);
581 if ( strcmp(side, "") == 0 ) // Cancel button was pressed
582 return;
583 }
584 SplitVertical(side);
585}
586
587////////////////////////////////////////////////////////////////////////////////
588/// Vertically split the frame, and if it contains a child frame, ask
589/// the user where to keep it (left or right). This method is the actual
590/// implementation.
591
592void TGSplitFrame::SplitVertical(const char *side)
593{
594 if (fFrame) {
595 TGFrame *frame = fFrame;
596 frame->UnmapWindow();
597 frame->ReparentWindow(gClient->GetDefaultRoot());
599 VSplit();
600 if (!strcmp(side, "left")) {
601 frame->ReparentWindow(GetFirst());
603 }
604 else if (!strcmp(side, "right")) {
605 frame->ReparentWindow(GetSecond());
607 }
608 }
609 else {
610 VSplit();
611 }
613 Layout();
614}
615
616////////////////////////////////////////////////////////////////////////////////
617/// Swallow back the child frame previously extracted, and close its
618/// parent (transient frame).
619
621{
622 if (!fUndocked) {
623 fUndocked = dynamic_cast<TGTransientFrame *>((TQObject*)gTQSender);
624 }
625 if (fUndocked) {
626 TGFrameElement *el = dynamic_cast<TGFrameElement*>(fUndocked->GetList()->First());
627 if (!el || !el->fFrame) return;
628 TGSplitFrame *frame = (TGSplitFrame *)el->fFrame;
629 frame->UnmapWindow();
630 fUndocked->RemoveFrame(frame);
631 frame->ReparentWindow(this);
633 // Layout...
635 Layout();
637 fUndocked = 0;
638 Docked(frame);
639 }
640}
641
642////////////////////////////////////////////////////////////////////////////////
643/// Switch (exchange) two frames.
644/// frame is the source, dest is the destination (the new parent)
645/// prev is the frame that has to be exchanged with the source
646/// (the one actually in the destination)
647
649 TGFrame *prev)
650{
651 // get parent of the source (its container)
652 TGCompositeFrame *parent = (TGCompositeFrame *)frame->GetParent();
653
654 // unmap the window (to avoid flickering)
655 prev->UnmapWindow();
656 // remove it from the destination frame
657 dest->RemoveFrame(prev);
658 // temporary reparent it to root (desktop window)
659 prev->ReparentWindow(gClient->GetDefaultRoot());
660
661 // now unmap the source window (still to avoid flickering)
662 frame->UnmapWindow();
663 // remove it from its parent (its container)
664 parent->RemoveFrame(frame);
665 // reparent it to the target location
666 frame->ReparentWindow(dest);
667 // add it to its new parent (for layout managment)
668 dest->AddFrame(frame, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
669 // Layout...
670 frame->Resize(dest->GetDefaultSize());
671 dest->MapSubwindows();
672 dest->Layout();
673
674 // now put back the previous one in the previous source parent
675 // reparent to the previous source container
676 prev->ReparentWindow(parent);
677 // add it to the frame (for layout managment)
679 // Layout...
680 prev->Resize(parent->GetDefaultSize());
681 parent->MapSubwindows();
682 parent->Layout();
683}
684
685////////////////////////////////////////////////////////////////////////////////
686/// Switch the actual embedded frame to the main (first) split frame.
687
689{
690 TGFrame *source = fFrame;
692 TGFrame *prev = (TGFrame *)(dest->GetFrame());
693 if ((source != prev) && (source != dest))
694 SwitchFrames(source, dest, prev);
695}
696
697////////////////////////////////////////////////////////////////////////////////
698/// Emit Undocked() signal.
699
701{
702 Emit("Undocked(TGFrame*)", (Long_t)frame);
703}
704
705////////////////////////////////////////////////////////////////////////////////
706/// Close (unmap and remove from the list of frames) the frame contained in
707/// this split frame.
708
709void TGSplitFrame::UnSplit(const char *which)
710{
711 TGCompositeFrame *keepframe = 0;
712 TGSplitFrame *kframe = 0, *dframe = 0;
713 if (!strcmp(which, "first")) {
714 dframe = GetFirst();
715 kframe = GetSecond();
716 }
717 else if (!strcmp(which, "second")) {
718 dframe = GetSecond();
719 kframe = GetFirst();
720 }
721 if (!kframe || !dframe)
722 return;
723 keepframe = (TGCompositeFrame *)kframe->GetFrame();
724 if (keepframe) {
725 keepframe->UnmapWindow();
726 keepframe->ReparentWindow(gClient->GetDefaultRoot());
727 kframe->RemoveFrame(keepframe);
728 }
729 Cleanup();
730 if (keepframe) {
731 keepframe->ReparentWindow(this);
733 }
735 Layout();
736}
737
738////////////////////////////////////////////////////////////////////////////////
739/// Save a splittable frame as a C++ statement(s) on output stream out.
740
741void TGSplitFrame::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
742{
744
745 out << std::endl << " // splittable frame" << std::endl;
746 out << " TGSplitFrame *";
747 out << GetName() << " = new TGSplitFrame(" << fParent->GetName()
748 << "," << GetWidth() << "," << GetHeight();
749
751 if (!GetOptions()) {
752 out << ");" << std::endl;
753 } else {
754 out << "," << GetOptionString() <<");" << std::endl;
755 }
756 } else {
757 out << "," << GetOptionString() << ",ucolor);" << std::endl;
758 }
759 if (option && strstr(option, "keep_names"))
760 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
761
762 // setting layout manager if it differs from the main frame type
763 // coverity[returned_null]
764 // coverity[dereference]
766 if ((GetOptions() & kHorizontalFrame) &&
767 (lm->InheritsFrom(TGHorizontalLayout::Class()))) {
768 ;
769 } else if ((GetOptions() & kVerticalFrame) &&
770 (lm->InheritsFrom(TGVerticalLayout::Class()))) {
771 ;
772 } else {
773 out << " " << GetName() <<"->SetLayoutManager(";
774 lm->SavePrimitive(out, option);
775 out << ");"<< std::endl;
776 }
777
778 SavePrimitiveSubframes(out, option);
779}
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:149
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kWASaveUnder
Definition GuiTypes.h:150
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ 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:88
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
@ kFillSolid
Definition GuiTypes.h:51
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
@ kButton3
Definition GuiTypes.h:214
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
#define gClient
Definition TGClient.h:166
@ kLocalCleanup
Definition TGFrame.h:49
@ 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:46
#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:4318
void MakeCustomMenuList()
Makes a customizable version of the popup menu list, i.e.
Definition TClass.cxx:4260
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:2957
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.
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()
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
virtual TList * GetList() const
Definition TGFrame.h:346
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual TGLayoutManager * GetLayoutManager() const
Definition TGFrame.h:374
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:952
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void SavePrimitiveSubframes(std::ostream &out, Option_t *option="")
Auxilary protected method used to save subframes.
Definition TGFrame.cxx:2626
virtual void ChangeOptions(UInt_t options)
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1028
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:352
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1134
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:324
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:720
Int_t fX
Definition TGFrame.h:109
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:226
UInt_t fHeight
Definition TGFrame.h:112
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:297
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:668
virtual UInt_t GetOptions() const
Definition TGFrame.h:221
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition TGFrame.cxx:2465
Int_t fY
Definition TGFrame.h:110
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:750
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition TGFrame.cxx:578
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
UInt_t fWidth
Definition TGFrame.h:111
UInt_t GetHeight() const
Definition TGFrame.h:249
virtual void SetWidth(UInt_t w)
Definition TGFrame.h:270
virtual void MapWindow()
map window
Definition TGFrame.h:228
UInt_t GetWidth() const
Definition TGFrame.h:248
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition TGFrame.cxx:2438
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:271
Pixel_t fBackground
Definition TGFrame.h:119
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:760
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition TGGC.cxx:344
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:277
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1731
TGClient * fClient
Definition TGObject.h:37
Handle_t GetId() const
Definition TGObject.h:47
Handle_t fId
Definition TGObject.h:36
UInt_t fH
Bool_t Contains(Int_t px, Int_t py) const
UInt_t fW
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
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.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add a frame in the split frame using layout hints l.
void SetHRatio(Float_t r)
TGSplitFrame * fSecond
TGSplitTool * GetSplitTool() const
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)
TGSplitFrame(const TGSplitFrame &)=delete
void SwallowBack()
Swallow back the child frame previously extracted, and close its parent (transient frame).
TGFrame * GetFrame() const
TGSplitTool * fSplitTool
TGTransientFrame * fUndocked
TGSplitter * fSplitter
void Docked(TGFrame *frame)
Emit Undocked() signal.
void Undocked(TGFrame *frame)
Emit Undocked() signal.
TGFrame * fFrame
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
virtual Bool_t HandleConfigureNotify(Event_t *)
Handles resize events for this frame.
Float_t fHRatio
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
TGSplitFrame * GetSecond() const
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.
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.
TGSplitTool(const TGSplitTool &)=delete
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
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
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition TGWindow.cxx:151
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
const TGWindow * fParent
Definition TGWindow.h:36
const TGWindow * GetParent() const
Definition TGWindow.h:84
virtual void RaiseWindow()
raise window
Definition TGWindow.cxx:207
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:357
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
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:666
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:445
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
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Window_t fWindow
window reported event is relative to
Definition GuiTypes.h:176
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93
Bool_t fOverrideRedirect
boolean value for override-redirect
Definition GuiTypes.h:107
Mask_t fMask
bit mask specifying which fields are valid
Definition GuiTypes.h:110
Bool_t fSaveUnder
should bits under be saved (popups)?
Definition GuiTypes.h:104
auto * l
Definition textangle.C:4
#define dest(otri, vertexptr)
Definition triangle.c:1040