00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "elements/CEGUIComboboxProperties.h"
00027 #include "elements/CEGUICombobox.h"
00028 #include "CEGUIPropertyHelper.h"
00029
00030
00031
00032 namespace CEGUI
00033 {
00034
00035
00036 namespace ComboboxProperties
00037 {
00038 String ReadOnly::get(const PropertyReceiver* receiver) const
00039 {
00040 return PropertyHelper::boolToString(static_cast<const Combobox*>(receiver)->isReadOnly());
00041 }
00042
00043
00044 void ReadOnly::set(PropertyReceiver* receiver, const String& value)
00045 {
00046 static_cast<Combobox*>(receiver)->setReadOnly(PropertyHelper::stringToBool(value));
00047 }
00048
00049
00050 String ValidationString::get(const PropertyReceiver* receiver) const
00051 {
00052 return static_cast<const Combobox*>(receiver)->getValidationString();
00053 }
00054
00055
00056 void ValidationString::set(PropertyReceiver* receiver, const String& value)
00057 {
00058 static_cast<Combobox*>(receiver)->setValidationString(value);
00059 }
00060
00061
00062 String CaratIndex::get(const PropertyReceiver* receiver) const
00063 {
00064 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const Combobox*>(receiver)->getCaratIndex()));
00065 }
00066
00067
00068 void CaratIndex::set(PropertyReceiver* receiver, const String& value)
00069 {
00070 static_cast<Combobox*>(receiver)->setCaratIndex(PropertyHelper::stringToUint(value));
00071 }
00072
00073
00074 String EditSelectionStart::get(const PropertyReceiver* receiver) const
00075 {
00076 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const Combobox*>(receiver)->getSelectionStartIndex()));
00077 }
00078
00079
00080 void EditSelectionStart::set(PropertyReceiver* receiver, const String& value)
00081 {
00082 Combobox* eb = static_cast<Combobox*>(receiver);
00083 uint selStart = PropertyHelper::stringToUint(value);
00084 eb->setSelection(selStart, selStart + eb->getSelectionLength());
00085 }
00086
00087
00088 String EditSelectionLength::get(const PropertyReceiver* receiver) const
00089 {
00090 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const Combobox*>(receiver)->getSelectionLength()));
00091 }
00092
00093
00094 void EditSelectionLength::set(PropertyReceiver* receiver, const String& value)
00095 {
00096 Combobox* eb = static_cast<Combobox*>(receiver);
00097 uint selLen = PropertyHelper::stringToUint(value);
00098 eb->setSelection(eb->getSelectionStartIndex(), eb->getSelectionStartIndex() + selLen);
00099 }
00100
00101
00102 String MaxEditTextLength::get(const PropertyReceiver* receiver) const
00103 {
00104 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const Combobox*>(receiver)->getMaxTextLength()));
00105 }
00106
00107
00108 void MaxEditTextLength::set(PropertyReceiver* receiver, const String& value)
00109 {
00110 static_cast<Combobox*>(receiver)->setMaxTextLength(PropertyHelper::stringToUint(value));
00111 }
00112
00113
00114 String NormalEditTextColour::get(const PropertyReceiver* receiver) const
00115 {
00116 return PropertyHelper::colourToString(static_cast<const Combobox*>(receiver)->getNormalTextColour());
00117 }
00118
00119
00120 void NormalEditTextColour::set(PropertyReceiver* receiver, const String& value)
00121 {
00122 static_cast<Combobox*>(receiver)->setNormalTextColour(PropertyHelper::stringToColour(value));
00123 }
00124
00125
00126 String SelectedEditTextColour::get(const PropertyReceiver* receiver) const
00127 {
00128 return PropertyHelper::colourToString(static_cast<const Combobox*>(receiver)->getSelectedTextColour());
00129 }
00130
00131
00132 void SelectedEditTextColour::set(PropertyReceiver* receiver, const String& value)
00133 {
00134 static_cast<Combobox*>(receiver)->setSelectedTextColour(PropertyHelper::stringToColour(value));
00135 }
00136
00137
00138 String ActiveEditSelectionColour::get(const PropertyReceiver* receiver) const
00139 {
00140 return PropertyHelper::colourToString(static_cast<const Combobox*>(receiver)->getNormalSelectBrushColour());
00141 }
00142
00143
00144 void ActiveEditSelectionColour::set(PropertyReceiver* receiver, const String& value)
00145 {
00146 static_cast<Combobox*>(receiver)->setNormalSelectBrushColour(PropertyHelper::stringToColour(value));
00147 }
00148
00149
00150 String InactiveEditSelectionColour::get(const PropertyReceiver* receiver) const
00151 {
00152 return PropertyHelper::colourToString(static_cast<const Combobox*>(receiver)->getInactiveSelectBrushColour());
00153 }
00154
00155
00156 void InactiveEditSelectionColour::set(PropertyReceiver* receiver, const String& value)
00157 {
00158 static_cast<Combobox*>(receiver)->setInactiveSelectBrushColour(PropertyHelper::stringToColour(value));
00159 }
00160
00161
00162 String SortList::get(const PropertyReceiver* receiver) const
00163 {
00164 return PropertyHelper::boolToString(static_cast<const Combobox*>(receiver)->isSortEnabled());
00165 }
00166
00167
00168 void SortList::set(PropertyReceiver* receiver, const String& value)
00169 {
00170 static_cast<Combobox*>(receiver)->setSortingEnabled(PropertyHelper::stringToBool(value));
00171 }
00172
00173
00174 String ForceVertScrollbar::get(const PropertyReceiver* receiver) const
00175 {
00176 return PropertyHelper::boolToString(static_cast<const Combobox*>(receiver)->isVertScrollbarAlwaysShown());
00177 }
00178
00179
00180 void ForceVertScrollbar::set(PropertyReceiver* receiver, const String& value)
00181 {
00182 static_cast<Combobox*>(receiver)->setShowVertScrollbar(PropertyHelper::stringToBool(value));
00183 }
00184
00185
00186 String ForceHorzScrollbar::get(const PropertyReceiver* receiver) const
00187 {
00188 return PropertyHelper::boolToString(static_cast<const Combobox*>(receiver)->isHorzScrollbarAlwaysShown());
00189 }
00190
00191
00192 void ForceHorzScrollbar::set(PropertyReceiver* receiver, const String& value)
00193 {
00194 static_cast<Combobox*>(receiver)->setShowHorzScrollbar(PropertyHelper::stringToBool(value));
00195 }
00196
00197
00198 String SingleClickMode::get(const PropertyReceiver* receiver) const
00199 {
00200 return PropertyHelper::boolToString(static_cast<const Combobox*>(receiver)->getSingleClickEnabled());
00201 }
00202
00203
00204 void SingleClickMode::set(PropertyReceiver* receiver, const String& value)
00205 {
00206 static_cast<Combobox*>(receiver)->setSingleClickEnabled(PropertyHelper::stringToBool(value));
00207 }
00208
00209
00210 }
00211
00212 }