Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUIMultiLineEditboxProperties.cpp

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIMultiLineEditboxProperties.cpp
00003         created:        10/7/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Implements properties for the MultiLineEditbox class
00007 *************************************************************************/
00008 /*************************************************************************
00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Start of CEGUI namespace section
00034 namespace CEGUI
00035 {
00036 
00037 // Start of MultiLineEditboxProperties namespace section
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<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<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<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<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 } // End of  MultiLineEditboxProperties namespace section
00164 
00165 } // End of  CEGUI namespace section

Generated on Wed Feb 16 12:41:07 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1