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
21
22protected:
24
25public:
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
31 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
33 void EndPopup();
34
35 ClassDef(TGedPopup,0) //popup window
36};
37
38class TGedPatternFrame : public TGFrame {
39
40protected:
44 static TGGC *fgGC;
45 TGToolTip *fTip; ///< tool tip associated with a button
46 char fTipText[7];
47
48 virtual void DoRedraw();
49
50public:
52 Int_t height = 20);
53 virtual ~TGedPatternFrame() { delete fTip; }
54
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
68protected:
72
73public:
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
85
86protected:
88
89public:
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
98class TGedSelect : public TGCheckButton {
99
100protected:
103
104 virtual void DoRedraw();
106
107public:
108 TGedSelect(const TGWindow *p, Int_t id);
109 virtual ~TGedSelect();
110
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
122protected:
124
125 virtual void DoRedraw();
126
127public:
130
132 Style_t GetPattern() const { return fPattern; }
133 virtual TGDimension GetDefaultSize() const { return TGDimension(55, 21); }
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
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
long Long_t
Definition: RtypesCore.h:54
bool Bool_t
Definition: RtypesCore.h:63
short Style_t
Definition: RtypesCore.h:89
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:157
Selects different options.
Definition: TGButton.h:264
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
ROOT GUI Window base class.
Definition: TGWindow.h:23
The TGedPatternFrame is a small frame with border showing a specific pattern (fill style.
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.
TGToolTip * fTip
tool tip associated with a button
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.
The TGedPatternPopup is a popup containing a TGedPatternSelector.
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.
is a button with pattern area with a little down arrow.
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.
The TGedPatternSelector is a composite frame with TGedPatternFrames of all diferent styles.
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.
Int_t GetActive() const
const TGWindow * fMsgWindow
virtual ~TGedPatternSelector()
Delete pattern popup window.
TGedPatternFrame * fCe[27]
is a popup window.
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.
is button that shows popup window when clicked.
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
static const std::string pattern("pattern")
Event structure.
Definition: GuiTypes.h:174
auto * m
Definition: textangle.C:8