xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::bindings::TextField Class Referencefinal

A single-line text field. More...

#include <xentara/workbench/bindings/TextField.hpp>

+ Inheritance diagram for xentara::workbench::bindings::TextField:

Classes

struct  Options
 Options for the binding. More...
 

Public Member Functions

template<StringBindable< std::string > Property>
 TextField (PropertyController &propertyController, Property &property, Options options)
 Constructor that accesses the variable holding a property’s value directly.
 
template<typename Object , StringGetter< std::string, Object > GetterType, StringSetter< std::string, Object > SetterType>
 TextField (const PropertyHandle &property, Object &object, GetterType get, SetterType set, Options options)
 Constructor that uses a getter and setter to access a property.
 
template<typename Object , StringGetter< std::string, Object > GetterType, StringSetter< std::string, Object > SetterType, StringChecker< std::string, Object > CheckerType>
 TextField (const PropertyHandle &property, Object &object, GetterType get, SetterType set, CheckerType check, Options options)
 Constructor that uses a getter, a setter, and a checker to access a property.
 

Detailed Description

A single-line text field.

Constructor & Destructor Documentation

◆ TextField() [1/3]

template<StringBindable< std::string > Property>
xentara::workbench::bindings::TextField::TextField ( PropertyController propertyController,
Property &  property,
Options  options 
)

Constructor that accesses the variable holding a property’s value directly.

Attention
This constructor can only be used for address-based properties.
Parameters
propertyControllerThe property controller that manages the property
propertyA reference to the variable holding the property’s value.
optionsThe binding options

◆ TextField() [2/3]

template<typename Object , StringGetter< std::string, Object > GetterType, StringSetter< std::string, Object > SetterType>
xentara::workbench::bindings::TextField::TextField ( const PropertyHandle property,
Object &  object,
GetterType  get,
SetterType  set,
Options  options 
)

Constructor that uses a getter and setter to access a property.

Parameters
propertyA handle to the bound property
objectThe object on which the getter and setter should be called
getThe getter function
setThe setter function
optionsThe binding options

◆ TextField() [3/3]

template<typename Object , StringGetter< std::string, Object > GetterType, StringSetter< std::string, Object > SetterType, StringChecker< std::string, Object > CheckerType>
xentara::workbench::bindings::TextField::TextField ( const PropertyHandle property,
Object &  object,
GetterType  get,
SetterType  set,
CheckerType  check,
Options  options 
)

Constructor that uses a getter, a setter, and a checker to access a property.

Parameters
propertyA handle to the bound property
objectThe object on which the getter and setter should be called
getThe getter function
setThe setter function
check

The checker function. The check function will be called with a potential new value before it is set. If the function returns false, then the value is not set. Normally, this callback should return false if the new value is the same or equivalent to the current value.

If the value has an invalid format, you can return an unexpected value containing an internationalized, human readable error string.

optionsThe binding options