Logo ROOT  
Reference Guide
TFunctionParametersDialog.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Ilka Antcheva 08/05/06
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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/** \class TFunctionParametersDialog
13 \ingroup ged
14
15This class is used for function parameter settings.
16
17*/
18
20#include "TTimer.h"
21#include "TList.h"
22#include "TF1.h"
23#include "TGButton.h"
24#include "TGFrame.h"
25#include "TGLabel.h"
26#include "TGLayout.h"
27#include "TGTextEntry.h"
28#include "TGMsgBox.h"
29#include "TGNumberEntry.h"
30#include "TGTripleSlider.h"
31#include "TVirtualPad.h"
32
33
36 kFIX = 10,
37 kVAL = 20,
38 kMIN = 30,
39 kMAX = 40,
40 kSLD = 50,
41 kUPDATE = 8888,
46};
47
49
50////////////////////////////////////////////////////////////////////////////////
51/// Create the parameters' dialog of currently selected function 'func'.
52
54 const TGWindow *main,
55 TF1 *func,
56 TVirtualPad *pad,
57 Double_t rx, Double_t ry) :
59{
60 fFunc = func;
61 fFpad = pad;
62 fRXmin = rx;
63 fRXmax = ry;
65 fNP = fFunc->GetNpar();
67 fPmin = new Double_t[fNP];
68 fPmax = new Double_t[fNP];
69 fPval = new Double_t[fNP];
70 fPerr = new Double_t[fNP];
71
72 for (Int_t i = 0; i < fNP; i++) {
73 fFunc->GetParLimits(i, fPmin[i], fPmax[i]);
74 fPval[i] = fFunc->GetParameter(i);
75 fPerr[i] = fFunc->GetParError(i);
76 }
77 fParNam = new TGTextEntry*[fNP];
83
84 memset(fParNam, 0, sizeof(TGTextEntry*)*fNP);
85 memset(fParFix, 0, sizeof(TGCheckButton*)*fNP);
86 memset(fParVal, 0, sizeof(TGNumberEntry*)*fNP);
87 memset(fParMin, 0, sizeof(TGNumberEntryField*)*fNP);
88 memset(fParMax, 0, sizeof(TGNumberEntryField*)*fNP);
89 memset(fParMax, 0, sizeof(TGTripleHSlider*)*fNP);
90
92 AddFrame(f1, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
93
94 // column 'Name'
96 fContNam->AddFrame(new TGLabel(fContNam,"Name"),
97 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
98 for (Int_t i = 0; i < fNP; i++ ) {
99 fParNam[i] = new TGTextEntry(fContNam, new TGTextBuffer(80), kNAME+i);
100 fParNam[i]->SetText(Form("%s", fFunc->GetParName(i)));
103 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 5));
104 }
105 f1->AddFrame(fContNam, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
106
107 // column 'Fix'
109 fContFix->AddFrame(new TGLabel(fContFix,"Fix"),
110 new TGLayoutHints(kLHintsTop, 2, 0, 0, 0));
111 for (Int_t i = 0; i < fNP; i++ ) {
112 fParFix[i] = new TGCheckButton(fContFix, "", kFIX*fNP+i);
113 fParFix[i]->SetToolTipText(Form("Set %s to fixed", fFunc->GetParName(i)));
115 5, 5, 10, 7));
116 if ((fPmin[i] == fPmax[i]) && (fPmin[i] || fPmax[i]))
118 else
120 fParFix[i]->Connect("Toggled(Bool_t)", "TFunctionParametersDialog", this, "DoFix(Bool_t)");
121 }
122 f1->AddFrame(fContFix, new TGLayoutHints(kLHintsLeft, 5, 5, 5, 5));
123
124 // column 'Value'
126 fContVal->AddFrame(new TGLabel(fContVal,"Value"),
127 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
128 for (Int_t i = 0; i < fNP; i++ ) {
129 fParVal[i] = new TGNumberEntry(fContVal, 1.2E-12, 15, kVAL*fNP+i,
131 fParVal[i]->SetNumber(fPval[i]);
134 (fParVal[i]->GetNumberEntry())->SetToolTipText(Form("%s", fFunc->GetParName(i)));
135 (fParVal[i]->GetNumberEntry())->Connect("ReturnPressed()", "TFunctionParametersDialog",
136 this, "DoParValue()");
137 fParVal[i]->Connect("ValueSet(Long_t)", "TFunctionParametersDialog", this, "DoParValue()");
138 }
139 f1->AddFrame(fContVal, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
140
141 // column 'Min'
143 fContMin->AddFrame(new TGLabel(fContMin,"Min"),
144 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
145 for (Int_t i = 0; i < fNP; i++ ) {
146 fParMin[i] = new TGNumberEntryField(fContMin, kMIN*fNP+i, 0.0,
149 ((TGTextEntry*)fParMin[i])->SetToolTipText(Form("Lower limit of %s",
150 fFunc->GetParName(i)));
152 if (fPmin[i])
153 fParMin[i]->SetNumber(fPmin[i]);
154 else if (fPerr[i])
155 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
156 else if (fPval[i])
157 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
158 else
159 fParMin[i]->SetNumber(1.0);
160 fParMin[i]->Connect("ReturnPressed()", "TFunctionParametersDialog", this, "DoParMinLimit()");
161 }
162 f1->AddFrame(fContMin, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
163
164 // column 'Set Range'
166 fContSld->AddFrame(new TGLabel(fContSld,"Set Range"),
167 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
168 for (Int_t i = 0; i < fNP; i++ ) {
174 }
175 f1->AddFrame(fContSld, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
176
177 // column 'Max'
179 fContMax->AddFrame(new TGLabel(fContMax,"Max"),
180 new TGLayoutHints(kLHintsTop, 5, 0, 0, 0));
181 for (Int_t i = 0; i < fNP; i++ ) {
182 fParMax[i] = new TGNumberEntryField(fContMax, kMAX*fNP+i, 0.0,
185 ((TGTextEntry*)fParMax[i])->SetToolTipText(Form("Upper limit of %s",
186 fFunc->GetParName(i)));
188 if (fPmax[i])
189 fParMax[i]->SetNumber(fPmax[i]);
190 else if (fPerr[i])
191 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
192 else if (fPval[i])
193 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
194 else
195 fParMax[i]->SetNumber(1.0);
196 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
197 Double_t temp;
198 temp = fParMax[i]->GetNumber();
199 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
200 fParMin[i]->SetNumber(temp);
201 }
202 fParMax[i]->Connect("ReturnPressed()", "TFunctionParametersDialog", this, "DoParMaxLimit()");
203 }
204 f1->AddFrame(fContMax, new TGLayoutHints(kLHintsExpandX, 5, 5, 5, 5));
205
206
207 fUpdate = new TGCheckButton(this, "&Immediate preview", kUPDATE);
208 fUpdate->SetToolTipText("Immediate function redrawing");
210 fUpdate->Connect("Toggled(Bool_t)", "TFunctionParametersDialog", this, "HandleButtons(Bool_t)");
211
213 AddFrame(f2, new TGLayoutHints(kLHintsRight, 20, 20, 5, 1));
214
215 fReset = new TGTextButton(f2, "&Reset", kRESET);
217 fReset->SetToolTipText("Reset the parameter settings");
219 fReset->Connect("Clicked()", "TFunctionParametersDialog", this, "DoReset()");
220
221 fApply = new TGTextButton(f2, "&Apply", kAPPLY);
224 fApply->Connect("Clicked()", "TFunctionParametersDialog", this, "DoApply()");
225 fApply->SetToolTipText("Apply parameter settings and redraw the function");
226
227 fOK = new TGTextButton(f2, "&OK", kOK);
229 fOK->SetToolTipText("Apply parameter settings, redraw function and close this dialog");
230 fOK->Connect("Clicked()", "TFunctionParametersDialog", this, "DoOK()");
231
232 fCancel = new TGTextButton(f2, "&Cancel", kCANCEL);
234 fCancel->SetToolTipText("Close this dialog with no parameter changes");
235 fCancel->Connect("Clicked()", "TFunctionParametersDialog", this, "DoCancel()");
236
240 SetWindowName(Form("Set Parameters of %s", fFunc->GetTitle()));
241 MapWindow();
242
243 for (Int_t i = 0; i < fNP; i++ ) {
244 if (fParFix[i]->GetState() == kButtonDown) {
248 fParSld[i]->UnmapWindow();
249 } else {
250 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
251 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
253 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
254 this, "DoSlider()");
255 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
256 this, "DoSlider()");
257 }
258 }
259
260 gClient->WaitFor(this);
261}
262
263////////////////////////////////////////////////////////////////////////////////
264/// Destructor.
265
267{
268 TGFrameElement *el;
269 TIter next(GetList());
270
271 while ((el = (TGFrameElement *)next())) {
272 if (!strcmp(el->fFrame->ClassName(), "TGCompositeFrame")) {
273 TGFrameElement *el1;
274 TIter next1(((TGCompositeFrame *)el->fFrame)->GetList());
275 while ((el1 = (TGFrameElement *)next1())) {
276 if (!strcmp(el1->fFrame->ClassName(), "TGCompositeFrame"))
277 ((TGCompositeFrame *)el1->fFrame)->Cleanup();
278 }
279 ((TGCompositeFrame *)el->fFrame)->Cleanup();
280 }
281 }
282 Cleanup();
283 delete [] fPval;
284 delete [] fPmin;
285 delete [] fPmax;
286 delete [] fPerr;
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// Close parameters' dialog.
291
293{
294 if (fHasChanges) {
295 Int_t ret;
296 const char *txt;
297 txt = "Do you want to apply last parameters' setting?";
299 "Parameters Have Been Changed", txt, kMBIconExclamation,
300 kMBYes | kMBNo | kMBCancel, &ret);
301 if (ret == kMBYes) {
302 DoOK();
303 return;
304 } else if (ret == kMBNo) {
305 DoReset();
306 } else return;
307 }
308 DeleteWindow();
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Slot related to the Cancel button.
313
315{
316 if (fHasChanges)
317 DoReset();
318 TTimer::SingleShot(50, "TFunctionParametersDialog", this, "CloseWindow()");
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// Slot related to the Fix check button.
323
325{
327 TGButton *bt = (TGButton *) gTQSender;
328 Int_t id = bt->WidgetId();
330 for (Int_t i = 0; i < fNP; i++ ) {
331 if (id == kFIX*fNP+i) {
332 if (on) {
333 if (fParVal[i]->GetNumber() != 0) {
334 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
336 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
338 } else {
339 fParMin[i]->SetNumber(1.);
341 fParMax[i]->SetNumber(1.);
343 }
345 fParSld[i]->Disconnect("PointerPositionChanged()");
346 fParSld[i]->Disconnect("PositionChanged()");
347 fParSld[i]->UnmapWindow();
348 fFunc->FixParameter(i, fParVal[i]->GetNumber());
349 } else if (!fParMin[i]->IsEnabled()) {
350 if (fPmin[i] != fPmax[i]) {
351 if (fPmin[i])
352 fParMin[i]->SetNumber(fPmin[i]);
353 else if (fPerr[i])
354 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
355 else if (fPval[i])
356 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
357 else
358 fParMin[i]->SetNumber(1.0);
359 if (fPmax[i])
360 fParMax[i]->SetNumber(fPmax[i]);
361 else if (fPerr[i])
362 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
363 else if (fPval[i])
364 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
365 else
366 fParMax[i]->SetNumber(1.0);
367 } else if (fPval[i]) {
368 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
369 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
370 } else {
371 fParMin[i]->SetNumber(1.0);
372 fParMax[i]->SetNumber(1.0);
373 }
374 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
375 Double_t temp;
376 temp = fParMax[i]->GetNumber();
377 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
378 fParMin[i]->SetNumber(temp);
379 }
382 fParSld[i]->MapWindow();
384 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
385 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
387 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
388 this, "DoSlider()");
389 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
390 this, "DoSlider()");
391 fFunc->SetParLimits(i, fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
392 }
393 }
394 }
395 if (fUpdate->GetState() == kButtonDown)
397 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
399}
400
401////////////////////////////////////////////////////////////////////////////////
402/// Slot related to the OK button.
403
405{
406 if (fHasChanges)
409 TTimer::SingleShot(50, "TFunctionParametersDialog", this, "CloseWindow()");
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Slot related to the Preview button.
414
416{
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Slot related to the Reset button.
425
427{
429 Int_t k = fNP;
430 for (Int_t i = 0; i < fNP; i++) {
431 if (fParVal[i]->GetNumber() == fPval[i])
432 k--;
433 else
434 break;
435 }
436
437 if (!k) {
438 if (fReset->GetState() == kButtonUp)
441 return;
442 }
443 for (Int_t i = 0; i < fNP; i++) {
444 fFunc->SetParameter(i, fPval[i]);
445 fFunc->SetParLimits(i, fPmin[i], fPmax[i]);
446 fFunc->SetParError(i, fPerr[i]);
447
448 if (fPmin[i])
449 fParMin[i]->SetNumber(fPmin[i]);
450 else if (fPerr[i])
451 fParMin[i]->SetNumber(fPval[i]-3*fPerr[i]);
452 else if (fPval[i])
453 fParMin[i]->SetNumber(fPval[i]-0.1*fPval[i]);
454 else
455 fParMin[i]->SetNumber(1.0);
456
457 if (fPmax[i])
458 fParMax[i]->SetNumber(fPmax[i]);
459 else if (fPerr[i])
460 fParMax[i]->SetNumber(fPval[i]+3*fPerr[i]);
461 else if (fPval[i])
462 fParMax[i]->SetNumber(fPval[i]+0.1*fPval[i]);
463 else
464 fParMax[i]->SetNumber(1.0);
465 if (fParMax[i]->GetNumber() < fParMin[i]->GetNumber()){
466 Double_t temp;
467 temp = fParMax[i]->GetNumber();
468 fParMax[i]->SetNumber(fParMin[i]->GetNumber());
469 fParMin[i]->SetNumber(temp);
470 }
471 if (fParMin[i]->GetNumber() == fParMax[i]->GetNumber()) {
475 fParSld[i]->Disconnect("PointerPositionChanged()");
476 fParSld[i]->Disconnect("PositionChanged()");
477 fParSld[i]->UnmapWindow();
478 fFunc->FixParameter(i, fParVal[i]->GetNumber());
480 } else {
482 if (!fParMax[i]->IsEnabled()) {
486 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
487 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
489 fParSld[i]->MapWindow();
490 fParSld[i]->Connect("PointerPositionChanged()", "TFunctionParametersDialog",
491 this, "DoSlider()");
492 fParSld[i]->Connect("PositionChanged()", "TFunctionParametersDialog",
493 this, "DoSlider()");
494 }
495 }
496 fParVal[i]->SetNumber(fPval[i]);
497
498 fParSld[i]->SetRange(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
499 fParSld[i]->SetPosition(fParMin[i]->GetNumber(), fParMax[i]->GetNumber());
501 }
502
503 if (fUpdate->GetState() == kButtonDown)
505 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Slot related to the parameters' value settings.
513
515{
517 Int_t id = sl->WidgetId();
518
520 for (Int_t i = 0; i < fNP; i++ ) {
521 if (id == kSLD*fNP+i) {
522 fFunc->SetParameter(i,fParSld[i]->GetPointerPosition());
523 fFunc->SetParLimits(i,fParSld[i]->GetMinPosition(),
524 fParSld[i]->GetMaxPosition());
525 fParMin[i]->SetNumber(fParSld[i]->GetMinPosition());
526 fParMax[i]->SetNumber(fParSld[i]->GetMaxPosition());
527 fParVal[i]->SetNumber(fParSld[i]->GetPointerPosition());
528 }
529 }
530 if (fUpdate->GetState() == kButtonDown)
532 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Slot related to the parameter value settings.
540
542{
544 Int_t id = ne->WidgetId();
545
546 for (Int_t i = 0; i < fNP; i++ ) {
547 if (id == kVAL*fNP+i) {
548 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
549 if (fParVal[i]->GetNumber() < fParMin[i]->GetNumber()) {
550 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
552 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
553 fParMax[i]->GetNumber());
554 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
555 fParMax[i]->GetNumber());
556 }
557 if (fParVal[i]->GetNumber() > fParMax[i]->GetNumber()) {
558 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
560 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
561 fParMax[i]->GetNumber());
562 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
563 fParMax[i]->GetNumber());
564 }
566 fFunc->SetParameter(i,fParSld[i]->GetPointerPosition());
567 fFunc->SetParLimits(i,fParSld[i]->GetMinPosition(),
568 fParSld[i]->GetMaxPosition());
569 }
570 }
572 if (fUpdate->GetState() == kButtonDown)
574 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Slot related to the minumum parameter limit settings.
582
584{
586 Int_t id = ne->WidgetId();
587
588 for (Int_t i = 0; i < fNP; i++ ) {
589 if (id == kMIN*fNP+i) {
590 if (fParMin[i]->GetNumber() > fParMax[i]->GetNumber()) {
591 Int_t ret;
592 const char *txt;
593 txt = "The lower parameter bound cannot be bigger then the upper one.";
595 "Parameter Limits", txt, kMBIconExclamation,kMBOk,&ret);
596 fParMin[i]->SetNumber(fParVal[i]->GetNumber());
597 return;
598 }
599 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
600 fParMax[i]->GetNumber());
601 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
602 fParMax[i]->GetNumber());
603 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
605 }
606 }
608 if (fUpdate->GetState() == kButtonDown)
610 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
614}
615
616////////////////////////////////////////////////////////////////////////////////
617/// Slot related to the maximum parameter limit settings.
618
620{
622 Int_t id = ne->WidgetId();
623
624 for (Int_t i = 0; i < fNP; i++ ) {
625 if (id == kMAX*fNP+i) {
626 if (fParMin[i]->GetNumber() > fParMax[i]->GetNumber()) {
627 Int_t ret;
628 const char *txt;
629 txt = "The lower parameter bound cannot be bigger then the upper one.";
631 "Parameter Limits", txt, kMBIconExclamation,kMBOk,&ret);
632 fParMax[i]->SetNumber(fParVal[i]->GetNumber());
633 return;
634 }
635 fParSld[i]->SetRange(fParMin[i]->GetNumber(),
636 fParMax[i]->GetNumber());
637 fParSld[i]->SetPosition(fParMin[i]->GetNumber(),
638 fParMax[i]->GetNumber());
639 fParSld[i]->SetPointerPosition(fParVal[i]->GetNumber());
641 }
642 }
644 if (fUpdate->GetState() == kButtonDown)
646 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges)
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// Redraw function graphics.
654
656{
657 TString opt = fFunc->GetDrawOption();
658 opt.ToUpper();
659 if (!opt.Contains("SAME"))
660 opt += "SAME";
662 fFunc->Draw(opt);
663 fFpad->Modified();
664 fFpad->Update();
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// Handle the button dependent states in this dialog.
670
672{
673 if (update && fHasChanges)
675 else if ((fApply->GetState() == kButtonDisabled) && fHasChanges) {
677 }
678}
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
int Int_t
Definition: RtypesCore.h:45
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
EParametersDialogWid
@ kButtonDown
Definition: TGButton.h:54
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:157
@ kDoubleScaleBoth
@ kLHintsRight
Definition: TGLayout.h:26
@ kLHintsLeft
Definition: TGLayout.h:24
@ kLHintsCenterY
Definition: TGLayout.h:28
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
@ kMBNo
Definition: TGMsgBox.h:32
@ kMBYes
Definition: TGMsgBox.h:31
@ kMBCancel
Definition: TGMsgBox.h:37
@ kMBOk
Definition: TGMsgBox.h:33
@ kMBIconExclamation
Definition: TGMsgBox.h:24
R__EXTERN void * gTQSender
Definition: TQObject.h:44
char * Form(const char *fmt,...)
int main(int argc, char *argv[])
Definition: cef_main.cxx:54
1-Dim function class
Definition: TF1.h:213
virtual void SetParError(Int_t ipar, Double_t error)
Set error for parameter number ipar.
Definition: TF1.cxx:3493
virtual void GetParLimits(Int_t ipar, Double_t &parmin, Double_t &parmax) const
Return limits for parameter ipar.
Definition: TF1.cxx:1936
virtual Double_t GetParError(Int_t ipar) const
Return value of parameter number ipar.
Definition: TF1.cxx:1926
virtual void SetRange(Double_t xmin, Double_t xmax)
Initialize the upper and lower bounds to draw the function.
Definition: TF1.cxx:3539
virtual Int_t GetNpar() const
Definition: TF1.h:481
virtual void GetRange(Double_t *xmin, Double_t *xmax) const
Return range of a generic N-D function.
Definition: TF1.cxx:2275
virtual const char * GetParName(Int_t ipar) const
Definition: TF1.h:529
virtual void SetParLimits(Int_t ipar, Double_t parmin, Double_t parmax)
Set limits for parameter ipar.
Definition: TF1.cxx:3518
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
Definition: TF1.cxx:1328
virtual void SetParameter(Int_t param, Double_t value)
Definition: TF1.h:634
virtual void FixParameter(Int_t ipar, Double_t value)
Fix the value of a parameter The specified value will be used in a fit operation.
Definition: TF1.cxx:1553
virtual Double_t GetParameter(Int_t ipar) const
Definition: TF1.h:512
This class is used for function parameter settings.
TGCompositeFrame * fContMin
container of min range values
Double_t * fPmax
max limits of patameters range
TGNumberEntryField ** fParMin
min range values
virtual void DoApply()
Slot related to the Preview button.
TGCompositeFrame * fContNam
container of parameter names
TGTextButton * fApply
Apply button.
Double_t * fPerr
original patameters' errors
virtual void DoReset()
Slot related to the Reset button.
virtual void CloseWindow()
Close parameters' dialog.
virtual void RedrawFunction()
Redraw function graphics.
TGCheckButton ** fParFix
fix setting check buttons
TGNumberEntryField ** fParMax
max range values
TF1 * fFunc
function passed to this dialog
Int_t fNP
number of function parameters
virtual ~TFunctionParametersDialog()
Destructor.
virtual void DoFix(Bool_t on)
Slot related to the Fix check button.
TGTextEntry ** fParNam
parameter names
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
Double_t fRangexmin
min limits of patameters range
TGTextButton * fOK
Cancel button.
TFunctionParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Double_t rmin, Double_t rmax)
Create the parameters' dialog of currently selected function 'func'.
virtual void DoOK()
Slot related to the OK button.
Double_t fRXmax
original max range
TGCompositeFrame * fContVal
container of parameter values
Double_t * fPmin
min limits of patameters range
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGTripleHSlider ** fParSld
triple sliders
Double_t * fPval
original patameters' values
TGCheckButton * fUpdate
Immediate update check button.
TGTextButton * fCancel
Cancel button.
virtual void DoSlider()
Slot related to the parameters' value settings.
TGCompositeFrame * fContMax
container of max range values
Double_t fRangexmax
max limits of patameters range
Bool_t fHasChanges
kTRUE if function was redrawn;
TGCompositeFrame * fContSld
container of sliders
TGNumberEntry ** fParVal
parameter values
TGTextButton * fReset
Reset button.
TVirtualPad * fFpad
pad where the function is drawn
virtual void DoCancel()
Slot related to the Cancel button.
virtual void DoParValue()
Slot related to the parameter value settings.
TGCompositeFrame * fContFix
container of fix settings
Double_t fRXmin
original min range
A button abstract base class.
Definition: TGButton.h:68
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:445
virtual EButtonState GetState() const
Definition: TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:235
Selects different options.
Definition: TGButton.h:264
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:224
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
virtual TList * GetList() const
Definition: TGFrame.h:310
Int_t GetState(TGFrame *f) const
Get state of sub frame.
Definition: TGFrame.cxx:1218
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:967
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:316
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
virtual Float_t GetMaxPosition() const
virtual void SetRange(Float_t min, Float_t max)
virtual void SetPosition(Float_t min, Float_t max)
TGFrame * fFrame
Definition: TGLayout.h:112
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
virtual void MapWindow()
map window
Definition: TGFrame.h:204
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
This class handles GUI labels.
Definition: TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1788
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
Set the numeric value (floating point representation).
virtual Double_t GetNumber() const
Get the numeric value (floating point representation).
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
virtual void SetState(Bool_t enable=kTRUE)
Set the active state.
virtual void SetFormat(EStyle style, EAttribute attr=TGNumberFormat::kNEAAnyNumber)
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEAAnyNumber
Attributes of number entry field.
Definition: TGNumberEntry.h:41
@ kNESReal
Real number.
Definition: TGNumberEntry.h:30
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Definition: TGTextBuffer.h:19
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
void SetEnabled(Bool_t flag=kTRUE)
Definition: TGTextEntry.h:149
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:499
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition: TGFrame.cxx:1955
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Int_t WidgetId() const
Definition: TGWidget.h:68
ROOT GUI Window base class.
Definition: TGWindow.h:23
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:152
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:130
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:343
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:869
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1027
Basic string class.
Definition: TString.h:136
void ToUpper()
Change string to upper case.
Definition: TString.cxx:1163
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition: TTimer.cxx:256
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
virtual void Modified(Bool_t flag=1)=0
virtual void Update()=0
TF1 * f1
Definition: legend1.C:11