145 fParFix[
i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"DoParFix(Bool_t)");
158 fParBnd[
i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"DoParBound(Bool_t)");
177 (
fParVal[
i]->GetNumberEntry())->Connect(
"ReturnPressed()",
"TFitParametersDialog",
178 this,
"DoParValue()");
179 fParVal[
i]->Connect(
"ValueSet(Long_t)",
"TFitParametersDialog",
this,
"DoParValue()");
180 (
fParVal[
i]->GetNumberEntry())->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
181 (
fParVal[
i]->GetNumberEntry())->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
198 fParMin[
i]->Connect(
"ReturnPressed()",
"TFitParametersDialog",
this,
200 fParMin[
i]->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
201 fParMin[
i]->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
231 fParMax[
i]->Connect(
"ReturnPressed()",
"TFitParametersDialog",
this,
"DoParMaxLimit()");
232 fParMax[
i]->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
233 fParMax[
i]->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
249 (
fParStp[
i]->GetNumberEntry())->Connect(
"ReturnPressed()",
"TFitParametersDialog",
250 this,
"DoParStep()");
251 fParStp[
i]->Connect(
"ValueSet(Long_t)",
"TFitParametersDialog",
this,
"DoParStep()");
252 (
fParStp[
i]->GetNumberEntry())->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
253 (
fParStp[
i]->GetNumberEntry())->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
281 fUpdate->SetToolTipText(
"Immediate function redrawing");
284 fUpdate->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"HandleButtons(Bool_t)");
291 fReset->SetToolTipText(
"Reset the parameter settings");
293 fReset->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoReset()");
298 fApply->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoApply()");
299 fApply->SetToolTipText(
"Apply parameter settings and redraw the function");
303 fOK->SetToolTipText(
"Apply parameter settings, redraw function and close this dialog");
304 fOK->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoOK()");
308 fCancel->SetToolTipText(
"Close this dialog with no parameter changes");
309 fCancel->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoCancel()");
343 fParSld[
i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
345 fParSld[
i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
386 txt =
"Do you want to apply last parameters' setting?";
394 else if (ret ==
kMBNo)
432 txt =
"'Min' value cannot be bigger or equal to 'Max' - set the limits first!";
454 fFunc->ReleaseParameter(
i);
500 fParBnd[
i]->Disconnect(
"Toggled(Bool_t)");
516 fParSld[
i]->Disconnect(
"PointerPositionChanged()");
517 fParSld[
i]->Disconnect(
"PositionChanged()");
520 }
else if (!
fParMin[
i]->IsEnabled()) {
552 fParBnd[
i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
553 this,
"DoParBound(Bool_t)");
563 fParSld[
i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
565 fParSld[
i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
585 fParVal[
i]->GetNumberEntry()->ReturnPressed();
596 fFunc->ReleaseParameter(
i);
684 fParSld[
i]->Disconnect(
"PointerPositionChanged()");
685 fParSld[
i]->Disconnect(
"PositionChanged()");
687 fParBnd[
i]->Disconnect(
"Toggled(Bool_t)");
702 fParSld[
i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
704 fParSld[
i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
707 fParBnd[
i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
708 this,
"DoParBound(Bool_t)");
789 fFunc->ReleaseParameter(
i);
815 txt =
"'Min' cannot be bigger then 'Max' if this parameter is bounded.";
858 txt =
"'Min' cannot be bigger then 'Max' if this parameter is bounded.";
892 if ( !
fFpad )
return;
896 fFunc->SetLineStyle(2);
908 fFunc->SetLineStyle(st);
930 fParFix[
i]->Disconnect(
"Toggled(Bool_t)");
931 fParBnd[
i]->Disconnect(
"Toggled(Bool_t)");
932 fParVal[
i]->Disconnect(
"ValueSet(Long_t)");
933 fParMin[
i]->Disconnect(
"ReturnPressed()");
934 fParMax[
i]->Disconnect(
"ReturnPressed()");
935 fParSld[
i]->Disconnect(
"PointerPositionChanged()");
936 fParSld[
i]->Disconnect(
"PositionChanged()");
937 fParStp[
i]->Disconnect(
"ValueSet(Long_t)");
938 fParVal[
i]->Disconnect(
"TabPressed(Long_t)");
939 fParVal[
i]->Disconnect(
"ShiftTabPressed(Long_t)");
940 fParMin[
i]->Disconnect(
"TabPressed(Long_t)");
941 fParMin[
i]->Disconnect(
"ShiftTabPressed(Long_t)");
942 fParMax[
i]->Disconnect(
"TabPressed(Long_t)");
943 fParMax[
i]->Disconnect(
"ShiftTabPressed(Long_t)");
944 fParStp[
i]->Disconnect(
"TabPressed(Long_t)");
945 fParStp[
i]->Disconnect(
"ShiftTabPressed(Long_t)");
947 fUpdate->Disconnect(
"Toggled(Bool_t)");
948 fReset->Disconnect(
"Clicked()");
949 fApply->Disconnect(
"Clicked()");
950 fOK->Disconnect(
"Clicked()");
951 fCancel->Disconnect(
"Clicked()");
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
R__EXTERN void * gTQSender
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
int main(int argc, char *argv[])
Create a dialog for fit function parameter settings.
Int_t fNP
number of function parameters
TGCompositeFrame * fContMin
container of min range values
virtual void DoReset()
Slot related to the Reset button.
Double_t * fPval
original patameters' values
TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Int_t *ret_code=nullptr)
Bool_t fHasChanges
kTRUE if function was redrawn;
Double_t * fPmin
min limits of patameters range
virtual void DoSlider()
Slot related to the parameters' value settings.
TGNumberEntry ** fParStp
step values
TGCompositeFrame * fContVal
container of parameter values
TF1 * fFunc
function passed to this dialog
Double_t fRangexmin
min function range
TGTextButton * fApply
Apply button.
virtual void HandleTab()
Handle Tab key event (set focus to the next number entry field)
TGCheckButton ** fParFix
fix setting switch
TGCheckButton ** fParBnd
bound setting switch
virtual void HandleShiftTab()
Handle Shift+Tab key event (set focus to the previous number entry field)
TGNumberEntryField ** fParErr
error values
TGCompositeFrame * fContStp
container of step values
void DisconnectSlots()
Disconnect signals from slot methods.
TGCompositeFrame * fContNam
container of parameter names
Int_t * fRetCode
address to store return code
Double_t * fPmax
max limits of patameters range
void SetParameters()
Set the parameter values inside the function.
virtual void DoParStep()
Slot related to parameter step setting.
TGTextButton * fCancel
Cancel button.
TGNumberEntry ** fParVal
parameter values
TGTripleHSlider ** fParSld
triple sliders
Bool_t fImmediateDraw
kTRUE if function is updated on run-time
TGCompositeFrame * fContErr
container of error values
TGCompositeFrame * fContBnd
container of bound settings
virtual void DoApply()
Slot related to the Preview button.
TGNumberEntryField ** fParMax
max range values
virtual void DoCancel()
Slot related to the Cancel button.
virtual void DoParValue()
Slot related to the parameter value settings.
virtual void DoParFix(Bool_t on)
Slot related to the Fix check button.
TList fTextEntries
list of text entries used for keyboard navigation
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGCheckButton * fUpdate
immediate update switch
void CloseWindow() override
Close parameters' dialog.
Double_t * fPstp
original patameters' step
Double_t fRangexmax
max function range
Double_t * fPerr
original patameters' errors
TGNumberEntryField ** fParMin
min range values
virtual void DoOK()
Slot related to the OK button.
virtual void DoParBound(Bool_t on)
Slot related to the Bound check button.
TGCompositeFrame * fContFix
container of fix settings
~TFitParametersDialog() override
Destructor.
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
TVirtualPad * fFpad
pad where the function is drawn
virtual void DrawFunction()
Redraw function graphics.
TGCompositeFrame * fContMax
container of max range values
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
TGTextButton * fReset
Reset button.
TGTextEntry ** fParNam
parameter names
TGCompositeFrame * fContSld
container of sliders
TGTextButton * fOK
OK button.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Int_t GetState(TGFrame *f) const
Get state of sub frame.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void DeleteWindow()
Delete window.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
TGNumberEntry is a number entry input widget with up/down buttons.
TGClient * fClient
Connection to display server.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
virtual void SetFocus()
Set focus to this text entry.
void Home(Bool_t mark=kFALSE)
Moves the text cursor to the left end of the line.
TGTransientFrame(const TGTransientFrame &)=delete
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Mother of all ROOT objects.
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
small helper class to store/restore gPad context in TPad methods
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.