52 fTitle->SetToolTipText(
Form(
"Function expression or predefined name"));
58 fDrawMode->SetToolTipText(
"Immediate function redrawing");
67 fSetPars->SetToolTipText(
"Open a dialog for parameter(s) settings");
83 fNXpoints->GetNumberEntry()->SetToolTipText(
"Points along x-axis (4-100 000)");
124 fNXpoints->Connect(
"ValueSet(Long_t)",
"TF1Editor",
this,
"DoXPoints()");
125 (
fNXpoints->GetNumberEntry())->Connect(
"ReturnPressed()",
"TF1Editor",
126 this,
"DoXPoints()");
127 fSetPars->Connect(
"Clicked()",
"TF1Editor",
this,
"DoParameterSettings()");
128 fSliderX->Connect(
"Pressed()",
"TF1Editor",
this,
"DoSliderXPressed()");
129 fSliderX->Connect(
"Released()",
"TF1Editor",
this,
"DoSliderXReleased()");
130 fSliderX->Connect(
"PositionChanged()",
"TF1Editor",
this,
"DoSliderXMoved()");
147 const char *
text =
fF1->GetTitle();
161 TAxis *
x =
fF1->GetHistogram()->GetXaxis();
163 Int_t nxbinmin =
x->GetFirst();
164 Int_t nxbinmax =
x->GetLast();
167 fSldMinX->SetNumber(
x->GetBinLowEdge(nxbinmin));
168 fSldMaxX->SetNumber(
x->GetBinUpEdge(nxbinmax));
194 fF1->GetRange(rmin, rmax);
201 fF1->SetRange(rmin, rmax);
214 TAxis *
x =
fF1->GetHistogram()->GetXaxis();
225 fSldMinX->SetNumber(
x->GetBinLowEdge(
x->GetFirst()));
226 fSldMaxX->SetNumber(
x->GetBinUpEdge(
x->GetLast()));
235 fSldMinX->SetNumber(
x->GetBinLowEdge(
x->GetFirst()));
236 fSldMaxX->SetNumber(
x->GetBinUpEdge(
x->GetLast()));
253 TAxis *
x =
fF1->GetHistogram()->GetXaxis();
262 fSldMinX->SetNumber(
x->GetBinLowEdge(
x->GetFirst()));
263 fSldMaxX->SetNumber(
x->GetBinUpEdge(
x->GetLast()));
280 TAxis *
x =
fF1->GetHistogram()->GetXaxis();
289 fSldMinX->SetNumber(
x->GetBinLowEdge(
x->GetFirst()));
290 fSldMaxX->SetNumber(
x->GetBinUpEdge(
x->GetLast()));
304 TAxis *
x =
fF1->GetHistogram()->GetXaxis();
309 if ((
fSldMinX->GetNumber()+width/2) < (lowLimit))
311 if ((
fSldMaxX->GetNumber()-width/2) > (upLimit))
313 x->SetRangeUser(
fSldMinX->GetNumber()+width/2,
315 Int_t nxbinmin =
x->GetFirst();
316 Int_t nxbinmax =
x->GetLast();
ULong_t Pixel_t
Pixel value.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Class to manage histogram axis.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TGCheckButton * fDrawMode
immediate function redraw (if selected)
virtual void DoXRange()
Slot connected to min/max settings of the slider range.
virtual void DoParameterSettings()
Slot connected to the function parameter(s) settings.
virtual void DoSliderXReleased()
Slot connected to the x-Slider.
void ActivateBaseClassEditors(TClass *cl) override
Exclude TAttFillEditor from this interface.
TF1Editor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
virtual void DoXPoints()
Slot connected to the number of points setting.
virtual void DoSliderXMoved()
Slot connected to the x-Slider range for function redrawing.
TGLabel * fParLabel
label for number of parameters
virtual void DoSliderXPressed()
Slot connected to the x-Slider.
Int_t fNP
number of function parameters
TGNumberEntryField * fSldMinX
contains minimum value of x-axis
TGDoubleHSlider * fSliderX
slider to set x-axis range
TGNumberEntry * fNXpoints
number of points along x-axis
~TF1Editor() override
Destructor of TF1 editor.
void SetModel(TObject *obj) override
Pick up the function parameters and options.
TF1 * fF1
selected TF1 object
TGNumberEntryField * fSldMaxX
contains maximum value of x-axis
TGTextButton * fSetPars
open 'Set Parameters' dialog
TGTextEntry * fTitle
function title
virtual void ConnectSignals2Slots()
Connect signals to slots.
This class is used for function parameter settings.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
TGCompositeFrame(const TGCompositeFrame &)=delete
Dragging the slider will generate the event:
This class handles GUI labels.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system 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.
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
TGedEditor * fGedEditor
manager of this frame
TGedFrame(const TGedFrame &)=delete
Bool_t fInit
init flag for setting signals/slots
virtual void MakeTitle(const char *title)
Create attribute frame title.
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Bool_t fAvoidSignal
flag for executing slots
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
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
int main(int argc, char **argv)