Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TFitParametersDialog.h
Go to the documentation of this file.
1 // @(#)root/fitpanel:$Id$
2 // Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/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 #ifndef ROOT_TFitParametersDialog
13 #define ROOT_TFitParametersDialog
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TFitParametersDialog //
18 // //
19 // This class is used for fit function parameter settings. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TGWidget.h"
24 #include "TGFrame.h"
25 
26 enum EFPDialogBound {
27  kFPDBounded,
28  kFPDNoneBounded
29 };
30 
31 /// Enumeration specifying if parameters
32 /// have been modified by the user
33 enum EFPDialogChange {
34  kFPDNoChange,
35  kFPDChange
36 };
37 
38 class TF1;
39 class TGNumberEntry;
40 class TGTextEntry;
41 class TGCheckButton;
42 class TGTextButton;
43 class TGTripleHSlider;
44 class TGNumberEntryField;
45 class TVirtualPad;
46 
47 
48 class TFitParametersDialog : public TGTransientFrame {
49 
50 protected:
51  TF1 *fFunc; // function passed to this dialog
52  TVirtualPad *fFpad; // pad where the function is drawn
53  Bool_t fHasChanges; // kTRUE if function was redrawn;
54  Bool_t fImmediateDraw; // kTRUE if function is updated on run-time
55  Int_t *fRetCode; // address to store return code
56  Int_t fNP; // number of function parameters
57  Double_t fRangexmin; // min function range
58  Double_t fRangexmax; // max function range
59  Double_t *fPmin; // min limits of patameters range
60  Double_t *fPmax; // max limits of patameters range
61  Double_t *fPval; // original patameters' values
62  Double_t *fPerr; // original patameters' errors
63  Double_t *fPstp; // original patameters' step
64  TGCompositeFrame *fContNam; // container of parameter names
65  TGCompositeFrame *fContVal; // container of parameter values
66  TGCompositeFrame *fContFix; // container of fix settings
67  TGCompositeFrame *fContBnd; // container of bound settings
68  TGCompositeFrame *fContSld; // container of sliders
69  TGCompositeFrame *fContMin; // container of min range values
70  TGCompositeFrame *fContMax; // container of max range values
71  TGCompositeFrame *fContStp; // container of step values
72  TGCompositeFrame *fContErr; // container of error values
73  TGTextEntry **fParNam; // parameter names
74  TGCheckButton **fParBnd; // bound setting switch
75  TGCheckButton **fParFix; // fix setting switch
76  TGNumberEntry **fParVal; // parameter values
77  TGNumberEntryField **fParMin; // min range values
78  TGNumberEntryField **fParMax; // max range values
79  TGNumberEntry **fParStp; // step values
80  TGTripleHSlider **fParSld; // triple sliders
81  TGNumberEntryField **fParErr; // error values
82  TGCheckButton *fUpdate; // immediate update switch
83  TGTextButton *fApply; // Apply button
84  TGTextButton *fReset; // Reset button
85  TGTextButton *fOK; // OK button
86  TGTextButton *fCancel; // Cancel button
87  TList fTextEntries; // list of text entries used for keyboard navigation
88 
89  void DisconnectSlots();
90 public:
91  TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func,
92  TVirtualPad *pad, Int_t *ret_code = 0);
93  virtual ~TFitParametersDialog();
94 
95  virtual void CloseWindow();
96  virtual void DoApply();
97  virtual void DoCancel();
98  virtual void DoOK();
99  virtual void DoParFix(Bool_t on);
100  virtual void DoParBound(Bool_t on);
101  virtual void DoParMaxLimit();
102  virtual void DoParMinLimit();
103  virtual void DoParStep();
104  virtual void DoParValue();
105  virtual void DoReset();
106  virtual void DoSlider();
107  virtual void DrawFunction();
108  virtual void HandleButtons(Bool_t update);
109  virtual void HandleShiftTab();
110  virtual void HandleTab();
111  virtual Bool_t HasChanges() { return fHasChanges; }
112 
113 protected:
114  void SetParameters();
115 
116  ClassDef(TFitParametersDialog, 0) // Fit function parameters dialog
117 };
118 
119 #endif