ROOT logo
// @(#)root/fitpanel:$Id: TFitParametersDialog.h 26245 2008-11-17 16:32:49Z moneta $
// Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/06

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TFitParametersDialog
#define ROOT_TFitParametersDialog

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TFitParametersDialog                                                //
//                                                                      //
//  This class is used for fit function parameter settings.             //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGButton
#include "TGWidget.h"
#endif
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif

enum EFPDialogBound {
   kFPDBounded,
   kFPDNoneBounded
};

class TF1;
class TGNumberEntry;
class TGTextEntry;
class TGCheckButton;
class TGTextButton;
class TGTripleHSlider;
class TGNumberEntryField;
class TVirtualPad;


class TFitParametersDialog : public TGTransientFrame {

protected:
   TF1                 *fFunc;            // function passed to this dialog
   TVirtualPad         *fFpad;            // pad where the function is drawn
   Bool_t               fHasChanges;      // kTRUE if function was redrawn;
   Bool_t               fImmediateDraw;   // kTRUE if function is updated on run-time
   Int_t               *fRetCode;         // address to store return code
   Int_t                fNP;              // number of function parameters
   Double_t             fRangexmin;       // min function range
   Double_t             fRangexmax;       // max function range
   Double_t            *fPmin;            // min limits of patameters range
   Double_t            *fPmax;            // max limits of patameters range
   Double_t            *fPval;            // original patameters' values
   Double_t            *fPerr;            // original patameters' errors
   Double_t            *fPstp;            // original patameters' step
   TGCompositeFrame    *fContNam;         // container of parameter names
   TGCompositeFrame    *fContVal;         // container of parameter values
   TGCompositeFrame    *fContFix;         // container of fix settings
   TGCompositeFrame    *fContBnd;         // container of bound settings
   TGCompositeFrame    *fContSld;         // container of sliders
   TGCompositeFrame    *fContMin;         // container of min range values
   TGCompositeFrame    *fContMax;         // container of max range values
   TGCompositeFrame    *fContStp;         // container of step values
   TGCompositeFrame    *fContErr;         // container of error values
   TGTextEntry         **fParNam;         // parameter names
   TGCheckButton       **fParBnd;         // bound setting switch
   TGCheckButton       **fParFix;         // fix setting switch
   TGNumberEntry       **fParVal;         // parameter values
   TGNumberEntryField  **fParMin;         // min range values
   TGNumberEntryField  **fParMax;         // max range values
   TGNumberEntry       **fParStp;         // step values
   TGTripleHSlider     **fParSld;         // triple sliders
   TGNumberEntryField  **fParErr;         // error values
   TGCheckButton       *fUpdate;          // immediate update switch
   TGTextButton        *fApply;           // Apply button
   TGTextButton        *fReset;           // Reset button
   TGTextButton        *fOK;              // OK button
   TGTextButton        *fCancel;          // Cancel button

   void  DisconnectSlots();
public:
   TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func,
                        TVirtualPad *pad, Int_t *ret_code = 0);
   virtual ~TFitParametersDialog();

   virtual void  CloseWindow();
   virtual void  DoApply();
   virtual void  DoCancel();
   virtual void  DoOK();
   virtual void  DoParFix(Bool_t on);
   virtual void  DoParBound(Bool_t on);
   virtual void  DoParMaxLimit();
   virtual void  DoParMinLimit();
   virtual void  DoParStep();
   virtual void  DoParValue();
   virtual void  DoReset();
   virtual void  DoSlider();
   virtual void  DrawFunction();
   virtual void  HandleButtons(Bool_t update);

protected:
   void SetParameters();

   ClassDef(TFitParametersDialog, 0)  // Fit function parameters dialog
};

#endif
 TFitParametersDialog.h:1
 TFitParametersDialog.h:2
 TFitParametersDialog.h:3
 TFitParametersDialog.h:4
 TFitParametersDialog.h:5
 TFitParametersDialog.h:6
 TFitParametersDialog.h:7
 TFitParametersDialog.h:8
 TFitParametersDialog.h:9
 TFitParametersDialog.h:10
 TFitParametersDialog.h:11
 TFitParametersDialog.h:12
 TFitParametersDialog.h:13
 TFitParametersDialog.h:14
 TFitParametersDialog.h:15
 TFitParametersDialog.h:16
 TFitParametersDialog.h:17
 TFitParametersDialog.h:18
 TFitParametersDialog.h:19
 TFitParametersDialog.h:20
 TFitParametersDialog.h:21
 TFitParametersDialog.h:22
 TFitParametersDialog.h:23
 TFitParametersDialog.h:24
 TFitParametersDialog.h:25
 TFitParametersDialog.h:26
 TFitParametersDialog.h:27
 TFitParametersDialog.h:28
 TFitParametersDialog.h:29
 TFitParametersDialog.h:30
 TFitParametersDialog.h:31
 TFitParametersDialog.h:32
 TFitParametersDialog.h:33
 TFitParametersDialog.h:34
 TFitParametersDialog.h:35
 TFitParametersDialog.h:36
 TFitParametersDialog.h:37
 TFitParametersDialog.h:38
 TFitParametersDialog.h:39
 TFitParametersDialog.h:40
 TFitParametersDialog.h:41
 TFitParametersDialog.h:42
 TFitParametersDialog.h:43
 TFitParametersDialog.h:44
 TFitParametersDialog.h:45
 TFitParametersDialog.h:46
 TFitParametersDialog.h:47
 TFitParametersDialog.h:48
 TFitParametersDialog.h:49
 TFitParametersDialog.h:50
 TFitParametersDialog.h:51
 TFitParametersDialog.h:52
 TFitParametersDialog.h:53
 TFitParametersDialog.h:54
 TFitParametersDialog.h:55
 TFitParametersDialog.h:56
 TFitParametersDialog.h:57
 TFitParametersDialog.h:58
 TFitParametersDialog.h:59
 TFitParametersDialog.h:60
 TFitParametersDialog.h:61
 TFitParametersDialog.h:62
 TFitParametersDialog.h:63
 TFitParametersDialog.h:64
 TFitParametersDialog.h:65
 TFitParametersDialog.h:66
 TFitParametersDialog.h:67
 TFitParametersDialog.h:68
 TFitParametersDialog.h:69
 TFitParametersDialog.h:70
 TFitParametersDialog.h:71
 TFitParametersDialog.h:72
 TFitParametersDialog.h:73
 TFitParametersDialog.h:74
 TFitParametersDialog.h:75
 TFitParametersDialog.h:76
 TFitParametersDialog.h:77
 TFitParametersDialog.h:78
 TFitParametersDialog.h:79
 TFitParametersDialog.h:80
 TFitParametersDialog.h:81
 TFitParametersDialog.h:82
 TFitParametersDialog.h:83
 TFitParametersDialog.h:84
 TFitParametersDialog.h:85
 TFitParametersDialog.h:86
 TFitParametersDialog.h:87
 TFitParametersDialog.h:88
 TFitParametersDialog.h:89
 TFitParametersDialog.h:90
 TFitParametersDialog.h:91
 TFitParametersDialog.h:92
 TFitParametersDialog.h:93
 TFitParametersDialog.h:94
 TFitParametersDialog.h:95
 TFitParametersDialog.h:96
 TFitParametersDialog.h:97
 TFitParametersDialog.h:98
 TFitParametersDialog.h:99
 TFitParametersDialog.h:100
 TFitParametersDialog.h:101
 TFitParametersDialog.h:102
 TFitParametersDialog.h:103
 TFitParametersDialog.h:104
 TFitParametersDialog.h:105
 TFitParametersDialog.h:106
 TFitParametersDialog.h:107
 TFitParametersDialog.h:108
 TFitParametersDialog.h:109
 TFitParametersDialog.h:110
 TFitParametersDialog.h:111
 TFitParametersDialog.h:112