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
88
90
91
92////////////////////////////////////////////////////////////////////////////////
93/// Pattern select ctor.
94
96 int width, int height)
97 : TGFrame(p, width, height, kOwnBackground)
98{
99 Pixel_t white;
100 gClient->GetColorByName("white", white); // white background
101 SetBackgroundColor(white);
102
103 // special case: solid
104 if (pattern == 1001)
105 SetBackgroundColor(0); // if solid then black
106
107 fPattern = pattern;
108
110 fMsgWindow = p;
111 fActive = kFALSE;
112 snprintf(fTipText, sizeof(fTipText), "%d", pattern);
113
114 // solid and hollow must be treated separately
115 if (pattern != 0 && pattern != 1001)
116 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, fTipText, 1000);
117 else if (pattern == 0)
118 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "0 - hollow", 1000);
119 else // pattern == 1001
120 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "1001 - solid", 1000);
121
123
124 if (!fgGC) {
125 GCValues_t gcv;
129 gcv.fLineWidth = 0;
130 gcv.fFillStyle = 0;
131 gcv.fBackground = white;
132 gcv.fForeground = 0; // black foreground
133 fgGC = gClient->GetGC(&gcv, kTRUE);
134 }
135}
136
137////////////////////////////////////////////////////////////////////////////////
138/// Handle mouse crossing event.
139
141{
142 if (fTip) {
143 if (event->fType == kEnterNotify)
144 fTip->Reset();
145 else
146 fTip->Hide();
147 }
148 return kTRUE;
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Handle mouse button event.
153
155{
156 if (event->fType == kButtonPress) {
158 } else { // kButtonRelease
160 }
161
162 return kTRUE;
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Draw border.
167
169{
170 gVirtualX->DrawRectangle(fId, GetBckgndGC()(), 0, 0, fWidth, fHeight);
172}
173
174////////////////////////////////////////////////////////////////////////////////
175/// Redraw selected pattern.
176
178{
180
181 if (fPattern > 3000 && fPattern < 3026) {
183 gVirtualX->FillRectangle(fId, fgGC->GetGC(), 0, 0, fWidth, fHeight);
184 }
185 DrawBorder();
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Set fill area style.
190/// fstyle : compound fill area interior style
191/// fstyle = 1000*interiorstyle + styleindex
192/// this function should be in TGGC !!!
193
195{
196 Int_t style = fstyle/1000;
197 Int_t fasi = fstyle%1000;
198 Int_t stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
199
200 static Pixmap_t fillPattern = 0;
201
202 switch (style) {
203 case 1: // solid
205 break;
206 case 2: // pattern
207 break;
208 case 3: // hatch
210 if (fillPattern != 0) {
211 gVirtualX->DeletePixmap(fillPattern);
212 fillPattern = 0;
213 }
214#ifdef R__WIN32
215 char pattern[32];
216 // invert (flip) gStipples bitmap bits on Windows
217 for (int i=0;i<32;++i)
218 pattern[i] = ~gStipples[stn][i];
219 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
220 (const char *)&pattern, 16, 16);
221#else
222 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
223 (const char*)gStipples[stn], 16, 16);
224#endif
225 gc->SetStipple(fillPattern);
226 break;
227 default:
228 break;
229 }
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Create pattern popup window.
234
236 TGCompositeFrame(p, 124, 190)
237{
238 SetLayoutManager(new TGTileLayout(this, 1));
239
240 Int_t i;
241 for (i = 1; i <= 25; i++)
242 fCe[i-1] = new TGedPatternFrame(this, 3000 + i);
243
244 fCe[25] = new TGedPatternFrame(this, 0);
245 fCe[26] = new TGedPatternFrame(this, 1001);
246
247 for (i = 0; i < 27; i++)
249
250 fMsgWindow = p;
251 fActive = -1;
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Delete pattern popup window.
256
258{
259 Cleanup();
260}
261
262////////////////////////////////////////////////////////////////////////////////
263/// Set selected the current style.
264
266{
267 if (fActive != newat) {
268 if ((fActive >= 0) && (fActive < 27)) {
270 }
271 fActive = newat;
272 if ((fActive >= 0) && (fActive < 27)) {
274 }
275 }
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Process message generated by pattern popup window.
280
282{
283 switch (GET_MSG(msg)) {
284 case kC_PATTERNSEL:
285 switch (GET_SUBMSG(msg)) {
286 case kPAT_SELCHANGED:
287 switch (parm1) {
288 case kButton1:
290 kPAT_SELCHANGED), parm1, parm2);
291 break;
292 }
293 break;
294 case kPAT_CLICK:
295 switch (parm1) {
296 case kButton1:
297 SetActive(parm2);
298 break;
299 }
300 break;
301 }
302 }
303
304 return kTRUE;
305}
306
307////////////////////////////////////////////////////////////////////////////////
308/// Create a popup frame.
309
311 UInt_t options, Pixel_t back)
312 : TGCompositeFrame(p, w, h, options, back)
313{
314 fMsgWindow = m;
316
318 wattr.fOverrideRedirect = kTRUE;
319 wattr.fSaveUnder = kTRUE;
320 gVirtualX->ChangeWindowAttributes(fId, &wattr);
321
323}
324
325////////////////////////////////////////////////////////////////////////////////
326/// Ungrab pointer and unmap popup window.
327
329{
330 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
331 UnmapWindow();
332}
333
334////////////////////////////////////////////////////////////////////////////////
335/// Place popup window at the specified place.
336
338{
339 Int_t rx, ry;
340 UInt_t rw, rh;
341
342 // Parent is root window for the popup:
343 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
344
345 if (gVirtualX->InheritsFrom("TGWin32")) {
346 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
347 x = rw - abs(rx) - fWidth;
348 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
349 y = rh - fHeight;
350 } else {
351 if (x < 0) x = 0;
352 if (x + fWidth > rw) x = rw - fWidth;
353 if (y < 0) y = 0;
354 if (y + fHeight > rh) y = rh - fHeight;
355 }
356
357 MoveResize(x, y, w, h);
359 Layout();
360 MapRaised();
361
365 gClient->WaitForUnmap(this);
366 EndPopup();
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Handle mouse button event in popup window.
371
373{
374 if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
375 (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
376
377 if (event->fType == kButtonRelease) EndPopup();
378
379 } else {
381 if (f && f != this) {
382 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
383 f->HandleButton(event);
384 }
385 }
386 return kTRUE;
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Process messages generated by popup window.
391
393{
394 switch (GET_MSG(msg)) {
395 case kC_POPUP:
396 switch (GET_SUBMSG(msg)) {
397 case kPOP_HIDE:
398 EndPopup();
400 parm1, parm2);
401 break;
402 default:
403 break;
404 }
405 break;
406 }
407 return kTRUE;
408}
409
410////////////////////////////////////////////////////////////////////////////////
411/// Pattern popup constructor.
412
415 GetDefaultFrameBackground())
416{
417 fCurrentPattern = pattern;
418
420 AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
421
423 Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Destructor of pattern popup window.
428
430{
431 Cleanup();
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Process messages generated by pattern popup window.
436
438{
439 switch (GET_MSG(msg)) {
440 case kC_PATTERNSEL:
441 switch (GET_SUBMSG(msg)) {
442 case kPAT_SELCHANGED:
444 parm1, parm2);
445 UnmapWindow();
446 break;
447
448 default:
449 break;
450 }
451 break;
452 }
453 return kTRUE;
454}
455
456////////////////////////////////////////////////////////////////////////////////
457/// Create pattern select button.
458
460 : TGCheckButton(p, "", id)
461{
462 fPopup = 0;
463
464 GCValues_t gcv;
468 gcv.fLineWidth = 0;
469 gcv.fFillStyle = 0;
470 Pixel_t white;
471 gClient->GetColorByName("white", white); // white background
472 gcv.fBackground = white;
473 gcv.fForeground = 0; // black foreground
474 fDrawGC = gClient->GetGC(&gcv, kTRUE);
475
476 Enable();
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Destructor of pattern select button.
483
485{
486 if (fPopup)
487 delete fPopup;
489}
490
491////////////////////////////////////////////////////////////////////////////////
492/// Handle mouse button events in pattern select button.
493
495{
497
498 if (!IsEnabled()) return kTRUE;
499
500 if (event->fCode != kButton1) return kFALSE;
501
502 if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
503
504 if (event->fType == kButtonPress) {
505 if (fState != kButtonDown) {
508 }
509 } else {
510 if (fState != kButtonUp) {
512 Window_t wdummy;
513 Int_t ax, ay;
514 if (fPopup) {
515 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
516 0, fHeight, ax, ay, wdummy);
517#ifdef R__HAS_COCOA
518 gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
519#endif
522 }
523 }
524 }
525 return kTRUE;
526}
527
528////////////////////////////////////////////////////////////////////////////////
529/// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
530
532{
534 fClient->NeedRedraw(this);
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Clear widget state flag.
539
541{
543 fClient->NeedRedraw(this);
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// Draw separator and arrow.
548
550{
551 Int_t x, y;
552 UInt_t h;
553
555
556 if (IsEnabled()) {
557
558 // separator
559 x = fWidth - 6 - fBorderWidth - 6;
560 y = fBorderWidth + 1;
561 h = fHeight - fBorderWidth - 1; // actually y1
562
563 if (fState == kButtonDown) { ++x; ++y; }
564
565 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
566 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
567 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
568
569 // arrow
570
571 x = fWidth - 6 - fBorderWidth - 2;
572 y = (fHeight - 4) / 2 + 1;
573
574 if (fState == kButtonDown) { ++x; ++y; }
575
576 DrawTriangle(GetBlackGC()(), x, y);
577
578 } else {
579
580 // separator
581 x = fWidth - 6 - fBorderWidth - 6;
582 y = fBorderWidth + 1;
583 h = fHeight - fBorderWidth - 1; // actually y1
584
585 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
586 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
587 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
588
589 // sunken arrow
590
591 x = fWidth - 6 - fBorderWidth - 2;
592 y = (fHeight - 4) / 2 + 1;
593
594 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
596 }
597}
598
599////////////////////////////////////////////////////////////////////////////////
600/// Draw small triangle.
601
603{
604 Point_t points[3];
605
606#ifdef R__HAS_COCOA
607 points[0].fX = x;
608 points[0].fY = y;
609 points[1].fX = x + 6;
610 points[1].fY = y;
611 points[2].fX = x + 3;
612 points[2].fY = y + 3;
613#else
614 points[0].fX = x;
615 points[0].fY = y;
616 points[1].fX = x + 5;
617 points[1].fY = y;
618 points[2].fX = x + 2;
619 points[2].fY = y + 3;
620#endif
621
622 gVirtualX->FillPolygon(fId, gc, points, 3);
623}
624
625
626////////////////////////////////////////////////////////////////////////////////
627/// Create and pop up pattern select window.
628
630 : TGedSelect(p, id)
631{
632 fPattern = pattern;
633 SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
635}
636
637////////////////////////////////////////////////////////////////////////////////
638/// Process message according to the user input.
639
641{
642 if (GET_MSG(msg) == kC_PATTERNSEL && GET_SUBMSG(msg) == kPAT_SELCHANGED)
643 {
644 SetPattern(parm2);
645 parm1 = (Longptr_t)fWidgetId;
647 parm1, parm2);
648 }
649 return kTRUE;
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// Draw selected pattern as current one.
654
656{
658
659 Int_t x, y;
660 UInt_t w, h;
661
662 if (IsEnabled()) { // pattern rectangle
663
664 x = fBorderWidth + 2;
665 y = fBorderWidth + 2; // 1;
666 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
667 w = h * 2;
668 if (fState == kButtonDown) { ++x; ++y; }
669
670#ifdef R__HAS_COCOA
672
673 Pixel_t white;
674 gClient->GetColorByName("white", white); // white background
675 fDrawGC->SetForeground(white);
676 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
677
678 if (fPattern != 0) {
681 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
682 }
683
684 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
685#else
686 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
687
689
690 Pixel_t white;
691 gClient->GetColorByName("white", white); // white background
692 fDrawGC->SetForeground(white);
693 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
694
695 if (fPattern != 0) {
698 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
699 }
700#endif
701 } else { // sunken rectangle
702
703 x = fBorderWidth + 2;
704 y = fBorderWidth + 2; // 1;
705 w = 42;
706 h = fHeight - (fBorderWidth * 2) - 4; // 3;
708 }
709}
710
711////////////////////////////////////////////////////////////////////////////////
712/// Set pattern.
713
715{
716 fPattern = pattern;
717 gClient->NeedRedraw(this);
718 if (emit)
720}
721
722////////////////////////////////////////////////////////////////////////////////
723/// Save the pattern select widget as a C++ statement(s) on output stream out
724
725void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
726{
727 out <<" TGedPatternSelect *";
728 out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
729 << "," << fPattern << "," << WidgetId() << ");" << std::endl;
730}
@ 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
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kGCFillStyle
Definition GuiTypes.h:294
const Mask_t kWASaveUnder
Definition GuiTypes.h:150
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
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
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
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
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
#define f(i)
Definition RSha256.hxx:104
#define h(i)
Definition RSha256.hxx:106
const unsigned char gStipples[26][32]
Definition RStipples.h:24
long Longptr_t
Definition RtypesCore.h:82
const Bool_t kFALSE
Definition RtypesCore.h:101
short Style_t
Definition RtypesCore.h:89
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
@ 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
XFontStruct * id
Definition TGX11.cxx:109
#define gVirtualX
Definition TVirtualX.h:338
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)
point * points
Definition X3DBuffer.c:22
#define snprintf
Definition civetweb.c:1540
EButtonState fState
button state
Definition TGButton.h:75
Selects different options.
Definition TGButton.h:264
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
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:234
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition TGClient.cxx:328
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:124
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:372
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:1000
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition TGFrame.cxx:1308
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:312
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
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:1332
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1164
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:314
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:339
virtual void DoRedraw()
Redraw the frame.
Definition TGFrame.cxx:430
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:735
virtual void MapRaised()
map raised
Definition TGFrame.h:205
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:357
Int_t fBorderWidth
frame border width
Definition TGFrame.h:93
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:755
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:312
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:645
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:765
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:605
UInt_t fWidth
frame width
Definition TGFrame.h:87
virtual Bool_t HandleButton(Event_t *)
Definition TGFrame.h:161
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition TGFrame.cxx:629
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:775
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:206
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
GContext_t GetGC() const
Definition TGGC.h:41
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition TGGC.cxx:345
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:278
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Definition TGGC.cxx:378
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGClient * fClient
Connection to display server.
Definition TGObject.h:27
Handle_t GetId() const
Definition TGObject.h:37
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:26
Cursor_t GetGrabCursor() const
This is a layout manager for the TGListView widget.
Definition TGLayout.h:303
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
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:336
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
The TGedPatternFrame is a small frame with border showing a specific pattern (fill style.
void SetActive(Bool_t in)
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
const TGWindow * fMsgWindow
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.
virtual void DrawBorder()
Draw border.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
virtual void DoRedraw()
Redraw selected pattern.
The TGedPatternPopup is a popup containing a TGedPatternSelector.
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages generated by pattern popup window.
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
is a button with pattern area with a little down arrow.
virtual void DoRedraw()
Draw selected pattern as current one.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the pattern select widget as a C++ statement(s) on output stream out.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
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.
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.
const TGWindow * fMsgWindow
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process message generated by pattern popup window.
virtual ~TGedPatternSelector()
Delete pattern popup window.
TGedPatternFrame * fCe[27]
is a popup window.
void EndPopup()
Ungrab pointer and unmap popup window.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in popup window.
virtual Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Process messages generated by popup window.
const TGWindow * fMsgWindow
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Place popup window at the specified place.
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.
virtual ~TGedSelect()
Destructor of pattern select button.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in pattern select button.
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).
virtual void Disable()
Clear widget state flag.
virtual void DoRedraw()
Draw separator and arrow.
virtual void SetPopup(TGedPopup *p)
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
Graphics context structure.
Definition GuiTypes.h:224
ULong_t fBackground
background pixel
Definition GuiTypes.h:228
Int_t fLineWidth
line width
Definition GuiTypes.h:229
Mask_t fMask
bit mask specifying which fields are valid
Definition GuiTypes.h:251
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Definition GuiTypes.h:230
ULong_t fForeground
foreground pixel
Definition GuiTypes.h:227
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Definition GuiTypes.h:234
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:356
Short_t fX
Definition GuiTypes.h:357
Attributes that can be used when creating or changing a window.
Definition GuiTypes.h:93
Bool_t fOverrideRedirect
boolean value for override-redirect
Definition GuiTypes.h:107
Mask_t fMask
bit mask specifying which fields are valid
Definition GuiTypes.h:110
Bool_t fSaveUnder
should bits under be saved (popups)?
Definition GuiTypes.h:104
TCanvas * style()
Definition style.C:1
auto * m
Definition textangle.C:8