18enum ETestCommandIdentifiers {
43 ~TTripleSliderDemo()
override;
46 void DoText(
const char *
text);
63 AddFrame(fCanvas, fLcan);
64 fCanvas->GetCanvas()->SetFillColor(33);
65 fCanvas->GetCanvas()->SetFrameFillColor(41);
66 fCanvas->GetCanvas()->SetBorderMode(0);
67 fCanvas->GetCanvas()->SetGrid();
68 fCanvas->GetCanvas()->SetLogy();
76 fCheck1->SetToolTipText(
"Pointer position constrained to slider sides");
77 fCheck2->SetToolTipText(
"Pointer position relative to slider position");
79 fHframe0->Resize(200, 50);
85 GetDefaultFrameBackground(),
87 fHslider1->Connect(
"PointerPositionChanged()",
"TTripleSliderDemo",
89 fHslider1->Connect(
"PositionChanged()",
"TTripleSliderDemo",
91 fHslider1->SetRange(0.05,5.0);
93 fHframe1->Resize(200, 25);
101 fTeh1->SetToolTipText(
"Minimum (left) Value of Slider");
102 fTeh2->SetToolTipText(
"Pointer Position Value");
103 fTeh3->SetToolTipText(
"Maximum (right) Value of Slider");
105 fTbh1->AddText(0,
"0.0");
106 fTbh2->AddText(0,
"0.0");
107 fTbh3->AddText(0,
"0.0");
109 fTeh1->Connect(
"TextChanged(char*)",
"TTripleSliderDemo",
this,
111 fTeh2->Connect(
"TextChanged(char*)",
"TTripleSliderDemo",
this,
113 fTeh3->Connect(
"TextChanged(char*)",
"TTripleSliderDemo",
this,
116 fCheck1->Connect(
"Clicked()",
"TTripleSliderDemo",
this,
118 fCheck2->Connect(
"Clicked()",
"TTripleSliderDemo",
this,
121 fHframe2->Resize(100, 25);
131 fHframe0->AddFrame(fCheck1, fBfly2);
132 fHframe0->AddFrame(fCheck2, fBfly2);
133 fHframe1->AddFrame(fHslider1, fBly);
134 fHframe2->AddFrame(fTeh1, fBfly2);
135 fHframe2->AddFrame(fTeh2, fBfly1);
136 fHframe2->AddFrame(fTeh3, fBfly3);
138 AddFrame(fHframe0, fBly);
139 AddFrame(fHframe1, fBly);
140 AddFrame(fHframe2, fBly);
144 SetWindowName(
"Triple Slider Demo");
146 Resize(GetDefaultSize());
149 fFitFcn =
new TF1(
"fFitFcn",
"TMath::LogNormal(x, [0], [1], [2])", 0, 5);
150 fFitFcn->SetRange(0.0, 2.5);
151 fFitFcn->SetParameters(1.0, 0, 1);
152 fFitFcn->SetMinimum(1.0e-3);
153 fFitFcn->SetMaximum(10.0);
154 fFitFcn->SetLineColor(
kRed);
155 fFitFcn->SetLineWidth(1);
158 fHslider1->SetPosition(0.05,2.5);
159 fHslider1->SetPointerPosition(1.0);
161 sprintf(buf,
"%.3f", fHslider1->GetMinPosition());
163 fTbh1->AddText(0, buf);
164 sprintf(buf,
"%.3f", fHslider1->GetPointerPosition());
166 fTbh2->AddText(0, buf);
167 sprintf(buf,
"%.3f", fHslider1->GetMaxPosition());
169 fTbh3->AddText(0, buf);
173TTripleSliderDemo::~TTripleSliderDemo()
181void TTripleSliderDemo::CloseWindow()
189void TTripleSliderDemo::DoText(
const char * )
198 fHslider1->SetPosition((
Float_t)atof(fTbh1->GetString()),
199 (
Float_t)fHslider1->GetMaxPosition());
202 fHslider1->SetPointerPosition((
Float_t)atof(fTbh2->GetString()));
205 fHslider1->SetPosition((
Float_t)fHslider1->GetMinPosition(),
206 (
Float_t)atof(fTbh1->GetString()));
211 fFitFcn->SetParameters(fHslider1->GetPointerPosition(), 0, 1);
212 fFitFcn->SetRange(fHslider1->GetMinPosition()-0.05,
213 fHslider1->GetMaxPosition());
215 fCanvas->GetCanvas()->Modified();
216 fCanvas->GetCanvas()->Update();
220void TTripleSliderDemo::DoSlider()
226 sprintf(buf,
"%.3f", fHslider1->GetMinPosition());
228 fTbh1->AddText(0, buf);
229 fTeh1->SetCursorPosition(fTeh1->GetCursorPosition());
233 sprintf(buf,
"%.3f", fHslider1->GetPointerPosition());
235 fTbh2->AddText(0, buf);
236 fTeh2->SetCursorPosition(fTeh2->GetCursorPosition());
240 sprintf(buf,
"%.3f", fHslider1->GetMaxPosition());
242 fTbh3->AddText(0, buf);
243 fTeh3->SetCursorPosition(fTeh3->GetCursorPosition());
247 fFitFcn->SetParameters(fHslider1->GetPointerPosition(), 0, 1);
248 fFitFcn->SetRange(fHslider1->GetMinPosition()-0.05,
249 fHslider1->GetMaxPosition());
251 fCanvas->GetCanvas()->Modified();
252 fCanvas->GetCanvas()->Update();
256void TTripleSliderDemo::HandleButtons()
265 fHslider1->SetConstrained(fCheck1->GetState());
268 fHslider1->SetRelative(fCheck2->GetState());
278 new TTripleSliderDemo();
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char text
R__EXTERN void * gTQSender
A composite frame that layout their children in horizontal way.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
virtual void CloseWindow()
Close and delete main frame.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
A TGTextEntry is a one line text input widget.
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
This class creates a TGCanvas in which a TCanvas is created.