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// //
17// TGedPatternFrame, TGedPatternSelector, TGedPatternPopup //
18// and TGedPatternColor. //
19// //
20// The TGedPatternFrame is a small frame with border showing a //
21// specific pattern (fill style). //
22// //
23// The TGedPatternSelector is a composite frame with TGedPatternFrames //
24// of all diferent styles //
25// //
26// The TGedPattern is a popup containing a TGPatternSelector. //
27// //
28// The TGedPatternSelect widget is a button with pattern area with //
29// a little down arrow. When clicked on the arrow the //
30// TGedPatternPopup pops up. //
31// //
32// Selecting a pattern in this widget will generate the event: //
33// kC_PATTERNSEL, kPAT_SELCHANGED, widget id, style. //
34// //
35// and the signal: //
36// PatternSelected(Style_t pattern) //
37// //
38// TGedSelect is button that shows popup window when clicked. //
39// TGedPopup is a popup window. //
40// //
41//////////////////////////////////////////////////////////////////////////
42
43#include "TGButton.h"
44#include "TGToolTip.h"
45
46
48
49protected:
51
52public:
53 TGedPopup(const TGWindow* p, const TGWindow *m, UInt_t w, UInt_t h,
54 UInt_t options = 0, Pixel_t back = GetDefaultFrameBackground());
55 virtual ~TGedPopup() { }
56
57 virtual Bool_t HandleButton(Event_t *event);
58 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
60 void EndPopup();
61
62 ClassDef(TGedPopup,0) //popup window
63};
64
65class TGedPatternFrame : public TGFrame {
66
67protected:
71 static TGGC *fgGC;
72 TGToolTip *fTip; // tool tip associated with a button
73 char fTipText[7];
74
75 virtual void DoRedraw();
76
77public:
78 TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width = 40,
79 Int_t height = 20);
80 virtual ~TGedPatternFrame() { delete fTip; }
81
82 virtual Bool_t HandleButton(Event_t *event);
83 virtual Bool_t HandleCrossing(Event_t *event);
84 virtual void DrawBorder();
85
86 void SetActive(Bool_t in) { fActive = in; gClient->NeedRedraw(this); }
87 Style_t GetPattern() const { return fPattern; }
88 static void SetFillStyle(TGGC* gc, Style_t fstyle); //set fill style for given GC
89
90 ClassDef(TGedPatternFrame,0) //pattern frame
91};
92
94
95protected:
99
100public:
102 virtual ~TGedPatternSelector();
103
104 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
105 void SetActive(Int_t newat);
106 Int_t GetActive() const { return fActive; }
107
108 ClassDef(TGedPatternSelector,0) //select pattern frame
109};
110
112
113protected:
115
116public:
117 TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern);
118 virtual ~TGedPatternPopup();
119
120 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
121
122 ClassDef(TGedPatternPopup,0) // Color selector popup
123};
124
125class TGedSelect : public TGCheckButton {
126
127protected:
130
131 virtual void DoRedraw();
133
134public:
135 TGedSelect(const TGWindow *p, Int_t id);
136 virtual ~TGedSelect();
137
138 virtual Bool_t HandleButton(Event_t *event);
139
140 virtual void Enable();
141 virtual void Disable();
142 virtual void SetPopup(TGedPopup* p) { fPopup = p; } // popup will be deleted in destructor.
143
144 ClassDef(TGedSelect,0) //selection check-button
145};
146
148
149protected:
151
152 virtual void DoRedraw();
153
154public:
155 TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id);
157
158 void SetPattern(Style_t pattern, Bool_t emit=kTRUE);
159 Style_t GetPattern() const { return fPattern; }
160 virtual TGDimension GetDefaultSize() const { return TGDimension(55, 21); }
161 virtual void PatternSelected(Style_t pattern = 0)
162 { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); } // *SIGNAL*
163 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
164 virtual void SavePrimitive(std::ostream &out, Option_t * = "");
165
166 ClassDef(TGedPatternSelect,0) //pattern selection check-button
167};
168
169#endif
Handle_t GContext_t
Definition: GuiTypes.h:37
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
short Style_t
Definition: RtypesCore.h:76
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
Definition: TGGC.h:31
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.
Style_t GetPattern() const
TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width=40, Int_t height=20)
Pattern select ctor.
virtual ~TGedPatternFrame()
virtual void DrawBorder()
Draw border.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
static TGGC * fgGC
virtual void DoRedraw()
Redraw selected pattern.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages generated by pattern popup window.
TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern)
Pattern popup constructor.
virtual ~TGedPatternPopup()
Destructor of pattern popup window.
virtual void DoRedraw()
Draw selected pattern as current one.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the pattern select widget as a C++ statement(s) on output stream out.
virtual TGDimension GetDefaultSize() const
default size
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)
Style_t GetPattern() const
virtual ~TGedPatternSelect()
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.
virtual ~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.
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)
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
auto * m
Definition: textangle.C:8