19 if (!motherBoard)
return nullptr;
21 const auto& controller = motherBoard->getMSXCommandController();
25const BaseSetting* ProxySetting::getSetting()
const
27 return const_cast<ProxySetting*
>(
this)->getSetting();
32 if (
auto*
setting = getSetting()) {
39 if (
const auto*
setting = getSetting()) {
40 return setting->getTypeString();
48 if (
const auto*
setting = getSetting()) {
49 return setting->getDescription();
57 if (
const auto*
setting = getSetting()) {
66 if (
const auto*
setting = getSetting()) {
67 return setting->getOptionalValue();
75 if (
const auto*
setting = getSetting()) {
76 return setting->getDefaultValue();
84 if (
auto*
setting = getSetting()) {
94 if (
const auto*
setting = getSetting()) {
101 if (
const auto*
setting = getSetting()) {
102 return setting->needLoadSave();
110 if (
const auto*
setting = getSetting()) {
111 return setting->needTransfer();
119 if (
const auto*
setting = getSetting()) {
120 setting->additionalInfo(result);
virtual void setValue(const TclObject &value)=0
Change the value of this setting to the given value.
std::string_view getFullName() const
SettingsManager & getSettingsManager()
bool needLoadSave() const override
Does this setting need to be loaded or saved (settings.xml).
void additionalInfo(TclObject &result) const override
Helper method for info().
std::optional< TclObject > getOptionalValue() const override
Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
TclObject getDefaultValue() const override
Get the default value of this setting.
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
void setValueDirect(const TclObject &value) override
Similar to setValue(), but doesn't trigger Tcl traces.
ProxySetting(Reactor &reactor, const TclObject &name)
const TclObject & getValue() const override
Get current value as a TclObject.
void setValue(const TclObject &value) override
Change the value of this setting to the given value.
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
std::string_view getDescription() const override
pure virtual methods ///
bool needTransfer() const override
Does this setting need to be transfered on reverse.
Contains the main loop of openMSX.
MSXMotherBoard * getMotherBoard() const
GlobalCommandController & getGlobalCommandController()
BaseSetting * findSetting(std::string_view name) const
Find the setting with given name.
This file implemented 3 utility functions: