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 "RStipples.h"
47 #include "TVirtualX.h"
48 #include "snprintf.h"
49 
50 #include <iostream>
51 
58 
59 TGGC* TGedPatternFrame::fgGC = nullptr;
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;
81  fActive = kFALSE;
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;
98  gcv.fLineStyle = kLineSolid;
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  fillPattern = gVirtualX->CreateBitmap(gClient->GetDefaultRoot()->GetId(),
185  (const char*)gStipples[stn], 16, 16);
186  gc->SetStipple(fillPattern);
187  break;
188  default:
189  break;
190  }
191 }
192 
193 ////////////////////////////////////////////////////////////////////////////////
194 /// Create pattern popup window.
195 
197  TGCompositeFrame(p, 124, 190)
198 {
199  SetLayoutManager(new TGTileLayout(this, 1));
200 
201  Int_t i;
202  for (i = 1; i <= 25; i++)
203  fCe[i-1] = new TGedPatternFrame(this, 3000 + i);
204 
205  fCe[25] = new TGedPatternFrame(this, 0);
206  fCe[26] = new TGedPatternFrame(this, 1001);
207 
208  for (i = 0; i < 27; i++)
210 
211  fMsgWindow = p;
212  fActive = -1;
213 }
214 
215 ////////////////////////////////////////////////////////////////////////////////
216 /// Delete pattern popup window.
217 
219 {
220  Cleanup();
221 }
222 
223 ////////////////////////////////////////////////////////////////////////////////
224 /// Set selected the current style.
225 
227 {
228  if (fActive != newat) {
229  if ((fActive >= 0) && (fActive < 27)) {
231  }
232  fActive = newat;
233  if ((fActive >= 0) && (fActive < 27)) {
235  }
236  }
237 }
238 
239 ////////////////////////////////////////////////////////////////////////////////
240 /// Process message generated by pattern popup window.
241 
243 {
244  switch (GET_MSG(msg)) {
245  case kC_PATTERNSEL:
246  switch (GET_SUBMSG(msg)) {
247  case kPAT_SELCHANGED:
248  switch (parm1) {
249  case kButton1:
251  kPAT_SELCHANGED), parm1, parm2);
252  break;
253  }
254  break;
255  case kPAT_CLICK:
256  switch (parm1) {
257  case kButton1:
258  SetActive(parm2);
259  break;
260  }
261  break;
262  }
263  }
264 
265  return kTRUE;
266 }
267 
268 ////////////////////////////////////////////////////////////////////////////////
269 /// Create a popup frame.
270 
272  UInt_t options, Pixel_t back)
273  : TGCompositeFrame(p, w, h, options, back)
274 {
275  fMsgWindow = m;
276  SetWindowAttributes_t wattr;
277 
279  wattr.fOverrideRedirect = kTRUE;
280  wattr.fSaveUnder = kTRUE;
281  gVirtualX->ChangeWindowAttributes(fId, &wattr);
282 
284 }
285 
286 ////////////////////////////////////////////////////////////////////////////////
287 /// Ungrab pointer and unmap popup window.
288 
290 {
291  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
292  UnmapWindow();
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Place popup window at the specified place.
297 
299 {
300  Int_t rx, ry;
301  UInt_t rw, rh;
302 
303  // Parent is root window for the popup:
304  gVirtualX->GetWindowSize(fParent->GetId(), rx, ry, rw, rh);
305 
306  if (gVirtualX->InheritsFrom("TGWin32")) {
307  if ((x > 0) && ((x + abs(rx) + (Int_t)fWidth) > (Int_t)rw))
308  x = rw - abs(rx) - fWidth;
309  if ((y > 0) && (y + abs(ry) + (Int_t)fHeight > (Int_t)rh))
310  y = rh - fHeight;
311  } else {
312  if (x < 0) x = 0;
313  if (x + fWidth > rw) x = rw - fWidth;
314  if (y < 0) y = 0;
315  if (y + fHeight > rh) y = rh - fHeight;
316  }
317 
318  MoveResize(x, y, w, h);
319  MapSubwindows();
320  Layout();
321  MapRaised();
322 
326  gClient->WaitForUnmap(this);
327  EndPopup();
328 }
329 
330 ////////////////////////////////////////////////////////////////////////////////
331 /// Handle mouse button event in popup window.
332 
334 {
335  if ((event->fX < 0) || (event->fX >= (Int_t) fWidth) ||
336  (event->fY < 0) || (event->fY >= (Int_t) fHeight)) {
337 
338  if (event->fType == kButtonRelease) EndPopup();
339 
340  } else {
341  TGFrame *f = GetFrameFromPoint(event->fX, event->fY);
342  if (f && f != this) {
343  TranslateCoordinates(f, event->fX, event->fY, event->fX, event->fY);
344  f->HandleButton(event);
345  }
346  }
347  return kTRUE;
348 }
349 
350 ////////////////////////////////////////////////////////////////////////////////
351 /// Process messages generated by popup window.
352 
354 {
355  switch (GET_MSG(msg)) {
356  case kC_POPUP:
357  switch (GET_SUBMSG(msg)) {
358  case kPOP_HIDE:
359  EndPopup();
361  parm1, parm2);
362  break;
363  default:
364  break;
365  }
366  break;
367  }
368  return kTRUE;
369 }
370 
371 ////////////////////////////////////////////////////////////////////////////////
372 /// Pattern popup constructor.
373 
376  GetDefaultFrameBackground())
377 {
379 
381  AddFrame(ps, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
382 
383  MapSubwindows();
384  Resize(ps->GetDefaultWidth() + 6, ps->GetDefaultHeight());
385 }
386 
387 ////////////////////////////////////////////////////////////////////////////////
388 /// Destructor of pattern popup window.
389 
391 {
392  Cleanup();
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 /// Process messages generated by pattern popup window.
397 
399 {
400  switch (GET_MSG(msg)) {
401  case kC_PATTERNSEL:
402  switch (GET_SUBMSG(msg)) {
403  case kPAT_SELCHANGED:
405  parm1, parm2);
406  UnmapWindow();
407  break;
408 
409  default:
410  break;
411  }
412  break;
413  }
414  return kTRUE;
415 }
416 
417 ////////////////////////////////////////////////////////////////////////////////
418 /// Create pattern select button.
419 
421  : TGCheckButton(p, "", id)
422 {
423  fPopup = 0;
424 
425  GCValues_t gcv;
428  gcv.fLineStyle = kLineSolid;
429  gcv.fLineWidth = 0;
430  gcv.fFillStyle = 0;
431  Pixel_t white;
432  gClient->GetColorByName("white", white); // white background
433  gcv.fBackground = white;
434  gcv.fForeground = 0; // black foreground
435  fDrawGC = gClient->GetGC(&gcv, kTRUE);
436 
437  Enable();
440 }
441 
442 ////////////////////////////////////////////////////////////////////////////////
443 /// Destructor of pattern select button.
444 
446 {
447  if (fPopup)
448  delete fPopup;
450 }
451 
452 ////////////////////////////////////////////////////////////////////////////////
453 /// Handle mouse button events in pattern select button.
454 
456 {
457  TGFrame::HandleButton(event);
458 
459  if (!IsEnabled()) return kTRUE;
460 
461  if (event->fCode != kButton1) return kFALSE;
462 
463  if ((event->fType == kButtonPress) && HasFocus()) WantFocus();
464 
465  if (event->fType == kButtonPress) {
466  if (fState != kButtonDown) {
467  fPrevState = fState;
469  }
470  } else {
471  if (fState != kButtonUp) {
473  Window_t wdummy;
474  Int_t ax, ay;
475  if (fPopup) {
476  gVirtualX->TranslateCoordinates(fId, gClient->GetDefaultRoot()->GetId(),
477  0, fHeight, ax, ay, wdummy);
478 #ifdef R__HAS_COCOA
479  gVirtualX->SetWMTransientHint(fPopup->GetId(), GetId());
480 #endif
483  }
484  }
485  }
486  return kTRUE;
487 }
488 
489 ////////////////////////////////////////////////////////////////////////////////
490 /// Set widget state flag (kTRUE=enabled, kFALSE=disabled).
491 
493 {
495  fClient->NeedRedraw(this);
496 }
497 
498 ////////////////////////////////////////////////////////////////////////////////
499 /// Clear widget state flag.
500 
502 {
504  fClient->NeedRedraw(this);
505 }
506 
507 ////////////////////////////////////////////////////////////////////////////////
508 /// Draw separator and arrow.
509 
511 {
512  Int_t x, y;
513  UInt_t h;
514 
516 
517  if (IsEnabled()) {
518 
519  // separator
520  x = fWidth - 6 - fBorderWidth - 6;
521  y = fBorderWidth + 1;
522  h = fHeight - fBorderWidth - 1; // actually y1
523 
524  if (fState == kButtonDown) { ++x; ++y; }
525 
526  gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
527  gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
528  gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
529 
530  // arrow
531 
532  x = fWidth - 6 - fBorderWidth - 2;
533  y = (fHeight - 4) / 2 + 1;
534 
535  if (fState == kButtonDown) { ++x; ++y; }
536 
537  DrawTriangle(GetBlackGC()(), x, y);
538 
539  } else {
540 
541  // separator
542  x = fWidth - 6 - fBorderWidth - 6;
543  y = fBorderWidth + 1;
544  h = fHeight - fBorderWidth - 1; // actually y1
545 
546  gVirtualX->DrawLine(fId, GetShadowGC()(), x, y, x, h - 2);
547  gVirtualX->DrawLine(fId, GetHilightGC()(), x + 1, y, x + 1, h - 1);
548  gVirtualX->DrawLine(fId, GetHilightGC()(), x, h - 1, x + 1, h - 1);
549 
550  // sunken arrow
551 
552  x = fWidth - 6 - fBorderWidth - 2;
553  y = (fHeight - 4) / 2 + 1;
554 
555  DrawTriangle(GetHilightGC()(), x + 1, y + 1);
556  DrawTriangle(GetShadowGC()(), x, y);
557  }
558 }
559 
560 ////////////////////////////////////////////////////////////////////////////////
561 /// Draw small triangle.
562 
564 {
565  Point_t points[3];
566 
567 #ifdef R__HAS_COCOA
568  points[0].fX = x;
569  points[0].fY = y;
570  points[1].fX = x + 6;
571  points[1].fY = y;
572  points[2].fX = x + 3;
573  points[2].fY = y + 3;
574 #else
575  points[0].fX = x;
576  points[0].fY = y;
577  points[1].fX = x + 5;
578  points[1].fY = y;
579  points[2].fX = x + 2;
580  points[2].fY = y + 3;
581 #endif
582 
583  gVirtualX->FillPolygon(fId, gc, points, 3);
584 }
585 
586 
587 ////////////////////////////////////////////////////////////////////////////////
588 /// Create and pop up pattern select window.
589 
591  : TGedSelect(p, id)
592 {
593  fPattern = pattern;
594  SetPopup(new TGedPatternPopup(gClient->GetDefaultRoot(), this, fPattern));
596 }
597 
598 ////////////////////////////////////////////////////////////////////////////////
599 /// Process message according to the user input.
600 
602 {
603  if (GET_MSG(msg) == kC_PATTERNSEL && GET_SUBMSG(msg) == kPAT_SELCHANGED)
604  {
605  SetPattern(parm2);
606  parm1 = (Long_t)fWidgetId;
608  parm1, parm2);
609  }
610  return kTRUE;
611 }
612 
613 ////////////////////////////////////////////////////////////////////////////////
614 /// Draw selected pattern as current one.
615 
617 {
619 
620  Int_t x, y;
621  UInt_t w, h;
622 
623  if (IsEnabled()) { // pattern rectangle
624 
625  x = fBorderWidth + 2;
626  y = fBorderWidth + 2; // 1;
627  h = fHeight - (fBorderWidth * 2) - 4; // -3; // 14
628  w = h * 2;
629  if (fState == kButtonDown) { ++x; ++y; }
630 
631 #ifdef R__HAS_COCOA
633 
634  Pixel_t white;
635  gClient->GetColorByName("white", white); // white background
636  fDrawGC->SetForeground(white);
637  gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
638 
639  if (fPattern != 0) {
642  gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 1, h - 1);
643  }
644 
645  gVirtualX->DrawRectangle(fId, GetShadowGC()(), x + 1, y + 1, w - 1, h - 1);
646 #else
647  gVirtualX->DrawRectangle(fId, GetShadowGC()(), x, y, w - 1, h - 1);
648 
650 
651  Pixel_t white;
652  gClient->GetColorByName("white", white); // white background
653  fDrawGC->SetForeground(white);
654  gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
655 
656  if (fPattern != 0) {
659  gVirtualX->FillRectangle(fId, fDrawGC->GetGC(), x + 1, y + 1, w - 2, h - 2);
660  }
661 #endif
662  } else { // sunken rectangle
663 
664  x = fBorderWidth + 2;
665  y = fBorderWidth + 2; // 1;
666  w = 42;
667  h = fHeight - (fBorderWidth * 2) - 4; // 3;
669  }
670 }
671 
672 ////////////////////////////////////////////////////////////////////////////////
673 /// Set pattern.
674 
676 {
677  fPattern = pattern;
678  gClient->NeedRedraw(this);
679  if (emit)
681 }
682 
683 ////////////////////////////////////////////////////////////////////////////////
684 /// Save the pattern select widget as a C++ statement(s) on output stream out
685 
686 void TGedPatternSelect::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
687 {
688  out <<" TGedPatternSelect *";
689  out << GetName() << " = new TGedPatternSelect(" << fParent->GetName()
690  << "," << fPattern << "," << WidgetId() << ");" << std::endl;
691 }
TGedPatternFrame::TGedPatternFrame
TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width=40, Int_t height=20)
Pattern select ctor.
Definition: TGedPatternSelect.cxx:65
Event_t::fType
EGEventType fType
Definition: GuiTypes.h:174
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
m
auto * m
Definition: textangle.C:8
TGedSelect::fDrawGC
TGGC * fDrawGC
Definition: TGedPatternSelect.h:128
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:112
SetWindowAttributes_t::fSaveUnder
Bool_t fSaveUnder
Definition: GuiTypes.h:103
Event_t::fY
Int_t fY
Definition: GuiTypes.h:177
Event_t::fX
Int_t fX
Definition: GuiTypes.h:177
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:342
TGWindow
Definition: TGWindow.h:31
kLHintsCenterX
@ kLHintsCenterX
Definition: TGLayout.h:38
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
Pixmap_t
Handle_t Pixmap_t
Definition: GuiTypes.h:29
TGedPopup::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in popup window.
Definition: TGedPatternSelect.cxx:333
Style_t
short Style_t
Definition: RtypesCore.h:80
TGedPatternSelector::fCe
TGedPatternFrame * fCe[27]
Definition: TGedPatternSelect.h:98
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:298
snprintf
#define snprintf
Definition: civetweb.c:1540
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:50
f
#define f(i)
Definition: RSha256.hxx:122
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:297
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
TGedPatternSelect::SetPattern
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
Definition: TGedPatternSelect.cxx:675
kLineSolid
@ kLineSolid
Definition: GuiTypes.h:47
TGedSelect::Enable
virtual void Enable()
Set widget state flag (kTRUE=enabled, kFALSE=disabled).
Definition: TGedPatternSelect.cxx:492
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kButtonDown
@ kButtonDown
Definition: TGButton.h:60
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
kFillStippled
@ kFillStippled
Definition: GuiTypes.h:50
TGedPatternSelector::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:97
TGedPatternFrame::DrawBorder
virtual void DrawBorder()
Draw border.
Definition: TGedPatternSelect.cxx:138
Point_t
Definition: GuiTypes.h:355
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:1293
TGedPatternPopup::TGedPatternPopup
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
Definition: TGedPatternSelect.cxx:374
TGFrame::fWidth
UInt_t fWidth
Definition: TGFrame.h:112
TGedPopup::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:56
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:952
GCValues_t
Definition: GuiTypes.h:223
TGedSelect::DrawTriangle
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw small triangle.
Definition: TGedPatternSelect.cxx:563
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
TGedSelect::DoRedraw
virtual void DoRedraw()
Draw separator and arrow.
Definition: TGedPatternSelect.cxx:510
TGGC::SetFillStyle
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Definition: TGGC.cxx:344
TGedPatternSelect::TGedPatternSelect
TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id)
Create and pop up pattern select window.
Definition: TGedPatternSelect.cxx:590
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:124
TGedPopup::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by popup window.
Definition: TGedPatternSelect.cxx:353
TGFrame::HandleButton
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:186
TGedSelect::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in pattern select button.
Definition: TGedPatternSelect.cxx:455
TGedPatternSelector::SetActive
void SetActive(Int_t newat)
Set selected the current style.
Definition: TGedPatternSelect.cxx:226
kFillSolid
@ kFillSolid
Definition: GuiTypes.h:50
GCValues_t::fFillStyle
Int_t fFillStyle
Definition: GuiTypes.h:233
TGeant4Unit::ps
static constexpr double ps
Definition: TGeant4SystemOfUnits.h:171
TGedPatternFrame::fPattern
Style_t fPattern
Definition: TGedPatternSelect.h:70
TGedPopup::EndPopup
void EndPopup()
Ungrab pointer and unmap popup window.
Definition: TGedPatternSelect.cxx:289
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:60
x
Double_t x[n]
Definition: legend1.C:17
kC_PATTERNSEL
@ kC_PATTERNSEL
Definition: WidgetMessageTypes.h:86
TGToolTip
Definition: TGToolTip.h:35
kButton1
@ kButton1
Definition: GuiTypes.h:213
TGResourcePool::GetGrabCursor
Cursor_t GetGrabCursor() const
Definition: TGResourcePool.h:170
TGedPatternSelector::TGedPatternSelector
TGedPatternSelector(const TGWindow *p)
Create pattern popup window.
Definition: TGedPatternSelect.cxx:196
TVirtualX.h
TGClient::GetResourcePool
const TGResourcePool * GetResourcePool() const
Definition: TGClient.h:133
kPOP_HIDE
@ kPOP_HIDE
Definition: WidgetMessageTypes.h:93
TGWidget::WantFocus
Bool_t WantFocus() const
Definition: TGWidget.h:83
kPAT_SELCHANGED
@ kPAT_SELCHANGED
Definition: WidgetMessageTypes.h:88
gStipples
const unsigned char gStipples[26][32]
Definition: RStipples.h:26
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:720
TGFrame
Definition: TGFrame.h:105
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
TGedPopup
Definition: TGedPatternSelect.h:47
SetWindowAttributes_t::fMask
Mask_t fMask
Definition: GuiTypes.h:109
TGedPatternSelect::fPattern
Style_t fPattern
Definition: TGedPatternSelect.h:150
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
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:110
bool
TGedPatternFrame::SetFillStyle
static void SetFillStyle(TGGC *gc, Style_t fstyle)
Set fill area style.
Definition: TGedPatternSelect.cxx:164
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
kGCLineStyle
const Mask_t kGCLineStyle
Definition: GuiTypes.h:290
TGWidget::HasFocus
Bool_t HasFocus() const
Definition: TGWidget.h:82
id
XFontStruct * id
Definition: TGX11.cxx:109
kWASaveUnder
const Mask_t kWASaveUnder
Definition: GuiTypes.h:149
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
gClient
#define gClient
Definition: TGClient.h:166
style
TCanvas * style()
Definition: style.C:1
TGCheckButton
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:324
TGedSelect::~TGedSelect
virtual ~TGedSelect()
Destructor of pattern select button.
Definition: TGedPatternSelect.cxx:445
kNone
const Handle_t kNone
Definition: GuiTypes.h:87
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:740
TGedPatternFrame::fActive
Bool_t fActive
Definition: TGedPatternSelect.h:69
TGToolTip::Reset
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:260
TGedPatternSelect
Definition: TGedPatternSelect.h:147
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGedPatternFrame::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:68
RStipples.h
kGCFillStyle
const Mask_t kGCFillStyle
Definition: GuiTypes.h:293
h
#define h(i)
Definition: RSha256.hxx:124
TGedPatternSelect::DoRedraw
virtual void DoRedraw()
Draw selected pattern as current one.
Definition: TGedPatternSelect.cxx:616
TGWidget::WidgetId
Int_t WidgetId() const
Definition: TGWidget.h:80
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TGedPatternSelector::~TGedPatternSelector
virtual ~TGedPatternSelector()
Delete pattern popup window.
Definition: TGedPatternSelect.cxx:218
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
SetWindowAttributes_t::fOverrideRedirect
Bool_t fOverrideRedirect
Definition: GuiTypes.h:106
TGedPatternFrame::fTipText
char fTipText[7]
Definition: TGedPatternSelect.h:73
TGGC
Definition: TGGC.h:31
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
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:1317
Event_t::fCode
UInt_t fCode
Definition: GuiTypes.h:179
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:630
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
GCValues_t::fLineStyle
Int_t fLineStyle
Definition: GuiTypes.h:229
kGCForeground
const Mask_t kGCForeground
Definition: GuiTypes.h:287
TGFrame::fBorderWidth
Int_t fBorderWidth
Definition: TGFrame.h:118
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:59
kWidgetIsEnabled
@ kWidgetIsEnabled
Definition: TGWidget.h:48
Long_t
long Long_t
Definition: RtypesCore.h:54
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
TGWidget::IsEnabled
Bool_t IsEnabled() const
Definition: TGWidget.h:81
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:271
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:59
TGLayoutHints
Definition: TGLayout.h:57
TGedPatternFrame::SetActive
void SetActive(Bool_t in)
Definition: TGedPatternSelect.h:86
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:230
GCValues_t::fBackground
ULong_t fBackground
Definition: GuiTypes.h:227
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:398
kGCLineWidth
const Mask_t kGCLineWidth
Definition: GuiTypes.h:289
Window_t
Handle_t Window_t
Definition: GuiTypes.h:28
kC_POPUP
@ kC_POPUP
Definition: WidgetMessageTypes.h:92
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:242
TGedPatternSelector::fActive
Int_t fActive
Definition: TGedPatternSelect.h:96
kGCBackground
const Mask_t kGCBackground
Definition: GuiTypes.h:288
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:760
TGedPatternPopup::fCurrentPattern
Style_t fCurrentPattern
Definition: TGedPatternSelect.h:114
TGCompositeFrame::SetLayoutManager
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition: TGFrame.cxx:985
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TGTileLayout
Definition: TGLayout.h:276
unsigned int
TGCompositeFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
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:601
kLHintsNoHints
@ kLHintsNoHints
Definition: TGLayout.h:36
TGedPatternSelect::PatternSelected
virtual void PatternSelected(Style_t pattern=0)
Definition: TGedPatternSelect.h:161
TGWidget::fWidgetId
Int_t fWidgetId
Definition: TGWidget.h:58
TGWidget::ClearFlags
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:71
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:373
TGedPatternFrame::fTip
TGToolTip * fTip
Definition: TGedPatternSelect.h:72
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
TGedPatternSelect.h
GCValues_t::fMask
Mask_t fMask
Definition: GuiTypes.h:250
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
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:614
points
point * points
Definition: X3DBuffer.c:22
TGGC::SetForeground
void SetForeground(Pixel_t v)
Set foreground color.
Definition: TGGC.cxx:277
TGedPatternSelector
Definition: TGedPatternSelect.h:93
TGToolTip.h
TGButton.h
TGButton::fState
EButtonState fState
Definition: TGButton.h:75
Event_t
Definition: GuiTypes.h:173
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:113
GCValues_t::fForeground
ULong_t fForeground
Definition: GuiTypes.h:226
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:750
TGedSelect::SetPopup
virtual void SetPopup(TGedPopup *p)
Definition: TGedPatternSelect.h:142
TGedPatternFrame::DoRedraw
virtual void DoRedraw()
Redraw selected pattern.
Definition: TGedPatternSelect.cxx:147
TGWidget::SetFlags
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:70
TGResourcePool.h
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
TGedPatternPopup::~TGedPatternPopup
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
Definition: TGedPatternSelect.cxx:390
TGFrame::fHeight
UInt_t fHeight
Definition: TGFrame.h:113
kPAT_CLICK
@ kPAT_CLICK
Definition: WidgetMessageTypes.h:87
kEnterWindowMask
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
TGCompositeFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
kWAOverrideRedirect
const Mask_t kWAOverrideRedirect
Definition: GuiTypes.h:148
TGedSelect
Definition: TGedPatternSelect.h:125
TGCompositeFrame
Definition: TGFrame.h:324
TGedPatternFrame::fgGC
static TGGC * fgGC
Definition: TGedPatternSelect.h:71
TGCheckButton::fPrevState
EButtonState fPrevState
Definition: TGButton.h:272
TGToolTip::Hide
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:247
TGedSelect::Disable
virtual void Disable()
Clear widget state flag.
Definition: TGedPatternSelect.cxx:501
TGedSelect::TGedSelect
TGedSelect(const TGWindow *p, Int_t id)
Create pattern select button.
Definition: TGedPatternSelect.cxx:420
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1242
TGedPatternFrame
Definition: TGedPatternSelect.h:65
TGedSelect::fPopup
TGedPopup * fPopup
Definition: TGedPatternSelect.h:129
TGedPatternPopup
Definition: TGedPatternSelect.h:111
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:110
TGWindow::fParent
const TGWindow * fParent
Definition: TGWindow.h:36
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:686
ROOT::TMetaUtils::propNames::pattern
static const std::string pattern("pattern")
GCValues_t::fLineWidth
Int_t fLineWidth
Definition: GuiTypes.h:228
int
SetWindowAttributes_t
Definition: GuiTypes.h:92
TGGC::SetStipple
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Definition: TGGC.cxx:377
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:415
TGClient::FreeGC
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition: TGClient.cxx:329