52 #ifndef __PCL_NumericControl_h
53 #define __PCL_NumericControl_h
119 return ValueAsString( m_value );
172 virtual void SetRange(
double lower,
double upper );
219 EnableFixedPrecision( !disable );
237 EnableScientificNotation( !disable );
244 return m_sciTriggerExp;
266 EnableFixedSign( !disable );
273 return m_autoEditWidth;
280 if ( (m_autoEditWidth = enable) !=
false )
288 EnableAutoAdjustEditWidth( !disable );
305 m_useRegExp = enable;
314 EnableValidatingRegExp( !disable );
335 Control* onValueUpdatedReceiver =
nullptr;
337 EventHandlers() =
default;
338 EventHandlers(
const EventHandlers& ) =
default;
339 EventHandlers& operator =(
const EventHandlers& ) =
default;
345 double m_lowerBound = 0;
346 double m_upperBound = 1;
349 bool m_fixed =
false;
350 bool m_scientific =
false;
352 bool m_autoEditWidth =
true;
353 int m_sciTriggerExp = -1;
354 bool m_useRegExp =
true;
358 virtual void UpdateControls();
360 virtual void EditCompleted(
Edit& );
361 virtual void KeyPressed(
Control&,
int,
unsigned,
bool& );
362 virtual void ReturnPressed(
Edit& );
363 virtual void GetFocus(
Control& );
364 virtual void LoseFocus(
Control& );
367 int PrecisionForValue(
double )
const;
368 bool UseScientific(
double )
const;
411 void SetRange(
double lower,
double upper )
override;
448 return m_exponential;
471 EnableExponentialResponse( !disable );
476 void UpdateControls()
override;
478 virtual void ValueUpdated(
Slider&,
int );
479 void KeyPressed(
Control&,
int,
unsigned,
bool& )
override;
480 void GetFocus(
Control& )
override;
484 bool m_exponential =
false;
486 double SliderValueToControl(
int )
const;
487 int ControlValueToSlider(
double )
const;
Client-side interface to a PixInsight Control object.
Client-side interface to a PixInsight Edit control.
A generic point in the two-dimensional space.
Client-side interface to a PixInsight horizontal sizer.
Horizontal slider control.
Client-side interface to a PixInsight Label control.
A label/edit/slider compound control to edit numeric parameters.
HorizontalSlider slider
The Slider part of this NumericEdit control.
~NumericControl() override
bool IsExponentialResponse() const
void SetRange(double lower, double upper) override
void DisableExponentialResponse(bool disable=true)
void EnableExponentialResponse(bool enable=true)
NumericControl(Control &parent=Null())
A label/edit compound control to edit numeric parameters.
void(Control::*)(NumericEdit &sender, double value) value_event_handler
void SetReal(bool real=true)
bool IsScientificNotation() const
bool IsValidatingRegExpEnabled() const
double LowerBound() const
void SetInteger(bool integer=true)
void EnableAutoAdjustEditWidth(bool enable=true)
bool IsFixedPrecision() const
double UpperBound() const
void EnableFixedPrecision(bool enable=true)
NumericEdit(Control &parent=Null())
void OnValueUpdated(value_event_handler, Control &)
HorizontalSizer sizer
The Sizer object of this NumericEdit control.
String ValueAsString() const
String ValueAsString(double) const
void DisableAutoAdjustEditWidth(bool disable=true)
Label label
The Label part of this NumericEdit control.
Edit edit
The Edit part of this NumericEdit control.
void EnableFixedSign(bool enable=true)
void DisableFixedPrecision(bool disable=true)
bool IsAutoAdjustEditWidth() const
void DisableFixedSign(bool disable=true)
virtual void SetRange(double lower, double upper)
int ScientificNotationTriggerExponent() const
void SetScientificNotationTriggerExponent(int exp10)
void DisableScientificNotation(bool disable=true)
void DisableValidatingRegExp(bool disable=true)
void EnableScientificNotation(bool enable=true)
void EnableValidatingRegExp(bool enable=true)
Client-side interface to a PixInsight Slider control.
#define PCL_MEMBER_REENTRANCY_GUARD(member)