Gorgon Game Engine
Inputbox< T_, V_, P_, DEFTMP_ > Class Template Reference

This class allows users to enter any value to an inputbox. More...

Inheritance diagram for Inputbox< T_, V_, P_, DEFTMP_ >:
[legend]

Public Types

using PropType = P_< UI::internal::prophelper< Inputbox< T_, V_, P_ >, T_ >, T_, &UI::internal::prophelper< Inputbox< T_, V_, P_ >, T_ >::get_, &UI::internal::prophelper< Inputbox< T_, V_, P_ >, T_ >::set_ >
 
using Type = T_
 
- Public Types inherited from Property< UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >, T_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::get_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::set_ >
using Type = T_
 

Public Member Functions

 Inputbox (const UI::Template &temp, std::function< void()> changedevent)
 Initializes the inputbox. More...
 
 Inputbox (const UI::Template &temp, T_ value, std::function< void()> changedevent)
 Initializes the inputbox. More...
 
 Inputbox (const UI::Template &temp, T_ value=T_())
 Initializes the inputbox. More...
 
 Inputbox (std::function< void()> changedevent, Registry::TemplateType type=DEFTMP_)
 Initializes the inputbox. More...
 
 Inputbox (T_ value, std::function< void()> changedevent, Registry::TemplateType type=DEFTMP_)
 Initializes the inputbox. More...
 
 Inputbox (T_ value=T_(), Registry::TemplateType type=DEFTMP_)
 Initializes the inputbox. More...
 
 operator T_ () const
 Returns the value in the box. More...
 
Inputboxoperator= (const Inputbox &value)
 Copy assignment will only copy the value. More...
 
Inputboxoperator= (const T_ value)
 Assignment to the value type. More...
 
- Public Member Functions inherited from Property< UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >, T_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::get_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::set_ >
 Property (const Property &)=delete
 
 Property (Property &&)=default
 
 Property (UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ > &Object)
 
 Property (UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ > *Object)
 
T_ Get () const
 
 operator const T_ () const
 
 operator T_ ()
 
bool operator!= (const T_ &v) const
 
T_ operator* () const
 
Propertyoperator= (const O_ &value)
 
Propertyoperator= (const Property &)=delete
 
Propertyoperator= (const Property< AC_, T_, G_, S_ > &prop)
 
Propertyoperator= (const T_ &value)
 
Propertyoperator= (Property &&)=default
 
bool operator== (const T_ &v) const
 
void Set (const T_ &value)
 

Public Attributes

Event< Inputbox, const T_ & > ChangedEvent
 Fired after the value of the inputbox is changed. More...
 
Event< InputboxEditedEvent
 Fired after the value of in the inputbox is edited. More...
 

Protected Member Functions

void changed () override
 
T_ get () const
 Returns the value in the box. More...
 
void set (const T_ &val)
 Changes the value in the box. More...
 
void updatevalue () override
 
void updatevaluedisplay (bool updatedisplay=true) override
 updates the value display More...
 

Additional Inherited Members

- Protected Attributes inherited from Property< UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >, T_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::get_, &UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ >::set_ >
UI::internal::prophelper< Inputbox< T_, UI::ConversionValidator< T_ >, Gorgon::Property >, T_ > & Object
 

Detailed Description

template<class T_, class V_ = UI::ConversionValidator<T_>, template< class C_, class PT_, PT_(C_::*Getter_)() const, void(C_::*Setter_)(const PT_ &)> class P_ = Gorgon::Property, Widgets::Registry::TemplateType DEFTMP_ = Widgets::Registry::Inputbox_Regular>
class Gorgon::Widgets::Inputbox< T_, V_, P_, DEFTMP_ >

This class allows users to enter any value to an inputbox.

This class is specialized as Textbox and Numberbox. It is possible to supply a validator to a specific inputbox. Inputbox is designed for value objects that can be copied and serialized to string.

Member Typedef Documentation

◆ PropType

using PropType = P_<UI::internal::prophelper<Inputbox<T_, V_, P_>, T_>, T_, &UI::internal::prophelper<Inputbox<T_, V_, P_>, T_>::get_, &UI::internal::prophelper<Inputbox<T_, V_, P_>, T_>::set_>

◆ Type

using Type = T_

Constructor & Destructor Documentation

◆ Inputbox() [1/6]

Inputbox ( const UI::Template temp,
T_  value = T_() 
)
explicit

Initializes the inputbox.

◆ Inputbox() [2/6]

Inputbox ( const UI::Template temp,
std::function< void()>  changedevent 
)
explicit

Initializes the inputbox.

◆ Inputbox() [3/6]

Inputbox ( const UI::Template temp,
T_  value,
std::function< void()>  changedevent 
)
explicit

Initializes the inputbox.

◆ Inputbox() [4/6]

Inputbox ( T_  value = T_(),
Registry::TemplateType  type = DEFTMP_ 
)
explicit

Initializes the inputbox.

◆ Inputbox() [5/6]

Inputbox ( std::function< void()>  changedevent,
Registry::TemplateType  type = DEFTMP_ 
)
explicit

Initializes the inputbox.

◆ Inputbox() [6/6]

Inputbox ( T_  value,
std::function< void()>  changedevent,
Registry::TemplateType  type = DEFTMP_ 
)
explicit

Initializes the inputbox.

Member Function Documentation

◆ changed()

void changed ( )
overrideprotected

◆ get()

T_ get ( ) const
protected

Returns the value in the box.

◆ operator T_()

operator T_ ( ) const

Returns the value in the box.

◆ operator=() [1/2]

Inputbox& operator= ( const Inputbox< T_, V_, P_, DEFTMP_ > &  value)

Copy assignment will only copy the value.

◆ operator=() [2/2]

Inputbox& operator= ( const T_  value)

Assignment to the value type.

◆ set()

void set ( const T_ &  val)
protected

Changes the value in the box.

◆ updatevalue()

void updatevalue ( )
overrideprotected

◆ updatevaluedisplay()

void updatevaluedisplay ( bool  updatedisplay = true)
overrideprotected

updates the value display

Member Data Documentation

◆ ChangedEvent

Event<Inputbox, const T_ &> ChangedEvent

Fired after the value of the inputbox is changed.

Parameter is the previous value before the change. If the user is typing, this event will be fired after the user hits enter or if enabled, after a set amount of time. This function will be called even if the value is not actually changed since the the last call.

◆ EditedEvent

Event<Inputbox> EditedEvent

Fired after the value of in the inputbox is edited.

This event will be called even if the user not done with editing. The value is updated before this event is called.


The documentation for this class was generated from the following file: