Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ~TGedPopup() override { }
29
30 Bool_t HandleButton(Event_t *event) override;
31 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
33 void EndPopup();
34
35 ClassDefOverride(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 void DoRedraw() override;
49
50public:
51 TGedPatternFrame(const TGWindow *p, Style_t pattern, Int_t width = 40,
52 Int_t height = 20);
53 ~TGedPatternFrame() override { delete fTip; }
54
55 Bool_t HandleButton(Event_t *event) override;
56 Bool_t HandleCrossing(Event_t *event) override;
57 void DrawBorder() override;
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 ClassDefOverride(TGedPatternFrame,0) //pattern frame
64};
65
67
68protected:
72
73public:
75 ~TGedPatternSelector() override;
76
77 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
78 void SetActive(Int_t newat);
79 Int_t GetActive() const { return fActive; }
80
81 ClassDefOverride(TGedPatternSelector,0) //select pattern frame
82};
83
85
86protected:
88
89public:
90 TGedPatternPopup(const TGWindow *p, const TGWindow *m, Style_t pattern);
91 ~TGedPatternPopup() override;
92
93 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
94
95 ClassDefOverride(TGedPatternPopup,0) // Color selector popup
96};
97
98class TGedSelect : public TGCheckButton {
99
100protected:
103
104 void DoRedraw() override;
106
107public:
108 TGedSelect(const TGWindow *p, Int_t id);
109 ~TGedSelect() override;
110
111 Bool_t HandleButton(Event_t *event) override;
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 ClassDefOverride(TGedSelect,0) //selection check-button
118};
119
121
122protected:
124
125 void DoRedraw() override;
126
127public:
128 TGedPatternSelect(const TGWindow *p, Style_t pattern, Int_t id);
129 ~TGedPatternSelect() override {}
130
131 void SetPattern(Style_t pattern, Bool_t emit=kTRUE);
132 Style_t GetPattern() const { return fPattern; }
133 TGDimension GetDefaultSize() const override { return TGDimension(55, 21); }
134 virtual void PatternSelected(Style_t pattern = 0)
135 { Emit("PatternSelected(Style_t)", pattern ? pattern : GetPattern()); } // *SIGNAL*
136 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
137 void SavePrimitive(std::ostream &out, Option_t * = "") override;
138
139 ClassDefOverride(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
short Style_t
Definition RtypesCore.h:82
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:75
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
#define gClient
Definition TGClient.h:157
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t SetFillStyle
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
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
A tooltip can be a one or multiple lines help text that is displayed in a window when the mouse curso...
Definition TGToolTip.h:24
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)
Bool_t HandleCrossing(Event_t *event) override
Handle mouse crossing event.
~TGedPatternFrame() override
const TGWindow * fMsgWindow
Bool_t HandleButton(Event_t *event) override
Handle mouse button event.
void DrawBorder() override
Draw border.
TGToolTip * fTip
tool tip associated with a button
Style_t GetPattern() const
void DoRedraw() override
Redraw selected pattern.
The TGedPatternPopup is a popup containing a TGedPatternSelector.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by pattern popup window.
~TGedPatternPopup() override
Destructor of pattern popup window.
is a button with pattern area with a little down arrow.
void DoRedraw() override
Draw selected pattern as current one.
~TGedPatternSelect() override
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process message according to the user input.
virtual void PatternSelected(Style_t pattern=0)
Style_t GetPattern() const
void SetPattern(Style_t pattern, Bool_t emit=kTRUE)
Set pattern.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save the pattern select widget as a C++ statement(s) on output stream out.
TGDimension GetDefaultSize() const override
default size
The TGedPatternSelector is a composite frame with TGedPatternFrames of all diferent styles.
void SetActive(Int_t newat)
Set selected the current style.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process message generated by pattern popup window.
const TGWindow * fMsgWindow
~TGedPatternSelector() override
Delete pattern popup window.
TGedPatternFrame * fCe[27]
is a popup window.
void EndPopup()
Ungrab pointer and unmap popup window.
~TGedPopup() override
const TGWindow * fMsgWindow
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by popup window.
void PlacePopup(Int_t x, Int_t y, UInt_t w, UInt_t h)
Place popup window at the specified place.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in popup window.
is button that shows popup window when clicked.
void DoRedraw() override
Draw separator and arrow.
void DrawTriangle(GContext_t gc, Int_t x, Int_t y)
Draw small triangle.
TGedPopup * fPopup
virtual void Enable()
Set widget state flag (kTRUE=enabled, kFALSE=disabled).
~TGedSelect() override
Destructor of pattern select button.
Bool_t HandleButton(Event_t *event) override
Handle mouse button events in pattern select button.
virtual void Disable()
Clear widget state flag.
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
Event structure.
Definition GuiTypes.h:174
TMarker m
Definition textangle.C:8