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 /** \class TGedPatternFrame,
14  \ingroup ged
15 
16 The TGedPatternFrame is a small frame with border showing
17 a specific pattern (fill style.
18 
19 */
20 
21 
22 /** \class TGedPatternSelector,
23  \ingroup ged
24 
25 The TGedPatternSelector is a composite frame with TGedPatternFrames
26 of all diferent styles
27 
28 */
29 
30 
31 /** \class TGedPatternPopup
32  \ingroup ged
33 
34 The TGedPatternPopup is a popup containing a TGedPatternSelector.
35 
36 */
37 
38 
39 /** \class TGedPatternSelect
40  \ingroup ged
41 
42 is a button with pattern area with
43 a little down arrow. When clicked on the arrow the
44 TGedPatternPopup pops up.
45 
46 Selecting a pattern in this widget will generate the event:
47 kC_PATTERNSEL, kPAT_SELCHANGED, widget id, style.
48 
49 and the signal:
50 PatternSelected(Style_t pattern)
51 
52 */
53 
54 
55 /** \class TGedSelect
56  \ingroup ged
57 
58 is button that shows popup window when clicked.
59 
60 */
61 
62 
63 /** \class TGedPopup
64  \ingroup ged
65 
66 is 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 
89 TGGC* TGedPatternFrame::fgGC = nullptr;
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;
128  gcv.fLineStyle = kLineSolid;
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;
315  SetWindowAttributes_t wattr;
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);
358  MapSubwindows();
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 {
380  TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
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 {
418 
420  AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
421 
422  MapSubwindows();
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;
467  gcv.fLineStyle = kLineSolid;
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) {
506  fPrevState = fState;
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);
595  DrawTriangle(GetShadowGC()(), x, y);
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 = (Long_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 
725 void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
726 {
727  out <<" TGedPatternSelect *";
728  out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
729  << "," << fPattern << "," << WidgetId() << ");" << std::endl;
730 }
TGedPatternFrame::TGedPatternFrame
TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width=40, Int_t height=20)
Pattern select ctor.
Definition: TGedPatternSelect.cxx:95
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:236
m
auto * m
Definition: textangle.C:8
TGedSelect::fDrawGC
TGGC * fDrawGC
Definition: TGedPatternSelect.h:101
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:110
SetWindowAttributes_t::fSaveUnder
Bool_t fSaveUnder
should bits under be saved (popups)?
Definition: GuiTypes.h:104
TGFrame::Draw3dRectangle
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
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kLHintsCenterX
@ kLHintsCenterX
Definition: TGLayout.h:25
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
Pixmap_t
Handle_t Pixmap_t
Pixmap handle.
Definition: GuiTypes.h:30
TGedPopup::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in popup window.
Definition: TGedPatternSelect.cxx:372
Style_t
short Style_t
Definition: RtypesCore.h:89
TGedPatternSelector::fCe
TGedPatternFrame * fCe[27]
Definition: TGedPatternSelect.h:71
TGedPopup::PlacePopup
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Place popup window at the specified place.
Definition: TGedPatternSelect.cxx:337
snprintf
#define snprintf
Definition: civetweb.c:1540
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:41
f
#define f(i)
Definition: RSha256.hxx:104
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
Option_t
const char Option_t
Definition: RtypesCore.h:66
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
TGedPatternSelect::SetPattern
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
Definition: TGedPatternSelect.cxx:714
kLineSolid
@ kLineSolid
Definition: GuiTypes.h:48
TGedSelect::Enable
virtual void Enable()
Set widget state flag (kTRUE=enabled, kFALSE=disabled).
Definition: TGedPatternSelect.cxx:531
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
kFillStippled
@ kFillStippled
Definition: GuiTypes.h:51
TGedPatternSelector::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:70
TGedPatternFrame::DrawBorder
virtual void DrawBorder()
Draw border.
Definition: TGedPatternSelect.cxx:168
Point_t
Point structure (maps to the X11 XPoint structure)
Definition: GuiTypes.h:356
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGCompositeFrame::GetFrameFromPoint
virtual TGFrame * GetFrameFromPoint(Int_t x, Int_t y)
Get frame located at specified point.
Definition: TGFrame.cxx:1308
TGedPatternPopup::TGedPatternPopup
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
Definition: TGedPatternSelect.cxx:413
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
TGedPopup::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:23
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:967
GCValues_t
Graphics context structure.
Definition: GuiTypes.h:224
TGedSelect::DrawTriangle
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw small triangle.
Definition: TGedPatternSelect.cxx:602
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGedSelect::DoRedraw
virtual void DoRedraw()
Draw separator and arrow.
Definition: TGedPatternSelect.cxx:549
TGGC::SetFillStyle
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition: TGGC.cxx:345
TGedPatternSelect::TGedPatternSelect
TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id)
Create and pop up pattern select window.
Definition: TGedPatternSelect.cxx:629
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGedPatternFrame::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGedPatternSelect.cxx:154
TGedPopup::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by popup window.
Definition: TGedPatternSelect.cxx:392
TGFrame::HandleButton
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:161
TGedSelect::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in pattern select button.
Definition: TGedPatternSelect.cxx:494
TGedPatternSelector::SetActive
void SetActive(Int_t newat)
Set selected the current style.
Definition: TGedPatternSelect.cxx:265
kFillSolid
@ kFillSolid
Definition: GuiTypes.h:51
GCValues_t::fFillStyle
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Definition: GuiTypes.h:234
TGeant4Unit::ps
static constexpr double ps
Definition: TGeant4SystemOfUnits.h:165
TGedPatternFrame::fPattern
Style_t fPattern
Definition: TGedPatternSelect.h:43
TGedPopup::EndPopup
void EndPopup()
Ungrab pointer and unmap popup window.
Definition: TGedPatternSelect.cxx:328
event
Definition: triangle.c:553
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:61
x
Double_t x[n]
Definition: legend1.C:17
kC_PATTERNSEL
@ kC_PATTERNSEL
Definition: WidgetMessageTypes.h:78
TGToolTip
Definition: TGToolTip.h:24
kButton1
@ kButton1
Definition: GuiTypes.h:214
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:162
TGedPatternSelector::TGedPatternSelector
TGedPatternSelector(const TGWindow *p)
Create pattern popup window.
Definition: TGedPatternSelect.cxx:235
TVirtualX.h
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:124
kPOP_HIDE
@ kPOP_HIDE
Definition: WidgetMessageTypes.h:85
TGWidget::WantFocus
Bool_t WantFocus() const
Definition: TGWidget.h:71
kPAT_SELCHANGED
@ kPAT_SELCHANGED
Definition: WidgetMessageTypes.h:80
gStipples
const unsigned char gStipples[26][32]
Definition: RStipples.h:24
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
TGedPopup
is a popup window.
Definition: TGedPatternSelect.h:20
SetWindowAttributes_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:110
TGedPatternSelect::fPattern
Style_t fPattern
Definition: TGedPatternSelect.h:123
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
TGedPatternFrame::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGedPatternSelect.cxx:140
bool
TGedPatternFrame::SetFillStyle
static void SetFillStyle(TGGC *gc, Style_t fstyle)
Set fill area style.
Definition: TGedPatternSelect.cxx:194
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:168
kGCLineStyle
const Mask_t kGCLineStyle
Definition: GuiTypes.h:291
TGWidget::HasFocus
Bool_t HasFocus() const
Definition: TGWidget.h:70
id
XFontStruct * id
Definition: TGX11.cxx:109
kWASaveUnder
const Mask_t kWASaveUnder
Definition: GuiTypes.h:150
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
gClient
#define gClient
Definition: TGClient.h:157
style
TCanvas * style()
Definition: style.C:1
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
TGedSelect::~TGedSelect
virtual ~TGedSelect()
Destructor of pattern select button.
Definition: TGedPatternSelect.cxx:484
kNone
const Handle_t kNone
Definition: GuiTypes.h:88
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
TGedPatternFrame::fActive
Bool_t fActive
Definition: TGedPatternSelect.h:42
TGToolTip::Reset
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:263
TGedPatternSelect
is a button with pattern area with a little down arrow.
Definition: TGedPatternSelect.h:120
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGedPatternFrame::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:41
RStipples.h
kGCFillStyle
const Mask_t kGCFillStyle
Definition: GuiTypes.h:294
h
#define h(i)
Definition: RSha256.hxx:106
TGedPatternSelect::DoRedraw
virtual void DoRedraw()
Draw selected pattern as current one.
Definition: TGedPatternSelect.cxx:655
TGWidget::WidgetId
Int_t WidgetId() const
Definition: TGWidget.h:68
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
window which handles widget events
Definition: TGWidget.h:48
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGedPatternSelector::~TGedPatternSelector
virtual ~TGedPatternSelector()
Delete pattern popup window.
Definition: TGedPatternSelect.cxx:257
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
SetWindowAttributes_t::fOverrideRedirect
Bool_t fOverrideRedirect
boolean value for override-redirect
Definition: GuiTypes.h:107
TGedPatternFrame::fTipText
char fTipText[7]
Definition: TGedPatternSelect.h:46
TGGC
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
TGCompositeFrame::TranslateCoordinates
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
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
GCValues_t::fLineStyle
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Definition: GuiTypes.h:230
kGCForeground
const Mask_t kGCForeground
Definition: GuiTypes.h:288
TGFrame::fBorderWidth
Int_t fBorderWidth
frame border width
Definition: TGFrame.h:93
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:37
Long_t
long Long_t
Definition: RtypesCore.h:54
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TGWidget::IsEnabled
Bool_t IsEnabled() const
Definition: TGWidget.h:69
TGedPopup::TGedPopup
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.
Definition: TGedPatternSelect.cxx:310
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:60
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGedPatternFrame::SetActive
void SetActive(Bool_t in)
Definition: TGedPatternSelect.h:59
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:205
GCValues_t::fBackground
ULong_t fBackground
background pixel
Definition: GuiTypes.h:228
TGedPatternPopup::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by pattern popup window.
Definition: TGedPatternSelect.cxx:437
kGCLineWidth
const Mask_t kGCLineWidth
Definition: GuiTypes.h:290
Window_t
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
kC_POPUP
@ kC_POPUP
Definition: WidgetMessageTypes.h:84
y
Double_t y[n]
Definition: legend1.C:17
TGedPatternSelector::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message generated by pattern popup window.
Definition: TGedPatternSelect.cxx:281
TGedPatternSelector::fActive
Int_t fActive
Definition: TGedPatternSelect.h:69
kGCBackground
const Mask_t kGCBackground
Definition: GuiTypes.h:289
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
TGedPatternPopup::fCurrentPattern
Style_t fCurrentPattern
Definition: TGedPatternSelect.h:87
TGCompositeFrame::SetLayoutManager
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:1000
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGTileLayout
This is a layout manager for the TGListView widget.
Definition: TGLayout.h:303
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:314
TGedPatternSelect::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process message according to the user input.
Definition: TGedPatternSelect.cxx:640
kLHintsNoHints
@ kLHintsNoHints
Definition: TGLayout.h:23
TGedPatternSelect::PatternSelected
virtual void PatternSelected(Style_t pattern=0)
Definition: TGedPatternSelect.h:134
TGWidget::fWidgetId
Int_t fWidgetId
the widget id (used for event processing)
Definition: TGWidget.h:46
TGWidget::ClearFlags
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:59
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
TGedPatternFrame::fTip
TGToolTip * fTip
tool tip associated with a button
Definition: TGedPatternSelect.h:45
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
TGedPatternSelect.h
GCValues_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:251
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGFrame::MoveResize
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
points
point * points
Definition: X3DBuffer.c:22
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:278
TGedPatternSelector
The TGedPatternSelector is a composite frame with TGedPatternFrames of all diferent styles.
Definition: TGedPatternSelect.h:66
TGToolTip.h
TGButton.h
TGButton::fState
EButtonState fState
button state
Definition: TGButton.h:75
Event_t
Event structure.
Definition: GuiTypes.h:174
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:111
GCValues_t::fForeground
ULong_t fForeground
foreground pixel
Definition: GuiTypes.h:227
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
TGedSelect::SetPopup
virtual void SetPopup(TGedPopup *p)
Definition: TGedPatternSelect.h:115
TGedPatternFrame::DoRedraw
virtual void DoRedraw()
Redraw selected pattern.
Definition: TGedPatternSelect.cxx:177
TGWidget::SetFlags
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:58
TGResourcePool.h
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
TGedPatternPopup::~TGedPatternPopup
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
Definition: TGedPatternSelect.cxx:429
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
kPAT_CLICK
@ kPAT_CLICK
Definition: WidgetMessageTypes.h:79
kEnterWindowMask
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:167
TGCompositeFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:312
kWAOverrideRedirect
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:149
TGedSelect
is button that shows popup window when clicked.
Definition: TGedPatternSelect.h:98
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGedPatternFrame::fgGC
static TGGC * fgGC
Definition: TGedPatternSelect.h:44
TGCheckButton::fPrevState
EButtonState fPrevState
previous check button state
Definition: TGButton.h:272
TGToolTip::Hide
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:250
TGedSelect::Disable
virtual void Disable()
Clear widget state flag.
Definition: TGedPatternSelect.cxx:540
TGedSelect::TGedSelect
TGedSelect(const TGWindow *p, Int_t id)
Create pattern select button.
Definition: TGedPatternSelect.cxx:459
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
TGedPatternFrame
The TGedPatternFrame is a small frame with border showing a specific pattern (fill style.
Definition: TGedPatternSelect.h:38
TGedSelect::fPopup
TGedPopup * fPopup
Definition: TGedPatternSelect.h:102
TGedPatternPopup
The TGedPatternPopup is a popup containing a TGedPatternSelector.
Definition: TGedPatternSelect.h:84
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:108
TGWindow::fParent
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
TGedPatternSelect::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the pattern select widget as a C++ statement(s) on output stream out.
Definition: TGedPatternSelect.cxx:725
ROOT::TMetaUtils::propNames::pattern
static const std::string pattern("pattern")
GCValues_t::fLineWidth
Int_t fLineWidth
line width
Definition: GuiTypes.h:229
int
SetWindowAttributes_t
Attributes that can be used when creating or changing a window.
Definition: GuiTypes.h:93
TGGC::SetStipple
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Definition: TGGC.cxx:378
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:430
TGClient::FreeGC
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition: TGClient.cxx:330