openMSX
IntegerSetting.hh
Go to the documentation of this file.
1 #ifndef INTEGERSETTING_HH
2 #define INTEGERSETTING_HH
3 
4 #include "Setting.hh"
5 
6 namespace openmsx {
7 
10 class IntegerSetting final : public Setting
11 {
12 public:
13  IntegerSetting(CommandController& commandController,
14  string_view name, string_view description,
15  int initialValue, int minValue, int maxValue);
16 
17  string_view getTypeString() const override;
18  void additionalInfo(TclObject& result) const override;
19 
20  int getInt() const { return getValue().getInt(getInterpreter()); }
21  void setInt(int i);
22 
23 private:
24  const int minValue;
25  const int maxValue;
26 };
27 
28 } // namespace openmsx
29 
30 #endif
void additionalInfo(TclObject &result) const override
Helper method for info().
A Setting with an integer value.
IntegerSetting(CommandController &commandController, string_view name, string_view description, int initialValue, int minValue, int maxValue)
const TclObject & getValue() const final override
Gets the current value of this setting as a TclObject.
Definition: Setting.hh:134
string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
int getInt(Interpreter &interp) const
Definition: TclObject.cc:72
Interpreter & getInterpreter() const
Definition: Setting.cc:161