29 #include "WPropertyWrapper.h"
30 #include "core/common/WProperties.h"
44 return m_prop->getDescription();
49 return m_prop->toPropBool()->get( notify );
54 return m_prop->toPropInt()->get( notify );
59 return m_prop->toPropString()->get( notify );
64 return m_prop->toPropDouble()->get( notify );
69 return m_prop->toPropFilename()->get( notify ).string();
74 return static_cast< int >(
m_prop->toPropSelection()->get( notify ).getItemIndexOfSelected( 0 ) );
79 WColor c =
m_prop->toPropColor()->get( notify );
85 m_prop->toPropBool()->set( b,
false );
90 m_prop->toPropInt()->set( i,
false );
95 m_prop->toPropString()->set( s,
false );
100 m_prop->toPropDouble()->set( d,
false );
105 m_prop->toPropFilename()->set( boost::filesystem::path( fn ),
false );
111 it.push_back(
static_cast< std::size_t
>( s ) );
113 m_prop->toPropSelection()->set( sel,
false );
118 m_prop->toPropColor()->set( c.
get(),
false );
128 m_prop->getUpdateCondition()->wait();
Wraps the WColor class for scripts.
WColor const & get() const
Get the wrapped color.
This class represents a subset of a WItemSelection.
std::vector< size_t > IndexList
The type used for storing index lists.
std::shared_ptr< WPropertyBase > m_prop
The property.
std::string getName() const
Return the name of the property.
void setColor(WColorWrapper col)
Set the color of a color property.
void click()
Trigger a trigger property.
void setInt(int i)
Set the value of an integer property.
std::string getString(bool notify=false) const
Get the value of a string property.
std::string getDescription() const
Return the description of the property.
void setString(std::string const &s)
Set the value of a string property.
void setBool(bool b)
Set the value of a boolean property.
WPropertyWrapper(std::shared_ptr< WPropertyBase > prop)
Constructor.
void waitForUpdate()
Wait for the property to update its value.
bool getBool(bool notify=false) const
Get the value of a boolean property.
std::string getFilename(bool notify=false) const
Get the filename of a filename property.
void setFilename(std::string const &fn)
Set the filename of the filename property.
double getDouble(bool notify=false) const
Get the value of a double property.
WColorWrapper getColor(bool notify=false) const
Get the color of a color property.
int getSelection(bool notify=false) const
Get the (first) selected item of a selection property.
void setSelection(int s)
Sets the selected item of a selection.
int getInt(bool notify=false) const
Get the value of an integer property.
void setDouble(double d)
Set the value of a double property.
@ PV_TRIGGER_TRIGGERED
Trigger property: got triggered.