46 #if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) 47 #error "Only <final/final.h> can be included directly." 52 #include "final/fwidget.h" 53 #include "final/widget/flineedit.h" 69 using FWidget::setGeometry;
70 using LabelOrientation = FLineEdit::LabelOrientation;
79 auto getClassName()
const ->
FString override;
80 auto getValue()
const noexcept -> sInt64;
81 auto getPrefix()
const ->
FString;
82 auto getSuffix()
const ->
FString;
83 auto getLabelOrientation()
const -> LabelOrientation;
86 void setSize (
const FSize&,
bool =
true)
override;
87 void setGeometry (
const FPoint&,
const FSize&,
bool =
true)
override;
88 void setEnable (
bool =
true)
override;
89 void unsetEnable()
override;
90 void setDisable()
override;
91 void setShadow (
bool =
true);
93 void setValue (sInt64);
94 void setMinValue (sInt64);
95 void setMaxValue (sInt64);
96 void setRange (sInt64, sInt64);
97 void setPrefix (
const FString&);
98 void setSuffix (
const FString&);
99 void setLabelText (
const FString&);
100 void setLabelOrientation (
const LabelOrientation);
103 auto hasShadow()
const -> bool;
106 void hide()
override;
119 enum class SpiningState
128 void draw()
override;
129 void updateInputField();
130 void increaseValue (sInt64 = 1);
131 void decreaseValue (sInt64 = 1);
132 void processActivate()
const;
133 void processChanged()
const;
137 void cb_inputFieldActivate()
const;
138 void cb_inputFieldChange (
const FLineEdit&);
143 sInt64 min{std::numeric_limits<sInt64>::min()};
144 sInt64 max{std::numeric_limits<sInt64>::max()};
147 SpiningState spining_state{SpiningState::None};
148 bool threshold_reached{
false};
149 int threshold_time{500};
156 inline auto FSpinBox::getClassName()
const ->
FString 157 {
return "FSpinBox"; }
160 inline auto FSpinBox::getValue()
const noexcept -> sInt64
164 inline auto FSpinBox::getPrefix()
const ->
FString 168 inline auto FSpinBox::getSuffix()
const ->
FString 172 inline auto FSpinBox::getLabelOrientation()
const -> FLineEdit::LabelOrientation
173 {
return input_field.getLabelOrientation(); }
176 inline void FSpinBox::unsetEnable()
177 { setEnable(
false); }
180 inline void FSpinBox::setDisable()
181 { setEnable(
false); }
184 inline void FSpinBox::unsetShadow()
185 { setShadow(
false); }
188 inline auto FSpinBox::hasShadow()
const ->
bool 189 {
return getFlags().shadow.shadow; }
192 inline void FSpinBox::setLabelText (
const FString& s)
193 { input_field.setLabelText(s); }
196 inline void FSpinBox::setLabelOrientation (
const LabelOrientation o)
197 { input_field.setLabelOrientation(o); }
Definition: class_template.cpp:25
Definition: fspinbox.h:65
Definition: flineedit.h:67