Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGedPatternSelect.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Marek Biskup, Ilka Antcheva 22/07/03
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, 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/** \class TGedPatternFrame,
14 \ingroup ged
15
16The TGedPatternFrame is a small frame with border showing
17a specific pattern (fill style.
18
19*/
20
21
22/** \class TGedPatternSelector,
23 \ingroup ged
24
25The TGedPatternSelector is a composite frame with TGedPatternFrames
26of all diferent styles
27
28*/
29
30
31/** \class TGedPatternPopup
32 \ingroup ged
33
34The TGedPatternPopup is a popup containing a TGedPatternSelector.
35
36*/
37
38
39/** \class TGedPatternSelect
40 \ingroup ged
41
42is a button with pattern area with
43a little down arrow. When clicked on the arrow the
44TGedPatternPopup pops up.
45
46Selecting a pattern in this widget will generate the event:
47kC_PATTERNSEL, kPAT_SELCHANGED, widget id, style.
48
49and the signal:
50PatternSelected(Style_t pattern)
51
52*/
53
54
55/** \class TGedSelect
56 \ingroup ged
57
58is button that shows popup window when clicked.
59
60*/
61
62
63/** \class TGedPopup
64 \ingroup ged
65
66is a popup window.
67
68*/
69
70
71#include "TGResourcePool.h"
72#include "TGedPatternSelect.h"
73#include "RConfigure.h"
74#include "TGToolTip.h"
75#include "TGButton.h"
76#include "RStipples.h"
77#include "TVirtualX.h"
78#include "snprintf.h"
79
80#include <iostream>
81
82
84
85
86////////////////////////////////////////////////////////////////////////////////
87/// Pattern select ctor.
88
90 int width, int height)
92{
94 gClient->GetColorByName("white", white); // white background
96
97 // special case: solid
98 if (pattern == 1001)
99 SetBackgroundColor(0); // if solid then black
100
101 fPattern = pattern;
102
104 fMsgWindow = p;
105 fActive = kFALSE;
106 snprintf(fTipText, sizeof(fTipText), "%d", pattern);
107
108 // solid and hollow must be treated separately
109 if (pattern != 0 && pattern != 1001)
110 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, fTipText, 1000);
111 else if (pattern == 0)
112 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "0 - hollow", 1000);
113 else // pattern == 1001
114 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "1001 - solid", 1000);
115
117
118 if (!fgGC) {
122 gcv.fLineStyle = kLineSolid;
123 gcv.fLineWidth = 0;
124 gcv.fFillStyle = 0;
125 gcv.fBackground = white;
126 gcv.fForeground = 0; // black foreground
127 fgGC = gClient->GetGC(&gcv, kTRUE);
128 }
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Handle mouse crossing event.
133
135{
136 if (fTip) {
137 if (event->fType == kEnterNotify)
138 fTip->Reset();
139 else
140 fTip->Hide();
141 }
142 return kTRUE;
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Handle mouse button event.
147
149{
150 if (event->fType == kButtonPress) {
152 } else { // kButtonRelease
154 }
155
156 return kTRUE;
157}
158
159////////////////////////////////////////////////////////////////////////////////
160/// Draw border.
161
167
168////////////////////////////////////////////////////////////////////////////////
169/// Redraw selected pattern.
170
172{
174
175 if (fPattern > 3000 && fPattern < 3026) {
177 gVirtualX->FillRectangle(fId, fgGC->GetGC(), 0, 0, fWidth, fHeight);
178 }
179 DrawBorder();
180}
181
182////////////////////////////////////////////////////////////////////////////////
183/// Set fill area style.
184/// fstyle : compound fill area interior style
185/// fstyle = 1000*interiorstyle + styleindex
186/// this function should be in TGGC !!!
187
189{
190 Int_t style = fstyle/1000;
191 Int_t fasi = fstyle%1000;
192 Int_t stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
193
194 static Pixmap_t fillPattern = 0;
195
196 switch (style) {
197 case 1: // solid
198 gc->SetFillStyle(kFillSolid);
199 break;
200 case 2: // pattern
201 break;
202 case 3: // hatch
203 gc->SetFillStyle(kFillStippled);
204 if (fillPattern != 0) {
205 gVirtualX->DeletePixmap(fillPattern);
206 fillPattern = 0;
207 }
208#ifdef R__WIN32
209 char pattern[32];
210 // invert (flip) gStipples bitmap bits on Windows
211 for (int i=0;i<32;++i)
212 pattern[i] = ~gStipples[stn][i];
213 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
214 (const char *)&pattern, 16, 16);
215#else
216 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
217 (const char*)gStipples[stn], 16, 16);
218#endif
219 gc->SetStipple(fillPattern);
220 break;
221 default:
222 break;
223 }
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Create pattern popup window.
228
230 TGCompositeFrame(p, 124, 190)
231{
232 SetLayoutManager(new TGTileLayout(this, 1));
233
234 Int_t i;
235 for (i = 1; i <= 25; i++)
236 fCe[i-1] = new TGedPatternFrame(this, 3000 + i);
237
238 fCe[25] = new TGedPatternFrame(this, 0);
239 fCe[26] = new TGedPatternFrame(this, 1001);
240
241 for (i = 0; i < 27; i++)
243
244 fMsgWindow = p;
245 fActive = -1;
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// Delete pattern popup window.
250
255
256////////////////////////////////////////////////////////////////////////////////
257/// Set selected the current style.
258
260{
261 if (fActive != newat) {
262 if ((fActive >= 0) && (fActive < 27)) {
264 }
265 fActive = newat;
266 if ((fActive >= 0) && (fActive < 27)) {
268 }
269 }
270}
271
272////////////////////////////////////////////////////////////////////////////////
273/// Process message generated by pattern popup window.
274
276{
277 switch (GET_MSG(msg)) {
278 case kC_PATTERNSEL:
279 switch (GET_SUBMSG(msg)) {
280 case kPAT_SELCHANGED:
281 switch (parm1) {
282 case kButton1:
285 break;
286 }
287 break;
288 case kPAT_CLICK:
289 switch (parm1) {
290 case kButton1:
292 break;
293 }
294 break;
295 }
296 }
297
298 return kTRUE;
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Create a popup frame.
303
305 UInt_t options, Pixel_t back)
306 : TGCompositeFrame(p, w, h, options, back)
307{
308 fMsgWindow = m;
310
312 wattr.fOverrideRedirect = kTRUE;
313 wattr.fSaveUnder = kTRUE;
314 gVirtualX->ChangeWindowAttributes(fId, &wattr);
315 gVirtualX->SetWindowHint(fId, TVirtualX::kHintTooltip);
316
318}
319
320////////////////////////////////////////////////////////////////////////////////
321/// Ungrab pointer and unmap popup window.
322
324{
325 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
326 UnmapWindow();
327}
328
329////////////////////////////////////////////////////////////////////////////////
330/// Place popup window at the specified place.
331
333{
334 Int_t rx, ry;
335 UInt_t rw, rh;
336
337 // Parent is root window for the popup:
338 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
339
340 if (gVirtualX->InheritsFrom("TGWin32")) {
341 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
342 x = rw - abs(rx) - fWidth;
343 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
344 y = rh - fHeight;
345 } else {
346 if (x < 0) x = 0;
347 if (x + fWidth > rw) x = rw - fWidth;
348 if (y < 0) y = 0;
349 if (y + fHeight > rh) y = rh - fHeight;
350 }
351
352 MoveResize(x, y, w, h);
354 Layout();
355 MapRaised();
356
359 fClient->GetResourcePool()->GetGrabCursor());
360 gClient->WaitForUnmap(this);
361 EndPopup();
362}
363
364////////////////////////////////////////////////////////////////////////////////
365/// Handle mouse button event in popup window.
366
368{
369 if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
370 (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
371
372 if (event->fType == kButtonRelease) EndPopup();
373
374 } else {
375 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
376 if (f && f != this) {
377 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
378 f->HandleButton(event);
379 }
380 }
381 return kTRUE;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Process messages generated by popup window.
386
388{
389 switch (GET_MSG(msg)) {
390 case kC_POPUP:
391 switch (GET_SUBMSG(msg)) {
392 case kPOP_HIDE:
393 EndPopup();
395 parm1, parm2);
396 break;
397 default:
398 break;
399 }
400 break;
401 }
402 return kTRUE;
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Pattern popup constructor.
407
410 GetDefaultFrameBackground())
411{
412 fCurrentPattern = pattern;
413
415 AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
416
418 Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
419}
420
421////////////////////////////////////////////////////////////////////////////////
422/// Destructor of pattern popup window.
423
428
429////////////////////////////////////////////////////////////////////////////////
430/// Process messages generated by pattern popup window.
431
433{
434 switch (GET_MSG(msg)) {
435 case kC_PATTERNSEL:
436 switch (GET_SUBMSG(msg)) {
437 case kPAT_SELCHANGED:
439 parm1, parm2);
440 UnmapWindow();
441 break;
442
443 default:
444 break;
445 }
446 break;
447 }
448 return kTRUE;
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Create pattern select button.
453
455 : TGCheckButton(p, "", id)
456{
457 fPopup = 0;
458
462 gcv.fLineStyle = kLineSolid;
463 gcv.fLineWidth = 0;
464 gcv.fFillStyle = 0;
466 gClient->GetColorByName("white", white); // white background
467 gcv.fBackground = white;
468 gcv.fForeground = 0; // black foreground
470
471 Enable();
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Destructor of pattern select button.
478
480{
481 if (fPopup)
482 delete fPopup;
484}
485
486////////////////////////////////////////////////////////////////////////////////
487/// Handle mouse button events in pattern select button.
488
490{
492
493 if (!IsEnabled()) return kTRUE;
494
495 if (event->fCode != kButton1) return kFALSE;
496
497 if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
498
499 if (event->fType == kButtonPress) {
500 if (fState != kButtonDown) {
503 }
504 } else {
505 if (fState != kButtonUp) {
508 Int_t ax, ay;
509 if (fPopup) {
510 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
511 0, fHeight, ax, ay, wdummy);
512#ifdef R__HAS_COCOA
513 gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
514#endif
517 }
518 }
519 }
520 return kTRUE;
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
525
531
532////////////////////////////////////////////////////////////////////////////////
533/// Clear widget state flag.
534
540
541////////////////////////////////////////////////////////////////////////////////
542/// Draw separator and arrow.
543
545{
546 Int_t x, y;
547 UInt_t h;
548
550
551 if (IsEnabled()) {
552
553 // separator
554 x = fWidth - 6 - fBorderWidth - 6;
555 y = fBorderWidth + 1;
556 h = fHeight - fBorderWidth - 1; // actually y1
557
558 if (fState == kButtonDown) { ++x; ++y; }
559
560 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
561 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
562 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
563
564 // arrow
565
566 x = fWidth - 6 - fBorderWidth - 2;
567 y = (fHeight - 4) / 2 + 1;
568
569 if (fState == kButtonDown) { ++x; ++y; }
570
571 DrawTriangle(GetBlackGC()(), x, y);
572
573 } else {
574
575 // separator
576 x = fWidth - 6 - fBorderWidth - 6;
577 y = fBorderWidth + 1;
578 h = fHeight - fBorderWidth - 1; // actually y1
579
580 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
581 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
582 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
583
584 // sunken arrow
585
586 x = fWidth - 6 - fBorderWidth - 2;
587 y = (fHeight - 4) / 2 + 1;
588
589 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
591 }
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Draw small triangle.
596
598{
599 Point_t points[3];
600
601#ifdef R__HAS_COCOA
602 points[0].fX = x;
603 points[0].fY = y;
604 points[1].fX = x + 6;
605 points[1].fY = y;
606 points[2].fX = x + 3;
607 points[2].fY = y + 3;
608#else
609 points[0].fX = x;
610 points[0].fY = y;
611 points[1].fX = x + 5;
612 points[1].fY = y;
613 points[2].fX = x + 2;
614 points[2].fY = y + 3;
615#endif
616
617 gVirtualX->FillPolygon(fId, gc, points, 3);
618}
619
620
621////////////////////////////////////////////////////////////////////////////////
622/// Create and pop up pattern select window.
623
625 : TGedSelect(p, id)
626{
627 fPattern = pattern;
628 SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
630}
631
632////////////////////////////////////////////////////////////////////////////////
633/// Process message according to the user input.
634
646
647////////////////////////////////////////////////////////////////////////////////
648/// Draw selected pattern as current one.
649
651{
653
654 Int_t x, y;
655 UInt_t w, h;
656
657 if (IsEnabled()) { // pattern rectangle
658
659 x = fBorderWidth + 2;
660 y = fBorderWidth + 2; // 1;
661 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
662 w = h * 2;
663 if (fState == kButtonDown) { ++x; ++y; }
664
665#ifdef R__HAS_COCOA
667
669 gClient->GetColorByName("white", white); // white background
671 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
672
673 if (fPattern != 0) {
676 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
677 }
678
679 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
680#else
681 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
682
684
686 gClient->GetColorByName("white", white); // white background
688 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
689
690 if (fPattern != 0) {
693 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
694 }
695#endif
696 } else { // sunken rectangle
697
698 x = fBorderWidth + 2;
699 y = fBorderWidth + 2; // 1;
700 w = 42;
701 h = fHeight - (fBorderWidth * 2) - 4; // 3;
703 }
704}
705
706////////////////////////////////////////////////////////////////////////////////
707/// Set pattern.
708
710{
711 fPattern = pattern;
712 gClient->NeedRedraw(this);
713 if (emit)
715}
716
717////////////////////////////////////////////////////////////////////////////////
718/// Save the pattern select widget as a C++ statement(s) on output stream out
719
720void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
721{
722 out <<" TGedPatternSelect *";
723 out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
724 << "," << fPattern << "," << WidgetId() << ");" << std::endl;
725}
@ kButtonRelease
Definition GuiTypes.h:61
@ kButtonPress
Definition GuiTypes.h:61
@ kEnterNotify
Definition GuiTypes.h:62
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:150
const Mask_t kGCBackground
Definition GuiTypes.h:290
const Mask_t kGCForeground
Definition GuiTypes.h:289
const Mask_t kGCLineStyle
Definition GuiTypes.h:292
const Mask_t kGCLineWidth
Definition GuiTypes.h:291
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:31
const Mask_t kButtonPressMask
Definition GuiTypes.h:162
const Mask_t kGCFillStyle
Definition GuiTypes.h:295
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kWASaveUnder
Definition GuiTypes.h:151
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:39
const Mask_t kPointerMotionMask
Definition GuiTypes.h:164
@ kRaisedFrame
Definition GuiTypes.h:385
@ kSunkenFrame
Definition GuiTypes.h:384
@ kDoubleBorder
Definition GuiTypes.h:386
@ kOwnBackground
Definition GuiTypes.h:392
const Handle_t kNone
Definition GuiTypes.h:89
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:169
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:167
@ kFillStippled
Definition GuiTypes.h:52
@ kFillSolid
Definition GuiTypes.h:52
@ kLineSolid
Definition GuiTypes.h:49
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:163
const Mask_t kEnterWindowMask
Definition GuiTypes.h:168
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
@ kButton1
Definition GuiTypes.h:215
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
const unsigned char gStipples[26][32]
Definition RStipples.h:24
short Style_t
Style number (short)
Definition RtypesCore.h:96
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kLHintsNoHints
Definition TGLayout.h:23
@ kLHintsCenterX
Definition TGLayout.h:25
@ kWidgetIsEnabled
Definition TGWidget.h:37
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t TranslateCoordinates
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t width
Option_t Option_t style
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
#define gVirtualX
Definition TVirtualX.h:377
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kPAT_SELCHANGED
@ kC_PATTERNSEL
@ kPAT_CLICK
@ kPOP_HIDE
@ kC_POPUP
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition civetweb.c:1579
EButtonState fState
button state
Definition TGButton.h:75
Selects different options.
Definition TGButton.h:264
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
EButtonState fPrevState
previous check button state
Definition TGButton.h:272
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition TGClient.cxx:336
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:124
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:993
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1110
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:314
TGFrame * GetFrameFromPoint(Int_t x, Int_t y) override
Get frame located at specified point.
Definition TGFrame.cxx:1301
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:960
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1157
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1250
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:332
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:622
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:728
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:598
UInt_t fHeight
frame height
Definition TGFrame.h:88
virtual void Draw3dRectangle(UInt_t type, Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw 3D rectangle on the frame border.
Definition TGFrame.cxx:350
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:305
void DoRedraw() override
Redraw the frame.
Definition TGFrame.cxx:423
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:748
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:638
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:758
UInt_t fWidth
frame width
Definition TGFrame.h:87
virtual Bool_t HandleButton(Event_t *)
Definition TGFrame.h:163
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:768
void MapRaised() override
map raised
Definition TGFrame.h:207
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
GContext_t GetGC() const
Definition TGGC.h:41
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:270
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
This is a layout manager for the TGListView widget.
Definition TGLayout.h:303
A tooltip can be a one or multiple lines help text that is displayed in a window when the mouse curso...
Definition TGToolTip.h:24
void Hide()
Hide tool tip window.
void Reset()
Reset tool tip popup delay timer.
Int_t fWidgetId
the widget id (used for event processing)
Definition TGWidget.h:46
Bool_t HasFocus() const
Definition TGWidget.h:70
Int_t ClearFlags(Int_t flags)
Definition TGWidget.h:59
Int_t SetFlags(Int_t flags)
Definition TGWidget.h:58
const TGWindow * fMsgWindow
window which handles widget events
Definition TGWidget.h:48
Bool_t IsEnabled() const
Definition TGWidget.h:69
Int_t WidgetId() const
Definition TGWidget.h:68
Bool_t WantFocus() const
Definition TGWidget.h:71
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:334
The TGedPatternFrame is a small frame with border showing a specific pattern (fill style.
void SetActive(Bool_t in)
Bool_t HandleCrossing(Event_t *event) override
Handle mouse crossing event.
const TGWindow * fMsgWindow
Bool_t HandleButton(Event_t *event) override
Handle mouse button event.
void DrawBorder() override
Draw border.
static void SetFillStyle(TGGC *gc, Style_t fstyle)
Set fill area style.
TGToolTip * fTip
tool tip associated with a button
TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width=40, Int_t height=20)
Pattern select ctor.
void DoRedraw() override
Redraw selected pattern.
The TGedPatternPopup is a popup containing a TGedPatternSelector.
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by pattern popup window.
~TGedPatternPopup() override
Destructor of pattern popup window.
void DoRedraw() override
Draw selected pattern as current one.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process message according to the user input.
TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id)
Create and pop up pattern select window.
virtual void PatternSelected(Style_t pattern=0)
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save the pattern select widget as a C++ statement(s) on output stream out.
The TGedPatternSelector is a composite frame with TGedPatternFrames of all diferent styles.
void SetActive(Int_t newat)
Set selected the current style.
TGedPatternSelector(const TGWindow *p)
Create pattern popup window.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process message generated by pattern popup window.
const TGWindow * fMsgWindow
~TGedPatternSelector() override
Delete pattern popup window.
TGedPatternFrame * fCe[27]
is a popup window.
void EndPopup()
Ungrab pointer and unmap popup window.
const TGWindow * fMsgWindow
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by popup window.
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Place popup window at the specified place.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in popup window.
TGedPopup(const TGWindow *p, const TGWindow *m, UInt_t w, UInt_t h, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
Create a popup frame.
is button that shows popup window when clicked.
void DoRedraw() override
Draw separator and arrow.
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw small triangle.
TGedSelect(const TGWindow *p, Int_t id)
Create pattern select button.
TGedPopup * fPopup
virtual void Enable()
Set widget state flag (kTRUE=enabled, kFALSE=disabled).
~TGedSelect() override
Destructor of pattern select button.
Bool_t HandleButton(Event_t *event) override
Handle mouse button events in pattern select button.
virtual void Disable()
Clear widget state flag.
virtual void SetPopup(TGedPopup *p)
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
@ kHintTooltip
Definition TVirtualX.h:53
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 fX
Definition GuiTypes.h:179
UInt_t fCode
key or button code
Definition GuiTypes.h:181
Graphics context structure.
Definition GuiTypes.h:225
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:357
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:94
TMarker m
Definition textangle.C:8