Logo ROOT  
Reference Guide
TGedPatternSelect.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Marek Biskup, Ilka Antcheva 24/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 #ifndef ROOT_TGedPatternSelect
13 #define ROOT_TGedPatternSelect
14 
15 
16 #include "TGButton.h"
17 #include "TGToolTip.h"
18 
19 
20 class TGedPopup : public TGCompositeFrame {
21 
22 protected:
24 
25 public:
26  TGedPopup(const TGWindow* p, const TGWindow *m, UInt_t w, UInt_t h,
27  UInt_t options = 0, Pixel_t back = GetDefaultFrameBackground());
28  virtual ~TGedPopup() { }
29 
30  virtual Bool_t HandleButton(Event_t *event);
31  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
32  void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h);
33  void EndPopup();
34 
35  ClassDef(TGedPopup,0) //popup window
36 };
37 
38 class TGedPatternFrame : public TGFrame {
39 
40 protected:
44  static TGGC *fgGC;
45  TGToolTip *fTip; ///< tool tip associated with a button
46  char fTipText[7];
47 
48  virtual void DoRedraw();
49 
50 public:
52  Int_t height = 20);
53  virtual ~TGedPatternFrame() { delete fTip; }
54 
55  virtual Bool_t HandleButton(Event_t *event);
57  virtual void DrawBorder();
58 
59  void SetActive(Bool_t in) { fActive = in; gClient->NeedRedraw(this); }
60  Style_t GetPattern() const { return fPattern; }
61  static void SetFillStyle(TGGC* gc, Style_t fstyle); //set fill style for given GC
62 
63  ClassDef(TGedPatternFrame,0) //pattern frame
64 };
65 
67 
68 protected:
72 
73 public:
74  TGedPatternSelector(const TGWindow *p);
75  virtual ~TGedPatternSelector();
76 
77  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
78  void SetActive(Int_t newat);
79  Int_t GetActive() const { return fActive; }
80 
81  ClassDef(TGedPatternSelector,0) //select pattern frame
82 };
83 
84 class TGedPatternPopup : public TGedPopup {
85 
86 protected:
88 
89 public:
91  virtual ~TGedPatternPopup();
92 
93  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
94 
95  ClassDef(TGedPatternPopup,0) // Color selector popup
96 };
97 
98 class TGedSelect : public TGCheckButton {
99 
100 protected:
103 
104  virtual void DoRedraw();
105  void DrawTriangle(GContext_t gc, Int_t x, Int_t y);
106 
107 public:
108  TGedSelect(const TGWindow *p, Int_t id);
109  virtual ~TGedSelect();
110 
111  virtual Bool_t HandleButton(Event_t *event);
112 
113  virtual void Enable();
114  virtual void Disable();
115  virtual void SetPopup(TGedPopup* p) { fPopup = p; } // popup will be deleted in destructor.
116 
117  ClassDef(TGedSelect,0) //selection check-button
118 };
119 
121 
122 protected:
124 
125  virtual void DoRedraw();
126 
127 public:
129  virtual ~TGedPatternSelect() {}
130 
131  void SetPattern(Style_t pattern, Bool_t emit=kTRUE);
132  Style_t GetPattern() const { return fPattern; }
133  virtual TGDimension GetDefaultSize() const { return TGDimension(55, 21); }
134  virtual void PatternSelected(Style_t pattern = 0)
135  { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); } // *SIGNAL*
136  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
137  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
138 
139  ClassDef(TGedPatternSelect,0) //pattern selection check-button
140 };
141 
142 #endif
TGedPatternFrame::TGedPatternFrame
TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width=40, Int_t height=20)
Pattern select ctor.
Definition: TGedPatternSelect.cxx:95
m
auto * m
Definition: textangle.C:8
TGedSelect::fDrawGC
TGGC * fDrawGC
Definition: TGedPatternSelect.h:101
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGedPatternSelect::~TGedPatternSelect
virtual ~TGedPatternSelect()
Definition: TGedPatternSelect.h:129
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
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
TGDimension
Definition: TGDimension.h:18
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGedPatternSelect::SetPattern
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
Definition: TGedPatternSelect.cxx:714
TGedSelect::Enable
virtual void Enable()
Set widget state flag (kTRUE=enabled, kFALSE=disabled).
Definition: TGedPatternSelect.cxx:531
TGedPatternSelect::GetPattern
Style_t GetPattern() const
Definition: TGedPatternSelect.h:132
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGedPatternSelector::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:70
TGedPatternFrame::DrawBorder
virtual void DrawBorder()
Draw border.
Definition: TGedPatternSelect.cxx:168
TGedPatternPopup::TGedPatternPopup
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
Definition: TGedPatternSelect.cxx:413
TGedPopup::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:23
TGedSelect::DrawTriangle
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw small triangle.
Definition: TGedPatternSelect.cxx:602
TGedSelect::DoRedraw
virtual void DoRedraw()
Draw separator and arrow.
Definition: TGedPatternSelect.cxx:549
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
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
Int_t
int Int_t
Definition: RtypesCore.h:45
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
x
Double_t x[n]
Definition: legend1.C:17
TGToolTip
Definition: TGToolTip.h:24
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGedPatternSelector::TGedPatternSelector
TGedPatternSelector(const TGWindow *p)
Create pattern popup window.
Definition: TGedPatternSelect.cxx:235
TGedPatternFrame::GetPattern
Style_t GetPattern() const
Definition: TGedPatternSelect.h:60
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGedPopup
is a popup window.
Definition: TGedPatternSelect.h:20
TGedPatternSelect::fPattern
Style_t fPattern
Definition: TGedPatternSelect.h:123
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
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
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
gClient
#define gClient
Definition: TGClient.h:157
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGedSelect::~TGedSelect
virtual ~TGedSelect()
Destructor of pattern select button.
Definition: TGedPatternSelect.cxx:484
TGedPatternFrame::fActive
Bool_t fActive
Definition: TGedPatternSelect.h:42
TGedPatternSelect
is a button with pattern area with a little down arrow.
Definition: TGedPatternSelect.h:120
TGedPatternFrame::fMsgWindow
const TGWindow * fMsgWindow
Definition: TGedPatternSelect.h:41
h
#define h(i)
Definition: RSha256.hxx:106
TGedPatternSelect::DoRedraw
virtual void DoRedraw()
Draw selected pattern as current one.
Definition: TGedPatternSelect.cxx:655
TGedPatternSelector::~TGedPatternSelector
virtual ~TGedPatternSelector()
Delete pattern popup window.
Definition: TGedPatternSelect.cxx:257
TGedPatternFrame::fTipText
char fTipText[7]
Definition: TGedPatternSelect.h:46
TGGC
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
Long_t
long Long_t
Definition: RtypesCore.h:54
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
TGedPatternFrame::SetActive
void SetActive(Bool_t in)
Definition: TGedPatternSelect.h:59
TGedPatternSelect::GetDefaultSize
virtual TGDimension GetDefaultSize() const
default size
Definition: TGedPatternSelect.h:133
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
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
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
TGedPatternPopup::fCurrentPattern
Style_t fCurrentPattern
Definition: TGedPatternSelect.h:87
unsigned int
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
TGedPatternSelect::PatternSelected
virtual void PatternSelected(Style_t pattern=0)
Definition: TGedPatternSelect.h:134
TGedPopup::~TGedPopup
virtual ~TGedPopup()
Definition: TGedPatternSelect.h:28
TGedPatternFrame::fTip
TGToolTip * fTip
tool tip associated with a button
Definition: TGedPatternSelect.h:45
TGedPatternSelector
The TGedPatternSelector is a composite frame with TGedPatternFrames of all diferent styles.
Definition: TGedPatternSelect.h:66
TGToolTip.h
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGButton.h
Event_t
Event structure.
Definition: GuiTypes.h:174
TGedSelect::SetPopup
virtual void SetPopup(TGedPopup *p)
Definition: TGedPatternSelect.h:115
TGedPatternFrame::DoRedraw
virtual void DoRedraw()
Redraw selected pattern.
Definition: TGedPatternSelect.cxx:177
TGedPatternPopup::~TGedPatternPopup
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
Definition: TGedPatternSelect.cxx:429
TGedPatternSelector::GetActive
Int_t GetActive() const
Definition: TGedPatternSelect.h:79
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
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
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
TGedPatternFrame::~TGedPatternFrame
virtual ~TGedPatternFrame()
Definition: TGedPatternSelect.h:53
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
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")
int