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//////////////////////////////////////////////////////////////////////////
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 "RStipples.h"
47#include "TVirtualX.h"
48#include "snprintf.h"
49
50#include <iostream>
51
58
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Pattern select ctor.
64
66 int width, int height)
67 : TGFrame(p, width, height, kOwnBackground)
68{
69 Pixel_t white;
70 gClient->GetColorByName("white", white); // white background
71 SetBackgroundColor(white);
72
73 // special case: solid
74 if (pattern == 1001)
75 SetBackgroundColor(0); // if solid then black
76
77 fPattern = pattern;
78
80 fMsgWindow = p;
82 snprintf(fTipText, sizeof(fTipText), "%d", pattern);
83
84 // solid and hollow must be treated separately
85 if (pattern != 0 && pattern != 1001)
86 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, fTipText, 1000);
87 else if (pattern == 0)
88 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "0 - hollow", 1000);
89 else // pattern == 1001
90 fTip = new TGToolTip(fClient->GetDefaultRoot(), this, "1001 - solid", 1000);
91
93
94 if (!fgGC) {
95 GCValues_t gcv;
99 gcv.fLineWidth = 0;
100 gcv.fFillStyle = 0;
101 gcv.fBackground = white;
102 gcv.fForeground = 0; // black foreground
103 fgGC = gClient->GetGC(&gcv, kTRUE);
104 }
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// Handle mouse crossing event.
109
111{
112 if (fTip) {
113 if (event->fType == kEnterNotify)
114 fTip->Reset();
115 else
116 fTip->Hide();
117 }
118 return kTRUE;
119}
120
121////////////////////////////////////////////////////////////////////////////////
122/// Handle mouse button event.
123
125{
126 if (event->fType == kButtonPress) {
128 } else { // kButtonRelease
130 }
131
132 return kTRUE;
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Draw border.
137
139{
140 gVirtualX->DrawRectangle(fId, GetBckgndGC()(), 0, 0, fWidth, fHeight);
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// Redraw selected pattern.
146
148{
150
151 if (fPattern > 3000 && fPattern < 3026) {
153 gVirtualX->FillRectangle(fId, fgGC->GetGC(), 0, 0, fWidth, fHeight);
154 }
155 DrawBorder();
156}
157
158////////////////////////////////////////////////////////////////////////////////
159/// Set fill area style.
160/// fstyle : compound fill area interior style
161/// fstyle = 1000*interiorstyle + styleindex
162/// this function should be in TGGC !!!
163
165{
166 Int_t style = fstyle/1000;
167 Int_t fasi = fstyle%1000;
168 Int_t stn = (fasi >= 1 && fasi <=25) ? fasi : 2;
169
170 static Pixmap_t fillPattern = 0;
171
172 switch (style) {
173 case 1: // solid
175 break;
176 case 2: // pattern
177 break;
178 case 3: // hatch
180 if (fillPattern != 0) {
181 gVirtualX->DeletePixmap(fillPattern);
182 fillPattern = 0;
183 }
184#ifdef R__WIN32
185 char pattern[32];
186 // invert (flip) gStipples bitmap bits on Windows
187 for (int i=0;i<32;++i)
188 pattern[i] = ~gStipples[stn][i];
189 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
190 (const char *)&pattern, 16, 16);
191#else
192 fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
193 (const char*)gStipples[stn], 16, 16);
194#endif
195 gc->SetStipple(fillPattern);
196 break;
197 default:
198 break;
199 }
200}
201
202////////////////////////////////////////////////////////////////////////////////
203/// Create pattern popup window.
204
206 TGCompositeFrame(p, 124, 190)
207{
208 SetLayoutManager(new TGTileLayout(this, 1));
209
210 Int_t i;
211 for (i = 1; i <= 25; i++)
212 fCe[i-1] = new TGedPatternFrame(this, 3000 + i);
213
214 fCe[25] = new TGedPatternFrame(this, 0);
215 fCe[26] = new TGedPatternFrame(this, 1001);
216
217 for (i = 0; i < 27; i++)
219
220 fMsgWindow = p;
221 fActive = -1;
222}
223
224////////////////////////////////////////////////////////////////////////////////
225/// Delete pattern popup window.
226
228{
229 Cleanup();
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Set selected the current style.
234
236{
237 if (fActive != newat) {
238 if ((fActive >= 0) && (fActive < 27)) {
240 }
241 fActive = newat;
242 if ((fActive >= 0) && (fActive < 27)) {
244 }
245 }
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// Process message generated by pattern popup window.
250
252{
253 switch (GET_MSG(msg)) {
254 case kC_PATTERNSEL:
255 switch (GET_SUBMSG(msg)) {
256 case kPAT_SELCHANGED:
257 switch (parm1) {
258 case kButton1:
260 kPAT_SELCHANGED), parm1, parm2);
261 break;
262 }
263 break;
264 case kPAT_CLICK:
265 switch (parm1) {
266 case kButton1:
267 SetActive(parm2);
268 break;
269 }
270 break;
271 }
272 }
273
274 return kTRUE;
275}
276
277////////////////////////////////////////////////////////////////////////////////
278/// Create a popup frame.
279
281 UInt_t options, Pixel_t back)
282 : TGCompositeFrame(p, w, h, options, back)
283{
284 fMsgWindow = m;
286
288 wattr.fOverrideRedirect = kTRUE;
289 wattr.fSaveUnder = kTRUE;
290 gVirtualX->ChangeWindowAttributes(fId, &wattr);
291
293}
294
295////////////////////////////////////////////////////////////////////////////////
296/// Ungrab pointer and unmap popup window.
297
299{
300 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
301 UnmapWindow();
302}
303
304////////////////////////////////////////////////////////////////////////////////
305/// Place popup window at the specified place.
306
308{
309 Int_t rx, ry;
310 UInt_t rw, rh;
311
312 // Parent is root window for the popup:
313 gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
314
315 if (gVirtualX->InheritsFrom("TGWin32")) {
316 if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
317 x = rw - abs(rx) - fWidth;
318 if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
319 y = rh - fHeight;
320 } else {
321 if (x < 0) x = 0;
322 if (x + fWidth > rw) x = rw - fWidth;
323 if (y < 0) y = 0;
324 if (y + fHeight > rh) y = rh - fHeight;
325 }
326
327 MoveResize(x, y, w, h);
329 Layout();
330 MapRaised();
331
335 gClient->WaitForUnmap(this);
336 EndPopup();
337}
338
339////////////////////////////////////////////////////////////////////////////////
340/// Handle mouse button event in popup window.
341
343{
344 if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
345 (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
346
347 if (event->fType == kButtonRelease) EndPopup();
348
349 } else {
350 TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
351 if (f && f != this) {
352 TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
353 f->HandleButton(event);
354 }
355 }
356 return kTRUE;
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Process messages generated by popup window.
361
363{
364 switch (GET_MSG(msg)) {
365 case kC_POPUP:
366 switch (GET_SUBMSG(msg)) {
367 case kPOP_HIDE:
368 EndPopup();
370 parm1, parm2);
371 break;
372 default:
373 break;
374 }
375 break;
376 }
377 return kTRUE;
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Pattern popup constructor.
382
385 GetDefaultFrameBackground())
386{
387 fCurrentPattern = pattern;
388
390 AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
391
393 Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
394}
395
396////////////////////////////////////////////////////////////////////////////////
397/// Destructor of pattern popup window.
398
400{
401 Cleanup();
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// Process messages generated by pattern popup window.
406
408{
409 switch (GET_MSG(msg)) {
410 case kC_PATTERNSEL:
411 switch (GET_SUBMSG(msg)) {
412 case kPAT_SELCHANGED:
414 parm1, parm2);
415 UnmapWindow();
416 break;
417
418 default:
419 break;
420 }
421 break;
422 }
423 return kTRUE;
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Create pattern select button.
428
430 : TGCheckButton(p, "", id)
431{
432 fPopup = 0;
433
434 GCValues_t gcv;
438 gcv.fLineWidth = 0;
439 gcv.fFillStyle = 0;
440 Pixel_t white;
441 gClient->GetColorByName("white", white); // white background
442 gcv.fBackground = white;
443 gcv.fForeground = 0; // black foreground
444 fDrawGC = gClient->GetGC(&gcv, kTRUE);
445
446 Enable();
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Destructor of pattern select button.
453
455{
456 if (fPopup)
457 delete fPopup;
459}
460
461////////////////////////////////////////////////////////////////////////////////
462/// Handle mouse button events in pattern select button.
463
465{
467
468 if (!IsEnabled()) return kTRUE;
469
470 if (event->fCode != kButton1) return kFALSE;
471
472 if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
473
474 if (event->fType == kButtonPress) {
475 if (fState != kButtonDown) {
478 }
479 } else {
480 if (fState != kButtonUp) {
482 Window_t wdummy;
483 Int_t ax, ay;
484 if (fPopup) {
485 gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
486 0, fHeight, ax, ay, wdummy);
487#ifdef R__HAS_COCOA
488 gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
489#endif
492 }
493 }
494 }
495 return kTRUE;
496}
497
498////////////////////////////////////////////////////////////////////////////////
499/// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
500
502{
504 fClient->NeedRedraw(this);
505}
506
507////////////////////////////////////////////////////////////////////////////////
508/// Clear widget state flag.
509
511{
513 fClient->NeedRedraw(this);
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// Draw separator and arrow.
518
520{
521 Int_t x, y;
522 UInt_t h;
523
525
526 if (IsEnabled()) {
527
528 // separator
529 x = fWidth - 6 - fBorderWidth - 6;
530 y = fBorderWidth + 1;
531 h = fHeight - fBorderWidth - 1; // actually y1
532
533 if (fState == kButtonDown) { ++x; ++y; }
534
535 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
536 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
537 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
538
539 // arrow
540
541 x = fWidth - 6 - fBorderWidth - 2;
542 y = (fHeight - 4) / 2 + 1;
543
544 if (fState == kButtonDown) { ++x; ++y; }
545
546 DrawTriangle(GetBlackGC()(), x, y);
547
548 } else {
549
550 // separator
551 x = fWidth - 6 - fBorderWidth - 6;
552 y = fBorderWidth + 1;
553 h = fHeight - fBorderWidth - 1; // actually y1
554
555 gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
556 gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
557 gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
558
559 // sunken arrow
560
561 x = fWidth - 6 - fBorderWidth - 2;
562 y = (fHeight - 4) / 2 + 1;
563
564 DrawTriangle(GetHilightGC()(), x + 1, y + 1);
566 }
567}
568
569////////////////////////////////////////////////////////////////////////////////
570/// Draw small triangle.
571
573{
574 Point_t points[3];
575
576#ifdef R__HAS_COCOA
577 points[0].fX = x;
578 points[0].fY = y;
579 points[1].fX = x + 6;
580 points[1].fY = y;
581 points[2].fX = x + 3;
582 points[2].fY = y + 3;
583#else
584 points[0].fX = x;
585 points[0].fY = y;
586 points[1].fX = x + 5;
587 points[1].fY = y;
588 points[2].fX = x + 2;
589 points[2].fY = y + 3;
590#endif
591
592 gVirtualX->FillPolygon(fId, gc, points, 3);
593}
594
595
596////////////////////////////////////////////////////////////////////////////////
597/// Create and pop up pattern select window.
598
600 : TGedSelect(p, id)
601{
602 fPattern = pattern;
603 SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Process message according to the user input.
609
611{
612 if (GET_MSG(msg) == kC_PATTERNSEL && GET_SUBMSG(msg) == kPAT_SELCHANGED)
613 {
614 SetPattern(parm2);
615 parm1 = (Long_t)fWidgetId;
617 parm1, parm2);
618 }
619 return kTRUE;
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Draw selected pattern as current one.
624
626{
628
629 Int_t x, y;
630 UInt_t w, h;
631
632 if (IsEnabled()) { // pattern rectangle
633
634 x = fBorderWidth + 2;
635 y = fBorderWidth + 2; // 1;
636 h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
637 w = h * 2;
638 if (fState == kButtonDown) { ++x; ++y; }
639
640#ifdef R__HAS_COCOA
642
643 Pixel_t white;
644 gClient->GetColorByName("white", white); // white background
645 fDrawGC->SetForeground(white);
646 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
647
648 if (fPattern != 0) {
651 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
652 }
653
654 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
655#else
656 gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
657
659
660 Pixel_t white;
661 gClient->GetColorByName("white", white); // white background
662 fDrawGC->SetForeground(white);
663 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
664
665 if (fPattern != 0) {
668 gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
669 }
670#endif
671 } else { // sunken rectangle
672
673 x = fBorderWidth + 2;
674 y = fBorderWidth + 2; // 1;
675 w = 42;
676 h = fHeight - (fBorderWidth * 2) - 4; // 3;
678 }
679}
680
681////////////////////////////////////////////////////////////////////////////////
682/// Set pattern.
683
685{
686 fPattern = pattern;
687 gClient->NeedRedraw(this);
688 if (emit)
690}
691
692////////////////////////////////////////////////////////////////////////////////
693/// Save the pattern select widget as a C++ statement(s) on output stream out
694
695void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
696{
697 out <<" TGedPatternSelect *";
698 out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
699 << "," << fPattern << "," << WidgetId() << ");" << std::endl;
700}
@ 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
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
short Style_t
Definition RtypesCore.h:80
const Bool_t kTRUE
Definition RtypesCore.h:91
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:166
@ kLHintsNoHints
Definition TGLayout.h:30
@ kLHintsCenterX
Definition TGLayout.h:32
@ kWidgetIsEnabled
Definition TGWidget.h:47
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
Definition TGButton.h:75
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
EButtonState fPrevState
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:327
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:133
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:985
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition TGFrame.cxx:1293
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:348
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:952
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
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:1317
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:350
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:324
virtual void DoRedraw()
Redraw the frame.
Definition TGFrame.cxx:415
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:720
virtual void MapRaised()
map raised
Definition TGFrame.h:229
UInt_t fHeight
Definition TGFrame.h:112
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:342
Int_t fBorderWidth
Definition TGFrame.h:117
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:740
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:297
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition TGFrame.cxx:630
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:750
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
UInt_t fWidth
Definition TGFrame.h:111
virtual Bool_t HandleButton(Event_t *)
Definition TGFrame.h:185
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:614
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:760
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
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:344
void SetForeground(Pixel_t v)
Set foreground color.
Definition TGGC.cxx:277
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Definition TGGC.cxx:377
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.
void Reset()
Reset tool tip popup delay timer.
Int_t fWidgetId
Definition TGWidget.h:56
Bool_t HasFocus() const
Definition TGWidget.h:80
Int_t ClearFlags(Int_t flags)
Definition TGWidget.h:69
Int_t SetFlags(Int_t flags)
Definition TGWidget.h:68
const TGWindow * fMsgWindow
Definition TGWidget.h:58
Bool_t IsEnabled() const
Definition TGWidget.h:79
Int_t WidgetId() const
Definition TGWidget.h:78
Bool_t WantFocus() const
Definition TGWidget.h:81
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
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.
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
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
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