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/CEGUIMultiLineEditboxProperties.h"
00027 #include "elements/CEGUIMultiLineEditbox.h"
00028 #include "CEGUIPropertyHelper.h"
00029 #include "CEGUIExceptions.h"
00030 #include "CEGUIFont.h"
00031
00032
00033
00034 namespace CEGUI
00035 {
00036
00037
00038 namespace MultiLineEditboxProperties
00039 {
00040 String ReadOnly::get(const PropertyReceiver* receiver) const
00041 {
00042 return PropertyHelper::boolToString(static_cast<const MultiLineEditbox*>(receiver)->isReadOnly());
00043 }
00044
00045
00046 void ReadOnly::set(PropertyReceiver* receiver, const String& value)
00047 {
00048 static_cast<MultiLineEditbox*>(receiver)->setReadOnly(PropertyHelper::stringToBool(value));
00049 }
00050
00051
00052 String WordWrap::get(const PropertyReceiver* receiver) const
00053 {
00054 return PropertyHelper::boolToString(static_cast<const MultiLineEditbox*>(receiver)->isWordWrapped());
00055 }
00056
00057
00058 void WordWrap::set(PropertyReceiver* receiver, const String& value)
00059 {
00060 static_cast<MultiLineEditbox*>(receiver)->setWordWrapping(PropertyHelper::stringToBool(value));
00061 }
00062
00063
00064 String CaratIndex::get(const PropertyReceiver* receiver) const
00065 {
00066 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const MultiLineEditbox*>(receiver)->getCaratIndex()));
00067 }
00068
00069
00070 void CaratIndex::set(PropertyReceiver* receiver, const String& value)
00071 {
00072 static_cast<MultiLineEditbox*>(receiver)->setCaratIndex(PropertyHelper::stringToUint(value));
00073 }
00074
00075
00076 String SelectionStart::get(const PropertyReceiver* receiver) const
00077 {
00078 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const MultiLineEditbox*>(receiver)->getSelectionStartIndex()));
00079 }
00080
00081
00082 void SelectionStart::set(PropertyReceiver* receiver, const String& value)
00083 {
00084 MultiLineEditbox* eb = static_cast<MultiLineEditbox*>(receiver);
00085 uint selStart = PropertyHelper::stringToUint(value);
00086 eb->setSelection(selStart, selStart + eb->getSelectionLength());
00087 }
00088
00089
00090 String SelectionLength::get(const PropertyReceiver* receiver) const
00091 {
00092 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const MultiLineEditbox*>(receiver)->getSelectionLength()));
00093 }
00094
00095
00096 void SelectionLength::set(PropertyReceiver* receiver, const String& value)
00097 {
00098 MultiLineEditbox* eb = static_cast<MultiLineEditbox*>(receiver);
00099 uint selLen = PropertyHelper::stringToUint(value);
00100 eb->setSelection(eb->getSelectionStartIndex(), eb->getSelectionStartIndex() + selLen);
00101 }
00102
00103
00104 String MaxTextLength::get(const PropertyReceiver* receiver) const
00105 {
00106 return PropertyHelper::uintToString(static_cast<uint>(static_cast<const MultiLineEditbox*>(receiver)->getMaxTextLength()));
00107 }
00108
00109
00110 void MaxTextLength::set(PropertyReceiver* receiver, const String& value)
00111 {
00112 static_cast<MultiLineEditbox*>(receiver)->setMaxTextLength(PropertyHelper::stringToUint(value));
00113 }
00114
00115
00116 String NormalTextColour::get(const PropertyReceiver* receiver) const
00117 {
00118 return PropertyHelper::colourToString(static_cast<const MultiLineEditbox*>(receiver)->getNormalTextColour());
00119 }
00120
00121
00122 void NormalTextColour::set(PropertyReceiver* receiver, const String& value)
00123 {
00124 static_cast<MultiLineEditbox*>(receiver)->setNormalTextColour(PropertyHelper::stringToColour(value));
00125 }
00126
00127
00128 String SelectedTextColour::get(const PropertyReceiver* receiver) const
00129 {
00130 return PropertyHelper::colourToString(static_cast<const MultiLineEditbox*>(receiver)->getSelectedTextColour());
00131 }
00132
00133
00134 void SelectedTextColour::set(PropertyReceiver* receiver, const String& value)
00135 {
00136 static_cast<MultiLineEditbox*>(receiver)->setSelectedTextColour(PropertyHelper::stringToColour(value));
00137 }
00138
00139
00140 String ActiveSelectionColour::get(const PropertyReceiver* receiver) const
00141 {
00142 return PropertyHelper::colourToString(static_cast<const MultiLineEditbox*>(receiver)->getNormalSelectBrushColour());
00143 }
00144
00145
00146 void ActiveSelectionColour::set(PropertyReceiver* receiver, const String& value)
00147 {
00148 static_cast<MultiLineEditbox*>(receiver)->setNormalSelectBrushColour(PropertyHelper::stringToColour(value));
00149 }
00150
00151
00152 String InactiveSelectionColour::get(const PropertyReceiver* receiver) const
00153 {
00154 return PropertyHelper::colourToString(static_cast<const MultiLineEditbox*>(receiver)->getInactiveSelectBrushColour());
00155 }
00156
00157
00158 void InactiveSelectionColour::set(PropertyReceiver* receiver, const String& value)
00159 {
00160 static_cast<MultiLineEditbox*>(receiver)->setInactiveSelectBrushColour(PropertyHelper::stringToColour(value));
00161 }
00162
00163 }
00164
00165 }