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/CEGUIFrameWindowProperties.h"
00027 #include "elements/CEGUIFrameWindow.h"
00028 #include "CEGUIPropertyHelper.h"
00029 #include "CEGUIExceptions.h"
00030 #include "CEGUIFont.h"
00031
00032
00033
00034 namespace CEGUI
00035 {
00036
00037
00038 namespace FrameWindowProperties
00039 {
00040 String SizingEnabled::get(const PropertyReceiver* receiver) const
00041 {
00042 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isSizingEnabled());
00043 }
00044
00045
00046 void SizingEnabled::set(PropertyReceiver* receiver, const String& value)
00047 {
00048 static_cast<FrameWindow*>(receiver)->setSizingEnabled(PropertyHelper::stringToBool(value));
00049 }
00050
00051
00052 String FrameEnabled::get(const PropertyReceiver* receiver) const
00053 {
00054 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isFrameEnabled());
00055 }
00056
00057
00058 void FrameEnabled::set(PropertyReceiver* receiver, const String& value)
00059 {
00060 static_cast<FrameWindow*>(receiver)->setFrameEnabled(PropertyHelper::stringToBool(value));
00061 }
00062
00063
00064 String TitlebarEnabled::get(const PropertyReceiver* receiver) const
00065 {
00066 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isTitleBarEnabled());
00067 }
00068
00069
00070 void TitlebarEnabled::set(PropertyReceiver* receiver, const String& value)
00071 {
00072 static_cast<FrameWindow*>(receiver)->setTitleBarEnabled(PropertyHelper::stringToBool(value));
00073 }
00074
00075
00076 String CloseButtonEnabled::get(const PropertyReceiver* receiver) const
00077 {
00078 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isCloseButtonEnabled());
00079 }
00080
00081
00082 void CloseButtonEnabled::set(PropertyReceiver* receiver, const String& value)
00083 {
00084 static_cast<FrameWindow*>(receiver)->setCloseButtonEnabled(PropertyHelper::stringToBool(value));
00085 }
00086
00087
00088 String DragMovingEnabled::get(const PropertyReceiver* receiver) const
00089 {
00090 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isDragMovingEnabled());
00091 }
00092
00093
00094 void DragMovingEnabled::set(PropertyReceiver* receiver, const String& value)
00095 {
00096 static_cast<FrameWindow*>(receiver)->setDragMovingEnabled(PropertyHelper::stringToBool(value));
00097 }
00098
00099
00100 String RollUpEnabled::get(const PropertyReceiver* receiver) const
00101 {
00102 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isRollupEnabled());
00103 }
00104
00105
00106 void RollUpEnabled::set(PropertyReceiver* receiver, const String& value)
00107 {
00108 static_cast<FrameWindow*>(receiver)->setRollupEnabled(PropertyHelper::stringToBool(value));
00109 }
00110
00111
00112 String RollUpState::get(const PropertyReceiver* receiver) const
00113 {
00114 return PropertyHelper::boolToString(static_cast<const FrameWindow*>(receiver)->isRolledup());
00115 }
00116
00117
00118 void RollUpState::set(PropertyReceiver* receiver, const String& value)
00119 {
00120 bool reqState = PropertyHelper::stringToBool(value);
00121
00122 if (reqState != static_cast<FrameWindow*>(receiver)->isRolledup())
00123 {
00124 static_cast<FrameWindow*>(receiver)->toggleRollup();
00125 }
00126
00127 }
00128
00129
00130 String SizingBorderThickness::get(const PropertyReceiver* receiver) const
00131 {
00132 return PropertyHelper::floatToString(static_cast<const FrameWindow*>(receiver)->getSizingBorderThickness());
00133 }
00134
00135
00136 void SizingBorderThickness::set(PropertyReceiver* receiver, const String& value)
00137 {
00138 static_cast<FrameWindow*>(receiver)->setSizingBorderThickness(PropertyHelper::stringToFloat(value));
00139 }
00140
00141
00142 String TitlebarFont::get(const PropertyReceiver* receiver) const
00143 {
00144 return static_cast<const FrameWindow*>(receiver)->getTitlebarFont()->getName();
00145 }
00146
00147
00148 void TitlebarFont::set(PropertyReceiver* receiver, const String& value)
00149 {
00150 if (value.empty())
00151 {
00152 static_cast<FrameWindow*>(receiver)->setTitlebarFont(System::getSingleton().getDefaultFont());
00153 }
00154 else
00155 {
00156 static_cast<FrameWindow*>(receiver)->setTitlebarFont(value);
00157 }
00158 }
00159
00160 String CaptionColour::get(const PropertyReceiver* receiver) const
00161 {
00162 return PropertyHelper::colourToString(static_cast<const FrameWindow*>(receiver)->getCaptionColour());
00163 }
00164
00165 void CaptionColour::set(PropertyReceiver* receiver, const String& value)
00166 {
00167 static_cast<FrameWindow*>(receiver)->setCaptionColour(PropertyHelper::stringToColour(value));
00168 }
00169
00170 String NSSizingCursorImage::get(const PropertyReceiver* receiver) const
00171 {
00172 const Image* img = static_cast<const FrameWindow*>(receiver)->getNSSizingCursorImage();
00173 return img ? PropertyHelper::imageToString(img) : String("");
00174 }
00175
00176 void NSSizingCursorImage::set(PropertyReceiver* receiver, const String &value)
00177 {
00178 static_cast<FrameWindow*>(receiver)->setNSSizingCursorImage(PropertyHelper::stringToImage(value));
00179 }
00180
00181 String EWSizingCursorImage::get(const PropertyReceiver* receiver) const
00182 {
00183 const Image* img = static_cast<const FrameWindow*>(receiver)->getEWSizingCursorImage();
00184 return img ? PropertyHelper::imageToString(img) : String("");
00185 }
00186
00187 void EWSizingCursorImage::set(PropertyReceiver* receiver, const String &value)
00188 {
00189 static_cast<FrameWindow*>(receiver)->setEWSizingCursorImage(PropertyHelper::stringToImage(value));
00190 }
00191
00192 String NWSESizingCursorImage::get(const PropertyReceiver* receiver) const
00193 {
00194 const Image* img = static_cast<const FrameWindow*>(receiver)->getNWSESizingCursorImage();
00195 return img ? PropertyHelper::imageToString(img) : String("");
00196 }
00197
00198 void NWSESizingCursorImage::set(PropertyReceiver* receiver, const String &value)
00199 {
00200 static_cast<FrameWindow*>(receiver)->setNWSESizingCursorImage(PropertyHelper::stringToImage(value));
00201 }
00202
00203 String NESWSizingCursorImage::get(const PropertyReceiver* receiver) const
00204 {
00205 const Image* img = static_cast<const FrameWindow*>(receiver)->getNESWSizingCursorImage();
00206 return img ? PropertyHelper::imageToString(img) : String("");
00207 }
00208
00209 void NESWSizingCursorImage::set(PropertyReceiver* receiver, const String &value)
00210 {
00211 static_cast<FrameWindow*>(receiver)->setNESWSizingCursorImage(PropertyHelper::stringToImage(value));
00212 }
00213
00214
00215 }
00216
00217 }