Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGMdiDecorFrame.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Bertrand Bellenot 20/08/2004
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
14 This file is part of TGMdi an extension to the xclass toolkit.
15 Copyright (C) 1998-2002 by Harald Radke, Hector Peraza.
16
17 This application is free software; you can redistribute it and/or
18 modify it under the terms of the GNU Library General Public
19 License as published by the Free Software Foundation; either
20 version 2 of the License, or (at your option) any later version.
21
22 This application is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 Library General Public License for more details.
26
27 You should have received a copy of the GNU Library General Public
28 License along with this library; if not, write to the Free
29 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
31**************************************************************************/
32
33
34/** \class TGMdiDecorFrame
35 \ingroup guiwidgets
36
37This file contains all different MDI frame decoration classes.
38
39*/
40
41
42#include <cstdio>
43#include <cstdlib>
44
45#include "KeySymbols.h"
46#include "TGResourcePool.h"
47#include "TGDimension.h"
48#include "WidgetMessageTypes.h"
49#include "TGMdiFrame.h"
50#include "TGMdiDecorFrame.h"
51#include "TGMdiMainFrame.h"
52#include "TVirtualX.h"
53
54
55
56////////////////////////////////////////////////////////////////////////////////
57/// TGMdiDecorFrame constructor.
58/// The TGMdiDecorFrame is the frame containing MDI decorations like
59/// title bar, minimize, maximize, restore and close buttons, and resizers.
60
62 Int_t w, Int_t h, const TGGC *boxGC,
63 UInt_t options, Pixel_t back) :
64 TGCompositeFrame(main->GetContainer(), w, h,
65 options | kOwnBackground | kVerticalFrame | kFixedSize, back)
66{
67
69 fEditDisabled = 1;
70 fFrame = frame;
76
78
80
83
85 fTitlebar->LayoutButtons(fButtonMask, kFALSE, kFALSE);
86
88 boxGC, kMdiBorderWidth);
90 boxGC, kMdiBorderWidth);
92 boxGC, kMdiBorderWidth);
94 boxGC, kMdiBorderWidth);
95
98 boxGC, kMdiBorderWidth);
101 boxGC, kMdiBorderWidth);
104 boxGC, kMdiBorderWidth);
107 boxGC, kMdiBorderWidth);
108
109 fUpperHR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
110 fLowerHR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
111 fLeftVR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
112 fRightVR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
113 fUpperLeftCR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
114 fLowerLeftCR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
115 fUpperRightCR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
116 fLowerRightCR->SetMinSize(50, fTitlebar->GetDefaultHeight() + 2 * fBorderWidth);
117
119
120 fFrame->ReparentWindow(this, fBorderWidth, fTitlebar->GetDefaultHeight());
121 fFrame->fParent = this;
123
126 Layout();
127
128 MapWindow();
130
131 fFrame->RaiseWindow();
132 fTitlebar->RaiseWindow();
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// TGMdiDecorFrame destructor.
137
139{
140 if (!MustCleanup()) {
141 delete fUpperHR;
142 delete fLowerHR;
143 delete fLeftVR;
144 delete fRightVR;
145 delete fUpperLeftCR;
146 delete fLowerLeftCR;
147 delete fUpperRightCR;
148 delete fLowerRightCR;
149 }
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// Set border width of the decor.
155
160
161////////////////////////////////////////////////////////////////////////////////
162/// Set-up MDI buttons.
163
165{
166 fButtonMask = buttons;
168 if (fButtonMask & kMdiSize) {
169 fUpperHR->Activate(kTRUE);
170 fLowerHR->Activate(kTRUE);
171 fLeftVR->Activate(kTRUE);
172 fRightVR->Activate(kTRUE);
173 fUpperLeftCR->Activate(kTRUE);
174 fLowerLeftCR->Activate(kTRUE);
175 fUpperRightCR->Activate(kTRUE);
176 fLowerRightCR->Activate(kTRUE);
177 } else {
178 fUpperHR->Activate(kFALSE);
179 fLowerHR->Activate(kFALSE);
180 fLeftVR->Activate(kFALSE);
181 fRightVR->Activate(kFALSE);
182 fUpperLeftCR->Activate(kFALSE);
183 fLowerLeftCR->Activate(kFALSE);
184 fUpperRightCR->Activate(kFALSE);
185 fLowerRightCR->Activate(kFALSE);
186 }
187}
188
189////////////////////////////////////////////////////////////////////////////////
190/// Set resize mode (opaque or transparent)
191
193{
194 fUpperHR->SetResizeMode(mode);
195 fLowerHR->SetResizeMode(mode);
196 fLeftVR->SetResizeMode(mode);
197 fRightVR->SetResizeMode(mode);
198 fUpperLeftCR->SetResizeMode(mode);
199 fLowerLeftCR->SetResizeMode(mode);
200 fUpperRightCR->SetResizeMode(mode);
201 fLowerRightCR->SetResizeMode(mode);
202}
203
204////////////////////////////////////////////////////////////////////////////////
205/// Recalculates the postion and the size of all decor frame components.
206
208{
212
213 if (fIsMaximized == kFALSE) {
214 fUpperLeftCR->Move(0, 0);
215 fUpperRightCR->Move(fWidth - fUpperRightCR->GetWidth(), 0);
216 fLowerLeftCR->Move(0, fHeight - fLowerLeftCR->GetHeight());
217 fLowerRightCR->Move(fWidth - fLowerRightCR->GetWidth(),
218 fHeight - fLowerRightCR->GetHeight());
219
220 fLeftVR->MoveResize(0, fUpperLeftCR->GetHeight(), fLeftVR->GetWidth(),
221 fHeight - fUpperLeftCR->GetHeight() -
222 fLowerLeftCR->GetHeight());
223 fUpperHR->MoveResize(fUpperLeftCR->GetWidth(), 0,
224 fWidth - fUpperRightCR->GetWidth() -
225 fUpperLeftCR->GetWidth(), fUpperHR->GetHeight());
226 fRightVR->MoveResize(fWidth - fRightVR->GetWidth(),
227 fUpperRightCR->GetHeight(), fRightVR->GetWidth(),
228 fHeight - fUpperLeftCR->GetHeight() -
229 fLowerLeftCR->GetHeight());
230 fLowerHR->MoveResize(fLowerLeftCR->GetWidth(), fHeight -
231 fLowerHR->GetHeight(),
232 fWidth - fLowerRightCR->GetWidth() -
233 fLowerLeftCR->GetWidth(), fLowerHR->GetHeight());
234 }
235}
236
237////////////////////////////////////////////////////////////////////////////////
238/// Set MDI Window name (appearing in the title bar)
239
241{
242 fTitlebar->GetWinName()->SetText(new TGString(name));
243 fTitlebar->Layout();
244}
245
246////////////////////////////////////////////////////////////////////////////////
247/// Set Window icon (appearing in the title bar)
248
250{
251 fTitlebar->GetWinIcon()->SetPicture(icon);
252 fClient->NeedRedraw(fTitlebar->GetWinIcon());
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Move the MDI window at position x, y.
257
259{
260 if (x < 0) {
261 fMdiMainFrame->SetHsbPosition(fMdiMainFrame->GetViewPort()->GetWidth());
262 }
263 if (y < 0) {
264 fMdiMainFrame->SetVsbPosition(fMdiMainFrame->GetViewPort()->GetHeight());
265 }
268 if (IsMapped() && !IsMaximized()) fMdiMainFrame->Layout();
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Move the MDI window at position x, y and set size to w, h.
273
275{
276 if (x < 0) {
277 fMdiMainFrame->SetHsbPosition(fMdiMainFrame->GetViewPort()->GetWidth());
278 }
279 if (y < 0) {
280 fMdiMainFrame->SetVsbPosition(fMdiMainFrame->GetViewPort()->GetHeight());
281 }
284 if (IsMapped() && !IsMaximized()) fMdiMainFrame->Layout();
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Handle configure notify event.
289
291{
292 if ((event->fX < 0) || (event->fY < 0) ||
293 (event->fX + event->fWidth > fMdiMainFrame->GetViewPort()->GetWidth()) ||
294 (event->fY + event->fHeight > fMdiMainFrame->GetViewPort()->GetHeight())) {
295 fMdiMainFrame->Resize();
296 }
297
298 if (event->fWindow == fFrame->GetId()) {
299 UInt_t newW = event->fWidth + 2 * fBorderWidth;
300 UInt_t newH = event->fHeight + 2 * fBorderWidth +
301 fTitlebar->GetDefaultHeight();
302
303 if ((fWidth != newW) || (fHeight != newH)) {
304 Resize(newW, newH);
305 }
306 fMdiMainFrame->Layout();
307 return kTRUE;
308 }
309 fMdiMainFrame->Layout();
310 return kFALSE;
311}
312
313////////////////////////////////////////////////////////////////////////////////
314/// Handle mouse button events.
315
317{
318 if (event->fType == kButtonPress) {
319 void *ud;
320 fTitlebar->GetWinIcon()->GetPopup()->EndMenu(ud);
322 }
323 return kTRUE;
324}
325
326
327////////////////////////////////////////////////////////////////////////////////
328/// TGMdiTitleBar constructor.
329/// the TGMdiTitleBar is the frame containing a title (window name)
330/// an icon and MDI picture buttons as minimize, maximize, restore,
331/// close and help.
332
334 const char *name) :
336{
337 fMdiWin = mdiwin;
339 fWinName = 0;
341
343
346 //fMiddleHint = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 1, 1, 1);
349
350 fLFrame = new TGCompositeFrame(this, 10, 10, kHorizontalFrame);
351 fMFrame = new TGCompositeFrame(this, 10, 10, kHorizontalFrame);
352 fRFrame = new TGCompositeFrame(this, 10, 10, kHorizontalFrame);
356
357 fWinIcon = new TGMdiTitleIcon(fLFrame, this,
358 fClient->GetPicture("mdi_default.xpm"),
359 16, 16);
360 fLFrame->AddFrame(fWinIcon, fLHint);
361
362 fWinName = new TGLabel(fMFrame, new TGString(name));
363 fWinName->SetTextJustify(kTextLeft);
364 fMFrame->AddFrame(fWinName, fLHint);
365
366 fButtons = new TGMdiButtons(fRFrame, this);
367 fRFrame->AddFrame(fButtons, fLHint);
368
369 MapWindow();
371 Layout();
373}
374
375////////////////////////////////////////////////////////////////////////////////
376/// TGMdiTitleBar destructor.
377
379{
380 if (!MustCleanup()) {
381 delete fLHint;
382 delete fLeftHint;
383 delete fMiddleHint;
384 delete fRightHint;
385 }
386}
387
388////////////////////////////////////////////////////////////////////////////////
389/// Recalculates the position of every enabled (displayed) buttons.
390
391void TGMdiTitleBar::LayoutButtons(UInt_t buttonmask,Bool_t isMinimized,
392 Bool_t isMaximized)
393{
394 fWinIcon->GetPopup()->EnableEntry(kMdiMove);
395
396 if (buttonmask & kMdiSize) {
397 fWinIcon->GetPopup()->EnableEntry(kMdiSize);
398 } else {
399 fWinIcon->GetPopup()->DisableEntry(kMdiSize);
400 }
401
402 if (buttonmask & kMdiMenu) {
403 fLFrame->ShowFrame(fWinIcon);
404 } else {
405 fLFrame->HideFrame(fWinIcon);
406 }
407
408 if (buttonmask & kMdiClose) {
409 fButtons->ShowFrame(fButtons->GetButton(4));
410 fWinIcon->GetPopup()->EnableEntry(kMdiClose);
411 } else {
412 fButtons->HideFrame(fButtons->GetButton(4));
413 fWinIcon->GetPopup()->DisableEntry(kMdiClose);
414 }
415
416 if (buttonmask & kMdiHelp) {
417 fButtons->ShowFrame(fButtons->GetButton(3));
418 } else {
419 fButtons->HideFrame(fButtons->GetButton(3));
420 }
421
422 if ((buttonmask & kMdiMaximize) && (!isMaximized)) {
423 fButtons->ShowFrame(fButtons->GetButton(2));
424 fWinIcon->GetPopup()->EnableEntry(kMdiMaximize);
425 } else {
426 fButtons->HideFrame(fButtons->GetButton(2));
427 fWinIcon->GetPopup()->DisableEntry(kMdiMaximize);
428 }
429
430 if (isMinimized | isMaximized) {
431 fButtons->ShowFrame(fButtons->GetButton(1));
432 fWinIcon->GetPopup()->EnableEntry(kMdiRestore);
433 fWinIcon->GetPopup()->DisableEntry(kMdiSize);
434 if (isMaximized) fWinIcon->GetPopup()->DisableEntry(kMdiMove);
435 } else {
436 fButtons->HideFrame(fButtons->GetButton(1));
437 fWinIcon->GetPopup()->DisableEntry(kMdiRestore);
438 }
439
440 if ((buttonmask & kMdiMinimize) && (!isMinimized)) {
441 fButtons->ShowFrame(fButtons->GetButton(0));
442 fWinIcon->GetPopup()->EnableEntry(kMdiMinimize);
443 } else {
444 fButtons->HideFrame(fButtons->GetButton(0));
445 fWinIcon->GetPopup()->DisableEntry(kMdiMinimize);
446 }
447
448 Layout();
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Set title bar color (blue or grey, depends on active state).
453
455{
456 SetBackgroundColor(back);
457
458 fClient->GetFont(font->GetName());
459 fWinName->SetTextFont(font);
460 fWinName->SetTextColor(fore, kFALSE);
461 fMFrame->SetBackgroundColor(back);
462 fWinName->SetBackgroundColor(back);
463 fWinIcon->SetBackgroundColor(back);
464 fButtons->SetBackgroundColor(back);
465 Layout();
466 fClient->NeedRedraw(this);
467 fClient->NeedRedraw(fWinName);
468 fClient->NeedRedraw(fMFrame);
469 fClient->NeedRedraw(fButtons);
470 fClient->NeedRedraw(fWinIcon);
471 fWinIcon->DoRedraw();
472}
473
474////////////////////////////////////////////////////////////////////////////////
475/// Handle double click in title bar (maximize window)
476
478{
479 if ((event->fType == kButtonPress) && (event->fCode == kButton1)) {
481 }
482 return kTRUE;
483}
484
485////////////////////////////////////////////////////////////////////////////////
486/// Handle mouse click on title bar.
487
489{
490 if (event->fType == kButtonPress) {
491 void *ud;
492 GetWinIcon()->GetPopup()->EndMenu(ud);
493 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kMove));
494 switch (event->fCode) {
495 case kButton1:
496 fX0 = event->fX;
497 fY0 = event->fY;
500 break;
501
502 case kButton2:
504 break;
505
506 case kButton3:
507 gVirtualX->LowerWindow(fParent->GetId());
509 break;
510 }
511 } else {
512 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
513 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kPointer));
514 switch (event->fCode) {
515
516 case kButton1:
517 //if (!fClient->IsEditable()) ((TGMainFrame *)((TGMdiMainFrame *)fMdiWin)->GetMainFrame())->Layout();
519 break;
520
521 case kButton2:
523 break;
524
525 case kButton3:
527 break;
528 }
529
530 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
531 if (f && (f != this)) {
532 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
533 f->HandleButton(event);
534 }
535 }
536 return kTRUE;
537}
538
539////////////////////////////////////////////////////////////////////////////////
540/// Process messages for title bar.
541
543{
544 switch (GET_MSG(msg)) {
545 case kC_COMMAND:
546 switch (GET_SUBMSG(msg)) {
547 case kCM_BUTTON:
548 case kCM_MENU:
550 fParent->GetId(), parm2);
551 break;
552 }
553 break;
554 }
555 return kTRUE;
556}
557
558////////////////////////////////////////////////////////////////////////////////
559/// Handle mouse motion events in title bar (used to move MDI window).
560
562{
563 if (event->fWindow != fId) return kTRUE;
564 if (!fLeftButPressed) return kTRUE;
565
566 Int_t x = ((TGFrame *)fParent)->GetX();
567 Int_t y = ((TGFrame *)fParent)->GetY();
568 ((TGFrame *)fParent)->Move(x + event->fX - fX0, y + event->fY - fY0);
569
570 return kTRUE;
571}
572
573
574////////////////////////////////////////////////////////////////////////////////
575/// This is called from TGMdiMainFrame on Restore().
576
578{
579 icon->ReparentWindow(fLFrame);
580 buttons->ReparentWindow(fRFrame);
581 fLFrame->AddFrame(icon, fLHint);
582 fLFrame->ShowFrame(icon);
583 fRFrame->AddFrame(buttons, fLHint);
584 fRFrame->ShowFrame(buttons);
585}
586
587
588////////////////////////////////////////////////////////////////////////////////
589/// This is called from TGMdiMainFrame on Maximize().
590
592{
593 fLFrame->RemoveFrame(icon);
594 fRFrame->RemoveFrame(buttons);
595}
596
597
598////////////////////////////////////////////////////////////////////////////////
599/// TGMdiButtons constructor.
600/// the TGMdiButtons is the frame containing MDI picture buttons like
601/// minimize, maximize, restore, close and help.
602
603TGMdiButtons::TGMdiButtons(const TGWindow *p, const TGWindow *titlebar) :
605{
606 fDefaultHint = new TGLayoutHints(kLHintsNormal, 0, 0, 1, 0);
607 fCloseHint = new TGLayoutHints(kLHintsNormal, 2, 0, 1, 0);
609 fMsgWindow = 0;
610
611 //--- Minimize button
612
613 fButton[0] = new TGPictureButton(this,
614 fClient->GetPicture("mdi_minimize.xpm"),
616 fButton[0]->SetToolTipText("Minimize");
618 fButton[0]->SetBackgroundColor(GetDefaultFrameBackground());
619 fButton[0]->Associate(titlebar);
620
621 //--- Restore button
622
623 fButton[1] = new TGPictureButton(this,
624 fClient->GetPicture("mdi_restore.xpm"),
626 fButton[1]->SetToolTipText("Restore");
628 fButton[1]->SetBackgroundColor(GetDefaultFrameBackground());
629 fButton[1]->Associate(titlebar);
630
631 //--- Maximize button
632
633 fButton[2] = new TGPictureButton(this,
634 fClient->GetPicture("mdi_maximize.xpm"),
636 fButton[2]->SetToolTipText("Maximize");
638 fButton[2]->SetBackgroundColor(GetDefaultFrameBackground());
639 fButton[2]->Associate(titlebar);
640
641 //--- Help button
642
643 fButton[3] = new TGPictureButton(this,
644 fClient->GetPicture("mdi_help.xpm"),
645 kMdiHelp);
646 fButton[3]->SetToolTipText("Help");
648 fButton[3]->SetBackgroundColor(GetDefaultFrameBackground());
649 fButton[3]->Associate(titlebar);
650
651 //--- Close button
652
653 fButton[4] = new TGPictureButton(this,
654 fClient->GetPicture("mdi_close.xpm"),
655 kMdiClose);
656 fButton[4]->SetToolTipText("Close");
658 fButton[4]->SetBackgroundColor(GetDefaultFrameBackground());
659 fButton[4]->Associate(titlebar);
661}
662
663////////////////////////////////////////////////////////////////////////////////
664/// TGMdiButtons destructor.
665
667{
668 if (!MustCleanup()) {
669 delete fDefaultHint;
670 delete fCloseHint;
671 }
672}
673
674////////////////////////////////////////////////////////////////////////////////
675/// TGMdiTitleIcon constructor.
676/// the TGMdiTitleIcon is the left icon used also for the MDI
677/// popup menu allowing access to MDI commands as : restore,
678/// move, size, minimize and close.
679
681 const TGPicture *pic, Int_t w, Int_t h) :
682 TGIcon(p, pic, w, h)
683{
684 fMsgWindow = titlebar;
686
687 //--- MDI system menu
688
689 fPopup = new TGPopupMenu(fClient->GetDefaultRoot());// fClient->GetRoot());
690 fPopup->AddEntry(new TGHotString("&Restore"), kMdiRestore);
691 fPopup->AddEntry(new TGHotString("&Move"), kMdiMove);
692 fPopup->AddEntry(new TGHotString("&Size"), kMdiSize);
693 fPopup->AddEntry(new TGHotString("Mi&nimize"), kMdiMinimize);
694 fPopup->AddEntry(new TGHotString("Ma&ximize"), kMdiMaximize);
695 fPopup->AddSeparator();
696 fPopup->AddEntry(new TGHotString("&Close Ctrl+F4"), kMdiClose);
697 fPopup->DisableEntry(kMdiRestore);
698 fPopup->Associate(titlebar);
699
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// TGMdiTitleIcon destructor.
706
711
712////////////////////////////////////////////////////////////////////////////////
713/// Redraw icon.
714
716{
717 gVirtualX->ClearArea(fId, 0, 0, fWidth, fHeight);
719}
720
721////////////////////////////////////////////////////////////////////////////////
722/// Handle double click event on MDI icon (close the window)
723
725{
726 if (event->fCode == kButton1) {
727 void *ud;
728 fPopup->EndMenu(ud);
729 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
731 }
732 return kTRUE;
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// Handle button event on MDI icon (popup menu)
737
739{
741
742 if (event->fType == kButtonPress) {
743 fPopup->PlaceMenu(event->fXRoot - event->fX,
744 event->fYRoot + (fHeight - event->fY),
745 kTRUE, kTRUE);
746 }
747 return kTRUE;
748}
749
750
751////////////////////////////////////////////////////////////////////////////////
752/// TGMdiWinResizer constructor.
753/// The TGMdiWinResizer is a frame allowing to resize MDI window.
754/// Could be horizontal, vertical or corner resizer (see derived classes
755/// TGMdiVerticalWinResizer, TGMdiHorizontalWinResizer, and
756/// TGMdiCornerWinResizer).
757
759 Int_t pos, const TGGC *boxgc, Int_t linew,
760 Int_t mdioptions, Int_t w, Int_t h, UInt_t options) :
761 TGFrame(p, w, h, options)
762{
763 fWinX = fWinY = fWinW = fWinH = fOldX = fOldY = fOldW = fOldH = 0;
764 fNewX = fNewY = fNewW = fNewH = fX0 = fY0 = 0;
765
767
768 fMdiWin = mdiwin;
769 fMdiOptions = mdioptions;
770 fPos = pos;
771
772 fBoxGC = boxgc;
773 fLineW = linew;
774
775 fMinW = 50;
776 fMinH = 20;
777
779
780 gVirtualX->GrabButton(fId, kButton1, kAnyModifier,
782 kNone, kNone);
784}
785
786////////////////////////////////////////////////////////////////////////////////
787/// Handle button events in resizer (grab button and resize).
788
790{
791 if (!IsEnabled()) return kTRUE;
792
793 if (event->fType == kButtonPress) {
794 void *ud;
795 ((TGMdiDecorFrame *)fParent)->GetTitleBar()->GetWinIcon()->GetPopup()->EndMenu(ud);
796 switch (event->fCode) {
797 case kButton1:
799 fNewX = fOldX = fWinX = ((TGFrame *)fParent)->GetX();
800 fNewY = fOldY = fWinY = ((TGFrame *)fParent)->GetY();
801 fWinW = ((TGFrame *)fParent)->GetWidth();
802 fWinH = ((TGFrame *)fParent)->GetHeight();
803 fX0 = event->fXRoot;
804 fY0 = event->fYRoot;
805 fNewW = fWinW;
806 fNewH = fWinH;
807 if (fMdiOptions != kMdiOpaque) {
809 }
813 break;
814
815 case kButton2:
817 break;
818
819 case kButton3:
821 break;
822 }
823 } else {
824 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
825 switch (event->fCode) {
826 case kButton1:
827 if (fMdiOptions != kMdiOpaque) {
829 ((TGFrame *)fParent)->MoveResize(fNewX, fNewY, fNewW, fNewH);
830 }
831 //if (!fClient->IsEditable()) ((TGMainFrame *)((TGMdiMainFrame *)fMdiWin)->GetMainFrame())->Layout();
833 break;
834
835 case kButton2:
837 break;
838
839 case kButton3:
841 break;
842 }
843 }
844 return kTRUE;
845}
846
847////////////////////////////////////////////////////////////////////////////////
848/// Draw resize box (rectangle).
849
851{
853
854 gVirtualX->DrawRectangle(m->GetContainer()->GetId(), fBoxGC->GetGC(),
855 x + fLineW / 2, y + fLineW / 2, width - fLineW, height - fLineW);
856}
857
858////////////////////////////////////////////////////////////////////////////////
859/// Move (resize) parent MDI window.
860
862{
863 if (fMdiOptions == kMdiOpaque) {
864 ((TGFrame *)fParent)->MoveResize(fNewX, fNewY, fNewW, fNewH);
865 } else {
868 }
869}
870
871
872////////////////////////////////////////////////////////////////////////////////
873/// TGMdiVerticalWinResizer constructor.
874
876 const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew,
877 Int_t mdioptions, Int_t w, Int_t h) :
878 TGMdiWinResizer(p, mdiwin, pos, boxGC, linew, mdioptions,
880{
881 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kArrowVer));
882}
883
884////////////////////////////////////////////////////////////////////////////////
885/// Handle motion events in resizer (resize associated MDI window).
886
888{
889 if (((TGMdiDecorFrame *)fParent)->IsMinimized()) return kTRUE;
890
891 fOldX = fNewX;
892 fOldY = fNewY;
893 fOldW = fNewW;
894 fOldH = fNewH;
895
896 Int_t dy = event->fYRoot - fY0;
897
898 if (!fLeftButPressed) return kTRUE;
899
900 switch (fPos) {
901 case kMdiResizerTop:
902 if (fWinH - dy < fMinH) dy = fWinH - fMinH;
903 fNewY = fWinY + dy;
904 fNewH = fWinH - dy;
905 break;
906
908 if (fWinH + dy < fMinH) dy = fMinH - fWinH;
909 fNewY = fWinY;
910 fNewH = fWinH + dy;
911 break;
912 }
913
914 MoveResizeIt();
915
916 return kTRUE;
917}
918
919////////////////////////////////////////////////////////////////////////////////
920/// Draw vertical resizer frame border.
921
923{
924 gVirtualX->ClearArea(fId, 0, 0, fWidth, fHeight);
925 if (fPos == kMdiResizerTop) {
926 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, 1, fWidth - 1, 1);
927 } else {
928 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, fHeight - 2, fWidth - 1,
929 fHeight - 2);
930 gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight - 1, fWidth - 1,
931 fHeight - 1);
932 }
933}
934
935
936////////////////////////////////////////////////////////////////////////////////
937/// TGMdiCornerWinResizer constructor.
938
940 const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew,
941 Int_t mdioptions, Int_t w, Int_t h) :
942 TGMdiWinResizer(p, mdiwin, pos, boxGC, linew, mdioptions,
944{
945 Cursor_t defaultCursor = kNone;
947
948 switch (fPos) {
950 defaultCursor = gVirtualX->CreateCursor(kTopLeft);
951 break;
952
954 defaultCursor = gVirtualX->CreateCursor(kBottomLeft);
955 break;
956
958 defaultCursor = gVirtualX->CreateCursor(kTopRight);
959 break;
960
962 defaultCursor = gVirtualX->CreateCursor(kBottomRight);
963 break;
964 }
965 gVirtualX->SetCursor(fId, defaultCursor);
966}
967
968////////////////////////////////////////////////////////////////////////////////
969/// Handle motion events in resizer (resize associated MDI window).
970
972{
973 if (((TGMdiDecorFrame *)fParent)->IsMinimized()) return kTRUE;
974
975 fOldX = fNewX;
976 fOldY = fNewY;
977 fOldW = fNewW;
978 fOldH = fNewH;
979
980 Int_t dx = event->fXRoot - fX0;
981 Int_t dy = event->fYRoot - fY0;
982
983 if (!fLeftButPressed) return kTRUE;
984
985 switch (fPos) {
987 if (fWinW - dx < fMinW) dx = fWinW - fMinW;
988 if (fWinH - dy < fMinH) dy = fWinH - fMinH;
989 fNewX = fWinX + dx;
990 fNewW = fWinW - dx;
991 fNewY = fWinY + dy;
992 fNewH = fWinH - dy;
993 break;
994
996 if (fWinW - dx < fMinW) dx = fWinW - fMinW;
997 if (fWinH + dy < fMinH) dy = fMinH - fWinH;
998 fNewX = fWinX + dx;
999 fNewW = fWinW - dx;
1000 fNewY = fWinY;
1001 fNewH = fWinH + dy;
1002 break;
1003
1005 if (fWinW + dx < fMinW) dx = fMinW - fWinW;
1006 if (fWinH - dy < fMinH) dy = fWinH - fMinH;
1007 fNewX = fWinX;
1008 fNewW = fWinW + dx;
1009 fNewY = fWinY + dy;
1010 fNewH = fWinH - dy;
1011 break;
1012
1014 if (fWinW + dx < fMinW) dx = fMinW - fWinW;
1015 if (fWinH + dy < fMinH) dy = fMinH - fWinH;
1016 fNewX = fWinX;
1017 fNewW = fWinW + dx;
1018 fNewY = fWinY;
1019 fNewH = fWinH + dy;
1020 break;
1021 }
1022
1023 MoveResizeIt();
1024
1025 return kTRUE;
1026}
1027
1028////////////////////////////////////////////////////////////////////////////////
1029/// Draw corner resizer frame border.
1030
1032{
1033 gVirtualX->ClearArea(fId, 0, 0, fWidth, fHeight);
1034
1035 switch (fPos) {
1037 gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 1, fWidth - 1, 1);
1038 gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 1, 1, fHeight - 1);
1039 break;
1040
1042 gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 0, 1, fHeight - 1);
1043 gVirtualX->DrawLine(fId, GetShadowGC()(), 1, fHeight - 2,
1044 fWidth - 1, fHeight - 2);
1045 gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight - 1,
1046 fWidth - 1, fHeight - 1);
1047 break;
1048
1050 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, 1, fWidth - 1, 1);
1051 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth - 2, 1,
1052 fWidth - 2, fHeight - 1);
1053 gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth - 1, 0,
1054 fWidth - 1, fHeight - 1);
1055 break;
1056
1058 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth - 2, 0,
1059 fWidth - 2, fHeight - 2);
1060 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, fHeight - 2,
1061 fWidth - 1, fHeight - 2);
1062 gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth - 1, 0,
1063 fWidth - 1, fHeight - 1);
1064 gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight - 1,
1065 fWidth - 1, fHeight - 1);
1066 break;
1067 }
1068}
1069
1070
1071////////////////////////////////////////////////////////////////////////////////
1072/// TGMdiHorizontalWinResizer constructor.
1073
1075 const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew,
1076 Int_t mdioptions, Int_t w, Int_t h) :
1077 TGMdiWinResizer(p, mdiwin, pos, boxGC, linew, mdioptions,
1079{
1081 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kArrowHor));
1082 SetWindowName();
1083}
1084
1085////////////////////////////////////////////////////////////////////////////////
1086/// Handle motion events in resizer (resize associated MDI window).
1087
1089{
1090 if (((TGMdiDecorFrame *)fParent)->IsMinimized()) return kTRUE;
1091
1092 fOldX = fNewX;
1093 fOldY = fNewY;
1094 fOldW = fNewW;
1095 fOldH = fNewH;
1096
1097 Int_t dx = event->fXRoot - fX0;
1098
1099 if (!fLeftButPressed) return kTRUE;
1100
1101 switch (fPos) {
1102 case (kMdiResizerLeft):
1103 if (fWinW - dx < fMinW) dx = fWinW - fMinW;
1104 fNewX = fWinX + dx;
1105 fNewW = fWinW - dx;
1106 break;
1107
1108 case (kMdiResizerRight):
1109 if (fWinW + dx < fMinW) dx = fMinW - fWinW;
1110 fNewX = fWinX;
1111 fNewW = fWinW + dx;
1112 break;
1113 }
1114
1115 MoveResizeIt();
1116
1117 return kTRUE;
1118}
1119
1120////////////////////////////////////////////////////////////////////////////////
1121/// Draw horizontal resizer frame border.
1122
1124{
1125 gVirtualX->ClearArea(fId, 0, 0, fWidth, fHeight);
1126 if (fPos == kMdiResizerLeft) {
1127 gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 0, 1, fHeight - 1);
1128 } else {
1129 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth - 2, 0, fWidth - 2, fHeight - 1);
1130 gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth - 1, 0, fWidth - 1, fHeight - 1);
1131 }
1132}
@ kButtonPress
Definition GuiTypes.h:61
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:35
const Mask_t kButtonMotionMask
Definition GuiTypes.h:165
const Mask_t kButtonPressMask
Definition GuiTypes.h:162
const Mask_t kAnyModifier
Definition GuiTypes.h:211
const Mask_t kPointerMotionMask
Definition GuiTypes.h:164
@ kVerticalFrame
Definition GuiTypes.h:382
@ kFixedWidth
Definition GuiTypes.h:388
@ kHorizontalFrame
Definition GuiTypes.h:383
@ kFixedHeight
Definition GuiTypes.h:390
@ kFixedSize
Definition GuiTypes.h:391
@ kOwnBackground
Definition GuiTypes.h:392
const Handle_t kNone
Definition GuiTypes.h:89
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:167
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:163
@ kTopLeft
Definition GuiTypes.h:373
@ kBottomRight
Definition GuiTypes.h:373
@ kArrowVer
Definition GuiTypes.h:375
@ kMove
Definition GuiTypes.h:375
@ kTopRight
Definition GuiTypes.h:373
@ kBottomLeft
Definition GuiTypes.h:373
@ kArrowHor
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:376
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
@ kButton2
Definition GuiTypes.h:215
@ kButton3
Definition GuiTypes.h:215
@ kButton1
Definition GuiTypes.h:215
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
Definition RtypesCore.h:89
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsExpandX
Definition TGLayout.h:30
@ kMdiResizerRight
@ kMdiResizerLeft
@ kMdiResizerBottom
@ kMdiResizerTop
@ kMdiOpaque
@ kMdiMinimize
@ kMdiMove
@ kMdiHelp
@ kMdiMenu
@ kMdiSize
@ kMdiRestore
@ kMdiMaximize
@ kMdiClose
@ kMdiDefaultHints
@ kTextLeft
Definition TGWidget.h:23
@ kWidgetIsEnabled
Definition TGWidget.h:37
char name[80]
Definition TGX11.cxx:148
#define gVirtualX
Definition TVirtualX.h:375
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
EWidgetMessageTypes
WidgetMessageTypes.
@ kMDI_CLOSE
@ kCM_MENU
@ kC_COMMAND
@ kCM_BUTTON
@ kMDI_CURRENT
@ kMDI_MAXIMIZE
Int_t GET_SUBMSG(Long_t val)
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:318
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
TGFrame * GetFrameFromPoint(Int_t x, Int_t y) override
Get frame located at specified point.
Definition TGFrame.cxx:1300
Int_t MustCleanup() const override
Definition TGFrame.h:362
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual Bool_t TranslateCoordinates(TGFrame *child, Int_t x, Int_t y, Int_t &fx, Int_t &fy)
Translate coordinates to child frame.
Definition TGFrame.cxx:1324
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:331
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:621
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:727
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition TGFrame.cxx:340
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
Definition TGFrame.h:88
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition TGFrame.h:204
Int_t fBorderWidth
frame border width
Definition TGFrame.h:93
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:304
void MapWindow() override
map window
Definition TGFrame.h:206
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:747
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:585
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:637
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:757
UInt_t fWidth
frame width
Definition TGFrame.h:87
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
void DoRedraw() override
Redraw picture.
Definition TGIcon.cxx:125
TGIcon(const TGIcon &)=delete
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
~TGMdiButtons() override
TGMdiButtons destructor.
TGPictureButton * fButton[5]
MDI picture buttons.
TGMdiButtons(const TGWindow *p, const TGWindow *titlebar)
TGMdiButtons constructor.
TGLayoutHints * fCloseHint
Layout hints.
TGLayoutHints * fDefaultHint
const TGWindow * fMsgWindow
window handling container messages
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
void DrawBorder() override
Draw corner resizer frame border.
TGMdiCornerWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=20, Int_t h=20)
TGMdiCornerWinResizer constructor.
This file contains all different MDI frame decoration classes.
Bool_t HandleConfigureNotify(Event_t *event) override
Handle configure notify event.
TGMdiTitleBar * fTitlebar
MDI window title bar.
~TGMdiDecorFrame() override
TGMdiDecorFrame destructor.
TGMdiVerticalWinResizer * fUpperHR
Bool_t IsMaximized() const
Bool_t IsMinimized() const
TGLayoutHints * fExpandHint
layout hints
TGMdiVerticalWinResizer * fLowerHR
upper and lower vertical resizers
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set resize mode (opaque or transparent).
ULong_t fButtonMask
mask used to display/hide buttons
TGMdiCornerWinResizer * fUpperLeftCR
void Layout() override
Recalculates the postion and the size of all decor frame components.
TGMdiHorizontalWinResizer * fLeftVR
TGLayoutHints * fLHint
Bool_t fIsMaximized
minimized and maximized flags
Bool_t fMinimizedUserPlacement
user placement flag
friend class TGMdiMainFrame
TGMdiMainFrame * fMdiMainFrame
MDI main frame.
void SetWindowName(const char *name) override
Set MDI Window name (appearing in the title bar).
void SetWindowIcon(const TGPicture *pic)
Set Window icon (appearing in the title bar).
TGMdiFrame * fFrame
parent (owner) MDI frame
TGMdiDecorFrame(TGMdiMainFrame *main, TGMdiFrame *frame, Int_t w, Int_t h, const TGGC *boxGC, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
TGMdiDecorFrame constructor.
void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move the MDI window at position x, y and set size to w, h.
Int_t fMinimizedY
minimized position
void Move(Int_t x, Int_t y) override
Move the MDI window at position x, y.
void SetMdiButtons(ULong_t buttons)
Set-up MDI buttons.
TGMdiCornerWinResizer * fLowerRightCR
upper right and lower right resizers
TGMdiCornerWinResizer * fUpperRightCR
Bool_t HandleButton(Event_t *event) override
Handle mouse button events.
void SetDecorBorderWidth(Int_t bw)
Set border width of the decor.
TGMdiCornerWinResizer * fLowerLeftCR
upper left and lower left resizers
TGMdiHorizontalWinResizer * fRightVR
left and right horizontal resizers
This file contains the TGMdiFrame class.
Definition TGMdiFrame.h:42
void DrawBorder() override
Draw horizontal resizer frame border.
TGMdiHorizontalWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=5, Int_t h=4)
TGMdiHorizontalWinResizer constructor.
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
Bool_t HandleButton(Event_t *event) override
Handle mouse click on title bar.
void LayoutButtons(UInt_t buttonmask, Bool_t isMinimized, Bool_t isMaximized)
Recalculates the position of every enabled (displayed) buttons.
TGMdiTitleIcon * GetWinIcon() const
TGLayoutHints * fLeftHint
void SetTitleBarColors(UInt_t fore, UInt_t back, TGFont *f)
Set title bar color (blue or grey, depends on active state).
TGLayoutHints * fMiddleHint
TGMdiTitleBar(const TGWindow *p, const TGWindow *mdiwin, const char *name="Untitled")
TGMdiTitleBar constructor.
void RemoveFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Maximize().
TGCompositeFrame * fLFrame
Int_t fY0
initial position of the mouse click
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for title bar.
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click in title bar (maximize window).
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events in title bar (used to move MDI window).
Bool_t fMidButPressed
mouse button pressed
void AddFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Restore().
TGLabel * fWinName
window name label
const TGWindow * fMdiWin
owner MDI window
~TGMdiTitleBar() override
TGMdiTitleBar destructor.
TGCompositeFrame * fMFrame
TGMdiTitleIcon * fWinIcon
title icon
TGMdiButtons * fButtons
MDI buttons.
TGCompositeFrame * fRFrame
the three parts of the title bar
TGLayoutHints * fLHint
TGLayoutHints * fRightHint
layout hints
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click event on MDI icon (close the window).
TGMdiTitleIcon(const TGWindow *p, const TGWindow *titlebar, const TGPicture *pic, Int_t w, Int_t h)
TGMdiTitleIcon constructor.
Bool_t HandleButton(Event_t *event) override
Handle button event on MDI icon (popup menu).
TGPopupMenu * GetPopup() const
void DoRedraw() override
Redraw icon.
~TGMdiTitleIcon() override
TGMdiTitleIcon destructor.
const TGWindow * fMsgWindow
window handling container messages
TGPopupMenu * fPopup
Popup menu associated to the title icon.
TGMdiVerticalWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=4, Int_t h=5)
TGMdiVerticalWinResizer constructor.
void DrawBorder() override
Draw vertical resizer frame border.
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
Int_t fPos
position of the resizer
const TGGC * fBoxGC
GC used for resizing rectangle.
TGMdiWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=1, Int_t h=1, UInt_t options=kOwnBackground)
TGMdiWinResizer constructor.
Int_t fNewH
new MDI win position and dimension
Bool_t HandleButton(Event_t *event) override
Handle button events in resizer (grab button and resize).
friend class TGMdiMainFrame
Int_t fMdiOptions
MDI options.
Int_t fLineW
line width of resizing rectangle
const TGWindow * fMdiWin
owner MDI Window
void MoveResizeIt()
Move (resize) parent MDI window.
Int_t fY0
initial position of the mouse click
Bool_t fMidButPressed
mouse buttons flags
void DrawBox(Int_t x, Int_t y, UInt_t width, UInt_t height)
Draw resize box (rectangle).
Int_t fWinH
MDI win position and dimension.
Int_t fOldH
old MDI win position and dimension
Int_t fMinH
Min width and height of the MDI Win.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
Yield an action as soon as it is clicked.
Definition TGButton.h:228
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class creates a popup menu object.
Definition TGMenu.h:110
virtual Int_t EndMenu(void *&userData)
Close menu and return ID of selected menu item.
Definition TGMenu.cxx:1285
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
Int_t fWidgetFlags
widget status flags (OR of EWidgetStatus)
Definition TGWidget.h:47
Bool_t IsEnabled() const
Definition TGWidget.h:69
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
TGWindow(Window_t id)
Definition TGWindow.h:34
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:190
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition TGWindow.cxx:127
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition TGWindow.cxx:293
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
int main(int argc, char **argv)
Definition hadd.cxx:631
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:175
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:176
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:179
Int_t fXRoot
Definition GuiTypes.h:180
UInt_t fWidth
Definition GuiTypes.h:183
UInt_t fHeight
width and height of exposed area
Definition GuiTypes.h:183
Window_t fWindow
window reported event is relative to
Definition GuiTypes.h:177
Int_t fYRoot
coordinates relative to root
Definition GuiTypes.h:180
Int_t fX
Definition GuiTypes.h:179
UInt_t fCode
key or button code
Definition GuiTypes.h:181
TMarker m
Definition textangle.C:8