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
317}
318
319////////////////////////////////////////////////////////////////////////////////
320/// Ungrab pointer and unmap popup window.
321
323{
324 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
325 UnmapWindow();
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Place popup window at the specified place.
330
332{
333 Int_t rx, ry;
334 UInt_t rw, rh;
335
336 // Parent is root window for the popup:
337 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
338
339 if (gVirtualX->InheritsFrom("TGWin32")) {
340 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
341 x = rw - abs(rx) - fWidth;
342 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
343 y = rh - fHeight;
344 } else {
345 if (x < 0) x = 0;
346 if (x + fWidth > rw) x = rw - fWidth;
347 if (y < 0) y = 0;
348 if (y + fHeight > rh) y = rh - fHeight;
349 }
350
351 MoveResize(x, y, w, h);
353 Layout();
354 MapRaised();
355
358 fClient->GetResourcePool()->GetGrabCursor());
359 gClient->WaitForUnmap(this);
360 EndPopup();
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// Handle mouse button event in popup window.
365
367{
368 if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
369 (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
370
371 if (event->fType == kButtonRelease) EndPopup();
372
373 } else {
374 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
375 if (f && f != this) {
376 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
377 f->HandleButton(event);
378 }
379 }
380 return kTRUE;
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Process messages generated by popup window.
385
387{
388 switch (GET_MSG(msg)) {
389 case kC_POPUP:
390 switch (GET_SUBMSG(msg)) {
391 case kPOP_HIDE:
392 EndPopup();
394 parm1, parm2);
395 break;
396 default:
397 break;
398 }
399 break;
400 }
401 return kTRUE;
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// Pattern popup constructor.
406
409 GetDefaultFrameBackground())
410{
411 fCurrentPattern = pattern;
412
414 AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
415
417 Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
418}
419
420////////////////////////////////////////////////////////////////////////////////
421/// Destructor of pattern popup window.
422
427
428////////////////////////////////////////////////////////////////////////////////
429/// Process messages generated by pattern popup window.
430
432{
433 switch (GET_MSG(msg)) {
434 case kC_PATTERNSEL:
435 switch (GET_SUBMSG(msg)) {
436 case kPAT_SELCHANGED:
438 parm1, parm2);
439 UnmapWindow();
440 break;
441
442 default:
443 break;
444 }
445 break;
446 }
447 return kTRUE;
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// Create pattern select button.
452
454 : TGCheckButton(p, "", id)
455{
456 fPopup = 0;
457
461 gcv.fLineStyle = kLineSolid;
462 gcv.fLineWidth = 0;
463 gcv.fFillStyle = 0;
465 gClient->GetColorByName("white", white); // white background
466 gcv.fBackground = white;
467 gcv.fForeground = 0; // black foreground
469
470 Enable();
473}
474
475////////////////////////////////////////////////////////////////////////////////
476/// Destructor of pattern select button.
477
479{
480 if (fPopup)
481 delete fPopup;
483}
484
485////////////////////////////////////////////////////////////////////////////////
486/// Handle mouse button events in pattern select button.
487
489{
491
492 if (!IsEnabled()) return kTRUE;
493
494 if (event->fCode != kButton1) return kFALSE;
495
496 if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
497
498 if (event->fType == kButtonPress) {
499 if (fState != kButtonDown) {
502 }
503 } else {
504 if (fState != kButtonUp) {
507 Int_t ax, ay;
508 if (fPopup) {
509 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
510 0, fHeight, ax, ay, wdummy);
511#ifdef R__HAS_COCOA
512 gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
513#endif
516 }
517 }
518 }
519 return kTRUE;
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
524
530
531////////////////////////////////////////////////////////////////////////////////
532/// Clear widget state flag.
533
539
540////////////////////////////////////////////////////////////////////////////////
541/// Draw separator and arrow.
542
544{
545 Int_t x, y;
546 UInt_t h;
547
549
550 if (IsEnabled()) {
551
552 // separator
553 x = fWidth - 6 - fBorderWidth - 6;
554 y = fBorderWidth + 1;
555 h = fHeight - fBorderWidth - 1; // actually y1
556
557 if (fState == kButtonDown) { ++x; ++y; }
558
559 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
560 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
561 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
562
563 // arrow
564
565 x = fWidth - 6 - fBorderWidth - 2;
566 y = (fHeight - 4) / 2 + 1;
567
568 if (fState == kButtonDown) { ++x; ++y; }
569
570 DrawTriangle(GetBlackGC()(), x, y);
571
572 } else {
573
574 // separator
575 x = fWidth - 6 - fBorderWidth - 6;
576 y = fBorderWidth + 1;
577 h = fHeight - fBorderWidth - 1; // actually y1
578
579 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
580 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
581 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
582
583 // sunken arrow
584
585 x = fWidth - 6 - fBorderWidth - 2;
586 y = (fHeight - 4) / 2 + 1;
587
588 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
590 }
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Draw small triangle.
595
597{
598 Point_t points[3];
599
600#ifdef R__HAS_COCOA
601 points[0].fX = x;
602 points[0].fY = y;
603 points[1].fX = x + 6;
604 points[1].fY = y;
605 points[2].fX = x + 3;
606 points[2].fY = y + 3;
607#else
608 points[0].fX = x;
609 points[0].fY = y;
610 points[1].fX = x + 5;
611 points[1].fY = y;
612 points[2].fX = x + 2;
613 points[2].fY = y + 3;
614#endif
615
616 gVirtualX->FillPolygon(fId, gc, points, 3);
617}
618
619
620////////////////////////////////////////////////////////////////////////////////
621/// Create and pop up pattern select window.
622
624 : TGedSelect(p, id)
625{
626 fPattern = pattern;
627 SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
629}
630
631////////////////////////////////////////////////////////////////////////////////
632/// Process message according to the user input.
633
645
646////////////////////////////////////////////////////////////////////////////////
647/// Draw selected pattern as current one.
648
650{
652
653 Int_t x, y;
654 UInt_t w, h;
655
656 if (IsEnabled()) { // pattern rectangle
657
658 x = fBorderWidth + 2;
659 y = fBorderWidth + 2; // 1;
660 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
661 w = h * 2;
662 if (fState == kButtonDown) { ++x; ++y; }
663
664#ifdef R__HAS_COCOA
666
668 gClient->GetColorByName("white", white); // white background
670 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
671
672 if (fPattern != 0) {
675 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
676 }
677
678 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
679#else
680 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
681
683
685 gClient->GetColorByName("white", white); // white background
687 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
688
689 if (fPattern != 0) {
692 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
693 }
694#endif
695 } else { // sunken rectangle
696
697 x = fBorderWidth + 2;
698 y = fBorderWidth + 2; // 1;
699 w = 42;
700 h = fHeight - (fBorderWidth * 2) - 4; // 3;
702 }
703}
704
705////////////////////////////////////////////////////////////////////////////////
706/// Set pattern.
707
709{
710 fPattern = pattern;
711 gClient->NeedRedraw(this);
712 if (emit)
714}
715
716////////////////////////////////////////////////////////////////////////////////
717/// Save the pattern select widget as a C++ statement(s) on output stream out
718
719void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
720{
721 out <<" TGedPatternSelect *";
722 out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
723 << "," << fPattern << "," << WidgetId() << ");" << std::endl;
724}
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
@ kEnterNotify
Definition GuiTypes.h:61
const Mask_t kWAOverrideRedirect
Definition GuiTypes.h:149
const Mask_t kGCBackground
Definition GuiTypes.h:289
const Mask_t kGCForeground
Definition GuiTypes.h:288
const Mask_t kGCLineStyle
Definition GuiTypes.h:291
const Mask_t kGCLineWidth
Definition GuiTypes.h:290
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kGCFillStyle
Definition GuiTypes.h:294
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kWASaveUnder
Definition GuiTypes.h:150
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kOwnBackground
Definition GuiTypes.h:391
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
@ kFillStippled
Definition GuiTypes.h:51
@ kFillSolid
Definition GuiTypes.h:51
@ kLineSolid
Definition GuiTypes.h:48
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton1
Definition GuiTypes.h:214
#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:337
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:992
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
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:1300
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
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: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
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:349
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 DoRedraw() override
Redraw the frame.
Definition TGFrame.cxx:422
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:747
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:637
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:757
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:767
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:277
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
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
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Graphics context structure.
Definition GuiTypes.h:224
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:356
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93
TMarker m
Definition textangle.C:8