26 #define YUILogComponent "ui"
29 #include "YUISymbols.h"
30 #include "YComboBox.h"
31 #include "YUIException.h"
39 : editable( editable )
40 , inputMaxLength( -1 )
56 YUI_CHECK_NEW( priv );
68 return priv->editable;
74 return priv->validChars;
80 priv->validChars= newValidChars;
86 return priv->inputMaxLength;
92 priv->inputMaxLength = len;
140 string currentText =
text();
188 propSet.
add(
YProperty( YUIProperty_Value, YOtherProperty ) );
189 propSet.
add(
YProperty( YUIProperty_Items, YOtherProperty ) );
190 propSet.
add(
YProperty( YUIProperty_Label, YStringProperty ) );
191 propSet.
add(
YProperty( YUIProperty_ValidChars, YStringProperty ) );
192 propSet.
add(
YProperty( YUIProperty_InputMaxLength, YIntegerProperty ) );
193 propSet.
add(
YProperty( YUIProperty_IconPath, YStringProperty ) );
206 if ( propertyName == YUIProperty_Value )
return false;
207 else if ( propertyName == YUIProperty_Items )
return false;
210 else if ( propertyName == YUIProperty_InputMaxLength )
setInputMaxLength( val.integerVal() );
226 if ( propertyName == YUIProperty_Value )
return YPropertyValue( YOtherProperty );
227 else if ( propertyName == YUIProperty_Items )
return YPropertyValue( YOtherProperty );
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
int inputMaxLength() const
The maximum input length, i.e., the maximum number of characters the user can enter.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
virtual void setText(const std::string &newText)=0
Set this ComboBox's current value as text.
std::string validChars()
Get the valid input characters.
virtual void setInputMaxLength(int numberOfChars)
Set the maximum input length, i.e., the maximum number of characters the user can enter.
virtual YItemCollection selectedItems()
Return all selected items.
virtual const YPropertySet & propertySet()
Return this class's property set.
virtual ~YComboBox()
Destructor.
virtual std::string text()=0
Return this ComboBox's current value as text.
virtual void selectItem(YItem *item, bool selected=true)
Select or deselect an item.
bool editable() const
Return 'true' if this ComboBox is editable, i.e.
virtual void setValidChars(const std::string &validChars)
Set the valid input characters.
virtual YItem * selectedItem()
Return the (first) selected item or 0 if none is selected or if this ComboBox is editable and the use...
void setValue(const std::string &newText)
Set the value of this ComboBox by string: Try to find a list item with that label and select it.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
YComboBox(YWidget *parent, const std::string &label, bool editable)
Constructor.
std::string value()
Return the value of this ComboBox:
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
std::string label() const
Return this item's label.
void setSelected(bool sel=true)
Select or unselect this item.
A set of properties to check names and types against.
void check(const std::string &propertyName) const
Check if a property 'propertyName' exists in this property set.
bool isEmpty() const
Returns 'true' if this property set does not contain anything.
void add(const YProperty &prop)
Add a property to this property set.
Transport class for the value of simple properties.
std::string stringVal() const
Methods to get the value of this property.
YPropertyType type() const
Returns the type of this property value.
Class for widget properties.
Base class for UI Exceptions.