Logo ROOT  
Reference Guide
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//////////////////////////////////////////////////////////////////////////
14// //
15// TGedPatternFrame, TGedPatternSelector, TGedPatternPopup //
16// and TGedPatternColor //
17// //
18// The TGedPatternFrame is a small frame with border showing //
19// a specific pattern (fill style. //
20// //
21// The TGedPatternSelector is a composite frame with TGedPatternFrames //
22// of all diferent styles //
23// //
24// The TGedPatternPopup is a popup containing a TGedPatternSelector. //
25// //
26// The TGedPatternSelect widget is a button with pattern area with //
27// a little down arrow. When clicked on the arrow the //
28// TGedPatternPopup pops up. //
29// //
30// Selecting a pattern in this widget will generate the event: //
31// kC_PATTERNSEL, kPAT_SELCHANGED, widget id, style. //
32// //
33// and the signal: //
34// PatternSelected(Style_t pattern) //
35// //
36// TGedSelect is button that shows popup window when clicked. //
37// TGedPopup is a popup window. //
38// //
39//////////////////////////////////////////////////////////////////////////
40
41#include "TGResourcePool.h"
42#include "TGedPatternSelect.h"
43#include "RConfigure.h"
44#include "TGToolTip.h"
45#include "TGButton.h"
46#include "Riostream.h"
47#include "RStipples.h"
48#include "TVirtualX.h"
49
56
58
59
60////////////////////////////////////////////////////////////////////////////////
61/// Pattern select ctor.
62
64 int width, int height)
65 : TGFrame(p, width, height, kOwnBackground)
66{
67 Pixel_t white;
68 gClient->GetColorByName("white", white); // white background
69 SetBackgroundColor(white);
70
71 // special case: solid
72 if (pattern == 1001)
73 SetBackgroundColor(0); // if solid then black
74
76
78 fMsgWindow = p;
80 snprintf(fTipText, sizeof(fTipText), "%d", pattern);
81
82 // solid and hollow must be treated separately
83 if (pattern != 0 && pattern != 1001)
84 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, fTipText, 1000);
85 else if (pattern == 0)
86 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "0 - hollow", 1000);
87 else // pattern == 1001
88 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "1001 - solid", 1000);
89
91
92 if (!fgGC) {
93 GCValues_t gcv;
97 gcv.fLineWidth = 0;
98 gcv.fFillStyle = 0;
99 gcv.fBackground = white;
100 gcv.fForeground = 0; // black foreground
101 fgGC = gClient->GetGC(&gcv, kTRUE);
102 }
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Handle mouse crossing event.
107
109{
110 if (fTip) {
111 if (event->fType == kEnterNotify)
112 fTip->Reset();
113 else
114 fTip->Hide();
115 }
116 return kTRUE;
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Handle mouse button event.
121
123{
124 if (event->fType == kButtonPress) {
126 } else { // kButtonRelease
128 }
129
130 return kTRUE;
131}
132
133////////////////////////////////////////////////////////////////////////////////
134/// Draw border.
135
137{
138 gVirtualX->DrawRectangle(fId, GetBckgndGC()(), 0, 0, fWidth, fHeight);
140}
141
142////////////////////////////////////////////////////////////////////////////////
143/// Redraw selected pattern.
144
146{
148
149 if (fPattern > 3000 && fPattern < 3026) {
151 gVirtualX->FillRectangle(fId, fgGC->GetGC(), 0, 0, fWidth, fHeight);
152 }
153 DrawBorder();
154}
155
156////////////////////////////////////////////////////////////////////////////////
157/// Set fill area style.
158/// fstyle : compound fill area interior style
159/// fstyle = 1000*interiorstyle + styleindex
160/// this function should be in TGGC !!!
161
163{
164 Int_t style = fstyle/1000;
165 Int_t fasi = fstyle%1000;
166 Int_t stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
167
168 static Pixmap_t fillPattern = 0;
169
170 switch (style) {
171 case 1: // solid
173 break;
174 case 2: // pattern
175 break;
176 case 3: // hatch
178 if (fillPattern != 0) {
179 gVirtualX->DeletePixmap(fillPattern);
180 fillPattern = 0;
181 }
182 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
183 (const char*)gStipples[stn], 16, 16);
184 gc->SetStipple(fillPattern);
185 break;
186 default:
187 break;
188 }
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Create pattern popup window.
193
195 TGCompositeFrame(p, 124, 190)
196{
197 SetLayoutManager(new TGTileLayout(this, 1));
198
199 Int_t i;
200 for (i = 1; i <= 25; i++)
201 fCe[i-1] = new TGedPatternFrame(this, 3000 + i);
202
203 fCe[25] = new TGedPatternFrame(this, 0);
204 fCe[26] = new TGedPatternFrame(this, 1001);
205
206 for (i = 0; i < 27; i++)
208
209 fMsgWindow = p;
210 fActive = -1;
211}
212
213////////////////////////////////////////////////////////////////////////////////
214/// Delete pattern popup window.
215
217{
218 Cleanup();
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Set selected the current style.
223
225{
226 if (fActive != newat) {
227 if ((fActive >= 0) && (fActive < 27)) {
229 }
230 fActive = newat;
231 if ((fActive >= 0) && (fActive < 27)) {
233 }
234 }
235}
236
237////////////////////////////////////////////////////////////////////////////////
238/// Process message generated by pattern popup window.
239
241{
242 switch (GET_MSG(msg)) {
243 case kC_PATTERNSEL:
244 switch (GET_SUBMSG(msg)) {
245 case kPAT_SELCHANGED:
246 switch (parm1) {
247 case kButton1:
249 kPAT_SELCHANGED), parm1, parm2);
250 break;
251 }
252 break;
253 case kPAT_CLICK:
254 switch (parm1) {
255 case kButton1:
256 SetActive(parm2);
257 break;
258 }
259 break;
260 }
261 }
262
263 return kTRUE;
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// Create a popup frame.
268
270 UInt_t options, Pixel_t back)
271 : TGCompositeFrame(p, w, h, options, back)
272{
273 fMsgWindow = m;
275
277 wattr.fOverrideRedirect = kTRUE;
278 wattr.fSaveUnder = kTRUE;
279 gVirtualX->ChangeWindowAttributes(fId, &wattr);
280
282}
283
284////////////////////////////////////////////////////////////////////////////////
285/// Ungrab pointer and unmap popup window.
286
288{
289 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
290 UnmapWindow();
291}
292
293////////////////////////////////////////////////////////////////////////////////
294/// Place popup window at the specified place.
295
297{
298 Int_t rx, ry;
299 UInt_t rw, rh;
300
301 // Parent is root window for the popup:
302 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
303
304 if (gVirtualX->InheritsFrom("TGWin32")) {
305 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
306 x = rw - abs(rx) - fWidth;
307 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
308 y = rh - fHeight;
309 } else {
310 if (x < 0) x = 0;
311 if (x + fWidth > rw) x = rw - fWidth;
312 if (y < 0) y = 0;
313 if (y + fHeight > rh) y = rh - fHeight;
314 }
315
316 MoveResize(x, y, w, h);
318 Layout();
319 MapRaised();
320
324 gClient->WaitForUnmap(this);
325 EndPopup();
326}
327
328////////////////////////////////////////////////////////////////////////////////
329/// Handle mouse button event in popup window.
330
332{
333 if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
334 (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
335
336 if (event->fType == kButtonRelease) EndPopup();
337
338 } else {
339 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
340 if (f && f != this) {
341 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
342 f->HandleButton(event);
343 }
344 }
345 return kTRUE;
346}
347
348////////////////////////////////////////////////////////////////////////////////
349/// Process messages generated by popup window.
350
352{
353 switch (GET_MSG(msg)) {
354 case kC_POPUP:
355 switch (GET_SUBMSG(msg)) {
356 case kPOP_HIDE:
357 EndPopup();
359 parm1, parm2);
360 break;
361 default:
362 break;
363 }
364 break;
365 }
366 return kTRUE;
367}
368
369////////////////////////////////////////////////////////////////////////////////
370/// Pattern popup constructor.
371
374 GetDefaultFrameBackground())
375{
377
379 AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
380
382 Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
383}
384
385////////////////////////////////////////////////////////////////////////////////
386/// Destructor of pattern popup window.
387
389{
390 Cleanup();
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// Process messages generated by pattern popup window.
395
397{
398 switch (GET_MSG(msg)) {
399 case kC_PATTERNSEL:
400 switch (GET_SUBMSG(msg)) {
401 case kPAT_SELCHANGED:
403 parm1, parm2);
404 UnmapWindow();
405 break;
406
407 default:
408 break;
409 }
410 break;
411 }
412 return kTRUE;
413}
414
415////////////////////////////////////////////////////////////////////////////////
416/// Create pattern select button.
417
419 : TGCheckButton(p, "", id)
420{
421 fPopup = 0;
422
423 GCValues_t gcv;
427 gcv.fLineWidth = 0;
428 gcv.fFillStyle = 0;
429 Pixel_t white;
430 gClient->GetColorByName("white", white); // white background
431 gcv.fBackground = white;
432 gcv.fForeground = 0; // black foreground
433 fDrawGC = gClient->GetGC(&gcv, kTRUE);
434
435 Enable();
438}
439
440////////////////////////////////////////////////////////////////////////////////
441/// Destructor of pattern select button.
442
444{
445 if (fPopup)
446 delete fPopup;
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// Handle mouse button events in pattern select button.
452
454{
456
457 if (!IsEnabled()) return kTRUE;
458
459 if (event->fCode != kButton1) return kFALSE;
460
461 if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
462
463 if (event->fType == kButtonPress) {
464 if (fState != kButtonDown) {
467 }
468 } else {
469 if (fState != kButtonUp) {
471 Window_t wdummy;
472 Int_t ax, ay;
473 if (fPopup) {
474 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
475 0, fHeight, ax, ay, wdummy);
476#ifdef R__HAS_COCOA
477 gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
478#endif
481 }
482 }
483 }
484 return kTRUE;
485}
486
487////////////////////////////////////////////////////////////////////////////////
488/// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
489
491{
493 fClient->NeedRedraw(this);
494}
495
496////////////////////////////////////////////////////////////////////////////////
497/// Clear widget state flag.
498
500{
502 fClient->NeedRedraw(this);
503}
504
505////////////////////////////////////////////////////////////////////////////////
506/// Draw separator and arrow.
507
509{
510 Int_t x, y;
511 UInt_t h;
512
514
515 if (IsEnabled()) {
516
517 // separator
518 x = fWidth - 6 - fBorderWidth - 6;
519 y = fBorderWidth + 1;
520 h = fHeight - fBorderWidth - 1; // actually y1
521
522 if (fState == kButtonDown) { ++x; ++y; }
523
524 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
525 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
526 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
527
528 // arrow
529
530 x = fWidth - 6 - fBorderWidth - 2;
531 y = (fHeight - 4) / 2 + 1;
532
533 if (fState == kButtonDown) { ++x; ++y; }
534
535 DrawTriangle(GetBlackGC()(), x, y);
536
537 } else {
538
539 // separator
540 x = fWidth - 6 - fBorderWidth - 6;
541 y = fBorderWidth + 1;
542 h = fHeight - fBorderWidth - 1; // actually y1
543
544 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
545 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
546 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
547
548 // sunken arrow
549
550 x = fWidth - 6 - fBorderWidth - 2;
551 y = (fHeight - 4) / 2 + 1;
552
553 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
555 }
556}
557
558////////////////////////////////////////////////////////////////////////////////
559/// Draw small triangle.
560
562{
563 Point_t points[3];
564
565#ifdef R__HAS_COCOA
566 points[0].fX = x;
567 points[0].fY = y;
568 points[1].fX = x + 6;
569 points[1].fY = y;
570 points[2].fX = x + 3;
571 points[2].fY = y + 3;
572#else
573 points[0].fX = x;
574 points[0].fY = y;
575 points[1].fX = x + 5;
576 points[1].fY = y;
577 points[2].fX = x + 2;
578 points[2].fY = y + 3;
579#endif
580
581 gVirtualX->FillPolygon(fId, gc, points, 3);
582}
583
584
585////////////////////////////////////////////////////////////////////////////////
586/// Create and pop up pattern select window.
587
589 : TGedSelect(p, id)
590{
592 SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
594}
595
596////////////////////////////////////////////////////////////////////////////////
597/// Process message according to the user input.
598
600{
601 if (GET_MSG(msg) == kC_PATTERNSEL && GET_SUBMSG(msg) == kPAT_SELCHANGED)
602 {
603 SetPattern(parm2);
604 parm1 = (Long_t)fWidgetId;
606 parm1, parm2);
607 }
608 return kTRUE;
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// Draw selected pattern as current one.
613
615{
617
618 Int_t x, y;
619 UInt_t w, h;
620
621 if (IsEnabled()) { // pattern rectangle
622
623 x = fBorderWidth + 2;
624 y = fBorderWidth + 2; // 1;
625 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
626 w = h * 2;
627 if (fState == kButtonDown) { ++x; ++y; }
628
629#ifdef R__HAS_COCOA
631
632 Pixel_t white;
633 gClient->GetColorByName("white", white); // white background
634 fDrawGC->SetForeground(white);
635 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
636
637 if (fPattern != 0) {
640 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
641 }
642
643 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
644#else
645 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
646
648
649 Pixel_t white;
650 gClient->GetColorByName("white", white); // white background
651 fDrawGC->SetForeground(white);
652 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
653
654 if (fPattern != 0) {
657 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
658 }
659#endif
660 } else { // sunken rectangle
661
662 x = fBorderWidth + 2;
663 y = fBorderWidth + 2; // 1;
664 w = 42;
665 h = fHeight - (fBorderWidth * 2) - 4; // 3;
667 }
668}
669
670////////////////////////////////////////////////////////////////////////////////
671/// Set pattern.
672
674{
676 gClient->NeedRedraw(this);
677 if (emit)
679}
680
681////////////////////////////////////////////////////////////////////////////////
682/// Save the pattern select widget as a C++ statement(s) on output stream out
683
684void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
685{
686 out <<" TGedPatternSelect *";
687 out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
688 << "," << fPattern << "," << WidgetId() << ");" << std::endl;
689}
@ kButtonRelease
Definition: GuiTypes.h:59
@ kButtonPress
Definition: GuiTypes.h:59
@ kEnterNotify
Definition: GuiTypes.h:60
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:148
const Mask_t kGCBackground
Definition: GuiTypes.h:288
const Mask_t kGCForeground
Definition: GuiTypes.h:287
const Mask_t kGCLineStyle
Definition: GuiTypes.h:290
const Mask_t kGCLineWidth
Definition: GuiTypes.h:289
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
const Mask_t kGCFillStyle
Definition: GuiTypes.h:293
const Mask_t kWASaveUnder
Definition: GuiTypes.h:149
Handle_t Pixmap_t
Definition: GuiTypes.h:29
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
@ 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:87
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
@ kFillStippled
Definition: GuiTypes.h:50
@ kFillSolid
Definition: GuiTypes.h:50
@ kLineSolid
Definition: GuiTypes.h:47
Handle_t GContext_t
Definition: GuiTypes.h:37
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
ULong_t Pixel_t
Definition: GuiTypes.h:39
@ kButton1
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
const unsigned char gStipples[26][32]
Definition: RStipples.h:26
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
short Style_t
Definition: RtypesCore.h:78
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kButtonDown
Definition: TGButton.h:54
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:166
@ kLHintsNoHints
Definition: TGLayout.h:30
@ kLHintsCenterX
Definition: TGLayout.h:32
@ kWidgetIsEnabled
Definition: TGWidget.h:48
XFontStruct * id
Definition: TGX11.cxx:108
#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
Definition: TGButton.h:75
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1202
EButtonState fPrevState
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:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:984
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition: TGFrame.cxx:1292
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
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:1316
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:323
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:414
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:719
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
UInt_t fHeight
Definition: TGFrame.h:113
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:341
Int_t fBorderWidth
Definition: TGFrame.h:118
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:739
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:629
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:749
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t fWidth
Definition: TGFrame.h:112
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:186
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:613
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:759
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
Definition: TGGC.h:31
GContext_t GetGC() const
Definition: TGGC.h:50
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition: TGGC.cxx:343
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:276
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Definition: TGGC.cxx:376
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
Cursor_t GetGrabCursor() const
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:247
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:260
Int_t fWidgetId
Definition: TGWidget.h:58
Bool_t HasFocus() const
Definition: TGWidget.h:82
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:71
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:70
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
Bool_t IsEnabled() const
Definition: TGWidget.h:81
Int_t WidgetId() const
Definition: TGWidget.h:80
Bool_t WantFocus() const
Definition: TGWidget.h:83
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:326
const TGWindow * fParent
Definition: TGWindow.h:36
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.
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.
static TGGC * fgGC
virtual void DoRedraw()
Redraw selected pattern.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by pattern popup window.
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
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.
TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id)
Create and pop up pattern select window.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message according to the user input.
virtual void PatternSelected(Style_t pattern=0)
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
void SetActive(Int_t newat)
Set selected the current style.
TGedPatternSelector(const TGWindow *p)
Create pattern popup window.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message generated by pattern popup window.
const TGWindow * fMsgWindow
virtual ~TGedPatternSelector()
Delete pattern popup window.
TGedPatternFrame * fCe[27]
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(Long_t msg, Long_t parm1, Long_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.
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
static const std::string pattern("pattern")
static constexpr double ps
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
Int_t fX
Definition: GuiTypes.h:177
UInt_t fCode
Definition: GuiTypes.h:179
ULong_t fBackground
Definition: GuiTypes.h:227
Int_t fLineWidth
Definition: GuiTypes.h:228
Mask_t fMask
Definition: GuiTypes.h:250
Int_t fLineStyle
Definition: GuiTypes.h:229
ULong_t fForeground
Definition: GuiTypes.h:226
Int_t fFillStyle
Definition: GuiTypes.h:233
Bool_t fOverrideRedirect
Definition: GuiTypes.h:106
TCanvas * style()
Definition: style.C:1
auto * m
Definition: textangle.C:8