Parameter for indexed strings selected from a predefined list of strings. If ParamType
is of type ParamsBase::IndexedTextList, then extend TypedParamBase's
functionality by providing text list functionality and by overriding AddToDialogChild(). In this case, the parameter does not store the string itself, but the selected index (of type Util::TextListIndexType) of the predefined text list.
More...
#include <Object.h>
|
virtual void | AddToDialogChild (ParamsConfigDialog &Dialog) override final |
| Appends this parameter to a settings dialog making it configurable by the user.
|
|
virtual bool | ValidateValue (const ParamType &Value) const override |
| Called by ValidateChild(). Validates a single value. Override to validate the value which is about to be assigned to the parameter. Returns true by default.
|
|
|
using | UnderlyingType = ParamType |
|
ParamsBaseOnlyType | ParamsBaseOnly |
| Provides the class ParamsBase access to some private members of class ParamBase .
|
|
| TypedParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange=true, ParamType DefaultValue=ParamType()) |
| Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true).
|
|
| TypedParamBase (ParamsBase &Owner, std::string ParamName, ParamType DefaultValue=ParamType()) |
| Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false).
|
|
virtual void | ToXMLNodeChild (QDomDocument &Document, QDomElement &XMLElement) const override |
| Converts this parameter to a Qt dom element (describing an XML node containing this parameter's name and value).
|
|
virtual void | FromXMLNodeChild (const QDomElement &XMLElement) override |
| Restores this parameter's value from the given Qt dom element (describing an XML node)
|
|
| ParamBase (ParamsBase &Owner, std::string ParamName, std::string_view ParamTitle, std::string_view ParamDescription, bool NeedsResetToApplyChange) |
| Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true).
|
|
| ParamBase (ParamsBase &Owner, std::string ParamName) |
| Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false).
|
|
virtual | ~ParamBase ()=0 |
|
const auto & | GetOwner () const noexcept |
| Returns the ParamsBase instance owning this ParamBase instance.
|
|
auto & | GetOwner () noexcept |
| Returns the ParamsBase instance owning this ParamBase instance.
|
|
template<typename ParamType>
class DynExp::ParamsBase::Param< ParamType, std::enable_if_t< std::is_base_of_v< IndexedTextList, ParamType > > >
Parameter for indexed strings selected from a predefined list of strings. If ParamType
is of type ParamsBase::IndexedTextList, then extend TypedParamBase's
functionality by providing text list functionality and by overriding AddToDialogChild(). In this case, the parameter does not store the string itself, but the selected index (of type Util::TextListIndexType) of the predefined text list.
- Template Parameters
-
Definition at line 992 of file Object.h.
◆ Param() [1/2]
template<typename ParamType >
Base constructor of any parameter to be used if a parameter should be displayed in a settings dialog (UserEditable is set to true).
- Parameters
-
Owner | ParamsBase instance owning this parameter. |
ParamName | Name of the parameter to be used in the XML config file. std::string to allow for auto-generated names. |
ParamTitle | Title of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected. |
ParamDescription | Detailed description of the parameter to be displayed in settings dialogs. A static string literal with a constant address is expected. |
NeedsResetToApplyChange | Indicated whether the object this parameter belongs to needs to be reset to apply changes if this parameter's value has changed. |
DefaultValue | Default value to assign to the constructed parameter |
TextList | Predefined list of strings to select a string from |
Definition at line 1001 of file Object.h.
◆ Param() [2/2]
template<typename ParamType >
Base constructor of any parameter to be used if a parameter should not be displayed in a settings dialog (UserEditable is set to false).
- Parameters
-
Owner | ParamsBase instance owning this parameter. |
ParamName | Name of the parameter to be used in the XML config file. std::string to allow for auto-generated names. |
DefaultValue | Default value to assign to the constructed parameter |
TextList | List of strings to select a string from |
Definition at line 1010 of file Object.h.
◆ AddToDialogChild()
template<typename ParamType >
|
inlinefinaloverrideprivatevirtual |
Appends this parameter to a settings dialog making it configurable by the user.
- Parameters
-
Dialog | Reference to the settings dialog to append the parameter to |
Implements DynExp::ParamsBase::ParamBase.
Definition at line 1023 of file Object.h.
◆ GetTextList()
template<typename ParamType >
Returns the predefined selection options as a list of strings.
Definition at line 1019 of file Object.h.
◆ operator=()
template<typename ParamType >
Assigns a new value to this parameter. The operator cannot be accessed by Object
because this function is not const.
- Parameters
-
NewValue | New value to assign |
- Returns
- Reference to this parameter
- Exceptions
-
Definition at line 587 of file Object.h.
◆ ValidateValue()
template<typename ParamType >
|
inlineoverrideprivatevirtual |
Called by ValidateChild(). Validates a single value. Override to validate the value which is about to be assigned to the parameter. Returns true by default.
- Parameters
-
NewValue | Value to be validated before the assignment |
- Returns
- Returns true if
NewValue
is considered valid, false otherwise.
Reimplemented from DynExp::ParamsBase::TypedParamBase< ParamType >.
Definition at line 1029 of file Object.h.
◆ TextList
template<typename ParamType >
Predefined selection options.
Definition at line 1031 of file Object.h.
The documentation for this class was generated from the following file: