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

CEGUIWindowProperties.cpp

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIWindowProperties.cpp
00003         created:        5/7/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Implementation of available window base class properties
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 "CEGUIWindowProperties.h"
00027 #include "CEGUIWindow.h"
00028 #include "CEGUIFont.h"
00029 #include "CEGUIPropertyHelper.h"
00030 #include "CEGUIExceptions.h"
00031 #include <cstdlib>
00032 #include <cstdio>
00033 
00034 // Start of CEGUI namespace section
00035 namespace CEGUI
00036 {
00037 // Start of WindowProperties namespace section
00038 namespace WindowProperties
00039 {
00040 
00041 String RelativeMinSize::get(const PropertyReceiver* receiver) const
00042 {
00043         CEGUI::Size msz(static_cast<const Window*>(receiver)->getMinimumSize());
00044 
00045         if (static_cast<const Window*>(receiver)->getMetricsMode() == Absolute)
00046         {
00047                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00048 
00049                 msz.d_width      /= dsz.d_width;
00050                 msz.d_height /= dsz.d_height;
00051         }
00052 
00053         return PropertyHelper::sizeToString(msz);
00054 }
00055 
00056 
00057 void RelativeMinSize::set(PropertyReceiver* receiver, const String& value)
00058 {
00059         CEGUI::Size msz(PropertyHelper::stringToSize(value));
00060 
00061         if (static_cast<Window*>(receiver)->getMetricsMode() == Absolute)
00062         {
00063                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00064 
00065                 msz.d_width      *= dsz.d_width;
00066                 msz.d_height *= dsz.d_height;
00067         }
00068 
00069         static_cast<Window*>(receiver)->setMinimumSize(msz);
00070 }
00071 
00072 
00073 String RelativeMaxSize::get(const PropertyReceiver* receiver) const
00074 {
00075         CEGUI::Size msz(static_cast<const Window*>(receiver)->getMaximumSize());
00076 
00077         if (static_cast<const Window*>(receiver)->getMetricsMode() == Absolute)
00078         {
00079                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00080 
00081                 msz.d_width      /= dsz.d_width;
00082                 msz.d_height /= dsz.d_height;
00083         }
00084 
00085         return PropertyHelper::sizeToString(msz);
00086 }
00087 
00088 
00089 void RelativeMaxSize::set(PropertyReceiver* receiver, const String& value)
00090 {
00091         CEGUI::Size msz(PropertyHelper::stringToSize(value));
00092 
00093         if (static_cast<Window*>(receiver)->getMetricsMode() == Absolute)
00094         {
00095                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00096 
00097                 msz.d_width      *= dsz.d_width;
00098                 msz.d_height *= dsz.d_height;
00099         }
00100 
00101         static_cast<Window*>(receiver)->setMaximumSize(msz);
00102 }
00103 
00104 
00105 String AbsoluteMinSize::get(const PropertyReceiver* receiver) const
00106 {
00107         CEGUI::Size msz(static_cast<const Window*>(receiver)->getMinimumSize());
00108 
00109         if (static_cast<const Window*>(receiver)->getMetricsMode() == Relative)
00110         {
00111                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00112 
00113                 msz.d_width      *= dsz.d_width;
00114                 msz.d_height *= dsz.d_height;
00115         }
00116 
00117         return PropertyHelper::sizeToString(msz);
00118 }
00119 
00120 
00121 void AbsoluteMinSize::set(PropertyReceiver* receiver, const String& value)
00122 {
00123         CEGUI::Size msz(PropertyHelper::stringToSize(value));
00124 
00125         if (static_cast<Window*>(receiver)->getMetricsMode() == Relative)
00126         {
00127                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00128 
00129                 msz.d_width      /= dsz.d_width;
00130                 msz.d_height /= dsz.d_height;
00131         }
00132 
00133         static_cast<Window*>(receiver)->setMinimumSize(msz);
00134 }
00135 
00136 
00137 String AbsoluteMaxSize::get(const PropertyReceiver* receiver) const
00138 {
00139         CEGUI::Size msz(static_cast<const Window*>(receiver)->getMaximumSize());
00140 
00141         if (static_cast<const Window*>(receiver)->getMetricsMode() == Relative)
00142         {
00143                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00144 
00145                 msz.d_width      *= dsz.d_width;
00146                 msz.d_height *= dsz.d_height;
00147         }
00148 
00149         return PropertyHelper::sizeToString(msz);
00150 }
00151 
00152 
00153 void AbsoluteMaxSize::set(PropertyReceiver* receiver, const String& value)
00154 {
00155         CEGUI::Size msz(PropertyHelper::stringToSize(value));
00156 
00157         if (static_cast<Window*>(receiver)->getMetricsMode() == Relative)
00158         {
00159                 CEGUI::Size dsz(System::getSingleton().getRenderer()->getSize());
00160 
00161                 msz.d_width      /= dsz.d_width;
00162                 msz.d_height /= dsz.d_height;
00163         }
00164 
00165         static_cast<Window*>(receiver)->setMaximumSize(msz);
00166 }
00167 
00168 bool AbsoluteMaxSize::isDefault(const PropertyReceiver* receiver) const
00169 {
00170         return get(receiver) == getDefault(receiver);
00171 }
00172 
00173 String  AbsoluteMaxSize::getDefault(const PropertyReceiver* receiver) const
00174 {
00175         return PropertyHelper::sizeToString(System::getSingleton().getRenderer()->getSize());
00176 }
00177 
00178 String MetricsMode::get(const PropertyReceiver* receiver) const
00179 {
00180         return PropertyHelper::metricsModeToString(static_cast<const Window*>(receiver)->getMetricsMode());
00181 }
00182 
00183 
00184 void MetricsMode::set(PropertyReceiver* receiver, const String& value)
00185 {
00186         static_cast<Window*>(receiver)->setMetricsMode(PropertyHelper::stringToMetricsMode(value));
00187 }
00188 
00189 
00190 String ID::get(const PropertyReceiver* receiver) const
00191 {
00192         return PropertyHelper::uintToString(static_cast<const Window*>(receiver)->getID());
00193 }
00194 
00195 
00196 void ID::set(PropertyReceiver* receiver, const String& value)
00197 {
00198         static_cast<Window*>(receiver)->setID(PropertyHelper::stringToUint(value));
00199 }
00200 
00201 
00202 String Alpha::get(const PropertyReceiver* receiver) const
00203 {
00204         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAlpha());
00205 }
00206 
00207 
00208 void Alpha::set(PropertyReceiver* receiver, const String& value)
00209 {
00210         static_cast<Window*>(receiver)->setAlpha(PropertyHelper::stringToFloat(value));
00211 }
00212 
00213 
00214 String Font::get(const PropertyReceiver* receiver) const
00215 {
00216         const CEGUI::Font* fnt = static_cast<const Window*>(receiver)->getFont();
00217 
00218         if (fnt != NULL)
00219         {
00220                 return fnt->getName();
00221         }
00222         else
00223         {
00224                 return String();
00225         }
00226 
00227 }
00228 
00229 
00230 void Font::set(PropertyReceiver* receiver, const String& value)
00231 {
00232         try
00233         {
00234                 if (value.empty())
00235                 {
00236                         static_cast<Window*>(receiver)->setFont(System::getSingleton().getDefaultFont());
00237                 }
00238                 else
00239                 {
00240                         static_cast<Window*>(receiver)->setFont(value);
00241                 }
00242         }
00243         catch (UnknownObjectException)
00244         { }
00245 }
00246 
00247 bool Font::isDefault(const PropertyReceiver* receiver) const
00248 {
00249     return static_cast<const Window*>(receiver)->getFont(false) == 0;
00250 }
00251 
00252 
00253 String Text::get(const PropertyReceiver* receiver) const
00254 {
00255         return static_cast<const Window*>(receiver)->getText();
00256 }
00257 
00258 
00259 void Text::set(PropertyReceiver* receiver, const String& value)
00260 {
00261         static_cast<Window*>(receiver)->setText(value);
00262 }
00263 
00264 
00265 String MouseCursorImage::get(const PropertyReceiver* receiver) const
00266 {
00267         const Image* img = static_cast<const Window*>(receiver)->getMouseCursor();
00268 
00269         if (img != NULL)
00270         {
00271                 return PropertyHelper::imageToString(img);
00272         }
00273         else
00274         {
00275                 return String();
00276         }
00277 
00278 }
00279 
00280 void MouseCursorImage::set(PropertyReceiver* receiver, const String& value)
00281 {
00282         if (!value.empty())
00283         {
00284                 static_cast<Window*>(receiver)->setMouseCursor(PropertyHelper::stringToImage(value));
00285         }
00286 }
00287 
00288 bool MouseCursorImage::isDefault(const PropertyReceiver* receiver) const
00289 {
00290     return static_cast<const Window*>(receiver)->getMouseCursor(false) == 0;
00291 }
00292 
00293 
00294 String ClippedByParent::get(const PropertyReceiver* receiver) const
00295 {
00296         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isClippedByParent());
00297 }
00298 
00299 
00300 void ClippedByParent::set(PropertyReceiver* receiver, const String& value)
00301 {
00302         static_cast<Window*>(receiver)->setClippedByParent(PropertyHelper::stringToBool(value));
00303 }
00304 
00305 
00306 String InheritsAlpha::get(const PropertyReceiver* receiver) const
00307 {
00308         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->inheritsAlpha());
00309 }
00310 
00311 
00312 void InheritsAlpha::set(PropertyReceiver* receiver, const String& value)
00313 {
00314         static_cast<Window*>(receiver)->setInheritsAlpha(PropertyHelper::stringToBool(value));
00315 }
00316 
00317 
00318 String AlwaysOnTop::get(const PropertyReceiver* receiver) const
00319 {
00320         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isAlwaysOnTop());
00321 }
00322 
00323 
00324 void AlwaysOnTop::set(PropertyReceiver* receiver, const String& value)
00325 {
00326         static_cast<Window*>(receiver)->setAlwaysOnTop(PropertyHelper::stringToBool(value));
00327 }
00328 
00329 
00330 String Disabled::get(const PropertyReceiver* receiver) const
00331 {
00332         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isDisabled());
00333 }
00334 
00335 
00336 void Disabled::set(PropertyReceiver* receiver, const String& value)
00337 {
00338         static_cast<Window*>(receiver)->setEnabled(!PropertyHelper::stringToBool(value));
00339 }
00340 
00341 bool Disabled::isDefault(const PropertyReceiver* receiver) const
00342 {
00343     return !static_cast<const Window*>(receiver)->isDisabled(true);
00344 }
00345 
00346 
00347 String Visible::get(const PropertyReceiver* receiver) const
00348 {
00349         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isVisible());
00350 }
00351 
00352 
00353 void Visible::set(PropertyReceiver* receiver, const String& value)
00354 {
00355         static_cast<Window*>(receiver)->setVisible(PropertyHelper::stringToBool(value));
00356 }
00357 
00358 bool Visible::isDefault(const PropertyReceiver* receiver) const
00359 {
00360     return static_cast<const Window*>(receiver)->isVisible(true);
00361 }
00362 
00363 
00364 String RestoreOldCapture::get(const PropertyReceiver* receiver) const
00365 {
00366         return  PropertyHelper::boolToString(static_cast<const Window*>(receiver)->restoresOldCapture());
00367 }
00368 
00369 
00370 void RestoreOldCapture::set(PropertyReceiver* receiver, const String& value)
00371 {
00372         static_cast<Window*>(receiver)->setRestoreCapture(PropertyHelper::stringToBool(value));
00373 }
00374 
00375 
00376 String DestroyedByParent::get(const PropertyReceiver* receiver) const
00377 {
00378         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isDestroyedByParent());
00379 }
00380 
00381 
00382 void DestroyedByParent::set(PropertyReceiver* receiver, const String& value)
00383 {
00384         static_cast<Window*>(receiver)->setDestroyedByParent(PropertyHelper::stringToBool(value));
00385 }
00386 
00387 
00388 String Width::get(const PropertyReceiver* receiver) const
00389 {
00390         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getWidth());
00391 }
00392 
00393 
00394 void Width::set(PropertyReceiver* receiver, const String& value)
00395 {
00396         static_cast<Window*>(receiver)->setWidth(PropertyHelper::stringToFloat(value));
00397 }
00398 
00399 
00400 String RelativeWidth::get(const PropertyReceiver* receiver) const
00401 {
00402         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getRelativeWidth());
00403 }
00404 
00405 
00406 void RelativeWidth::set(PropertyReceiver* receiver, const String& value)
00407 {
00408         static_cast<Window*>(receiver)->setWidth(Relative, PropertyHelper::stringToFloat(value));
00409 }
00410 
00411 
00412 String AbsoluteWidth::get(const PropertyReceiver* receiver) const
00413 {
00414         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAbsoluteWidth());
00415 }
00416 
00417 
00418 void AbsoluteWidth::set(PropertyReceiver* receiver, const String& value)
00419 {
00420         static_cast<Window*>(receiver)->setWidth(Absolute, PropertyHelper::stringToFloat(value));
00421 }
00422 
00423 
00424 String Height::get(const PropertyReceiver* receiver) const
00425 {
00426         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getHeight());
00427 }
00428 
00429 
00430 void Height::set(PropertyReceiver* receiver, const String& value)
00431 {
00432         static_cast<Window*>(receiver)->setHeight(PropertyHelper::stringToFloat(value));
00433 }
00434 
00435 
00436 String RelativeHeight::get(const PropertyReceiver* receiver) const
00437 {
00438         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getRelativeHeight());
00439 }
00440 
00441 
00442 void RelativeHeight::set(PropertyReceiver* receiver, const String& value)
00443 {
00444         static_cast<Window*>(receiver)->setHeight(Relative, PropertyHelper::stringToFloat(value));
00445 }
00446 
00447 
00448 String AbsoluteHeight::get(const PropertyReceiver* receiver) const
00449 {
00450         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAbsoluteHeight());
00451 }
00452 
00453 
00454 void AbsoluteHeight::set(PropertyReceiver* receiver, const String& value)
00455 {
00456         static_cast<Window*>(receiver)->setHeight(Absolute, PropertyHelper::stringToFloat(value));
00457 }
00458 
00459 
00460 String Size::get(const PropertyReceiver* receiver) const
00461 {
00462         return PropertyHelper::sizeToString(static_cast<const Window*>(receiver)->getSize());
00463 }
00464 
00465 
00466 void Size::set(PropertyReceiver* receiver, const String& value)
00467 {
00468         static_cast<Window*>(receiver)->setSize(PropertyHelper::stringToSize(value));
00469 }
00470 
00471 
00472 String RelativeSize::get(const PropertyReceiver* receiver) const
00473 {
00474         return PropertyHelper::sizeToString(static_cast<const Window*>(receiver)->getRelativeSize());
00475 }
00476 
00477 
00478 void RelativeSize::set(PropertyReceiver* receiver, const String& value)
00479 {
00480         static_cast<Window*>(receiver)->setSize(Relative, PropertyHelper::stringToSize(value));
00481 }
00482 
00483 
00484 String AbsoluteSize::get(const PropertyReceiver* receiver) const
00485 {
00486         return PropertyHelper::sizeToString(static_cast<const Window*>(receiver)->getAbsoluteSize());
00487 }
00488 
00489 
00490 void AbsoluteSize::set(PropertyReceiver* receiver, const String& value)
00491 {
00492         static_cast<Window*>(receiver)->setSize(Absolute, PropertyHelper::stringToSize(value));
00493 }
00494 
00495 
00496 String XPosition::get(const PropertyReceiver* receiver) const
00497 {
00498         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getXPosition());
00499 }
00500 
00501 
00502 void XPosition::set(PropertyReceiver* receiver, const String& value)
00503 {
00504         static_cast<Window*>(receiver)->setXPosition(PropertyHelper::stringToFloat(value));
00505 }
00506 
00507 
00508 String RelativeXPosition::get(const PropertyReceiver* receiver) const
00509 {
00510         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getRelativeXPosition());
00511 }
00512 
00513 
00514 void RelativeXPosition::set(PropertyReceiver* receiver, const String& value)
00515 {
00516         static_cast<Window*>(receiver)->setXPosition(Relative, PropertyHelper::stringToFloat(value));
00517 }
00518 
00519 
00520 String AbsoluteXPosition::get(const PropertyReceiver* receiver) const
00521 {
00522         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAbsoluteXPosition());
00523 }
00524 
00525 
00526 void AbsoluteXPosition::set(PropertyReceiver* receiver, const String& value)
00527 {
00528         static_cast<Window*>(receiver)->setXPosition(Absolute, PropertyHelper::stringToFloat(value));
00529 }
00530 
00531 
00532 String YPosition::get(const PropertyReceiver* receiver) const
00533 {
00534         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getYPosition());
00535 }
00536 
00537 
00538 void YPosition::set(PropertyReceiver* receiver, const String& value)
00539 {
00540         static_cast<Window*>(receiver)->setYPosition(PropertyHelper::stringToFloat(value));
00541 }
00542 
00543 
00544 String RelativeYPosition::get(const PropertyReceiver* receiver) const
00545 {
00546         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getRelativeYPosition());
00547 }
00548 
00549 
00550 void RelativeYPosition::set(PropertyReceiver* receiver, const String& value)
00551 {
00552         static_cast<Window*>(receiver)->setYPosition(Relative, PropertyHelper::stringToFloat(value));
00553 }
00554 
00555 
00556 String AbsoluteYPosition::get(const PropertyReceiver* receiver) const
00557 {
00558         return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAbsoluteYPosition());
00559 }
00560 
00561 
00562 void AbsoluteYPosition::set(PropertyReceiver* receiver, const String& value)
00563 {
00564         static_cast<Window*>(receiver)->setYPosition(Absolute, PropertyHelper::stringToFloat(value));
00565 }
00566 
00567 
00568 String Position::get(const PropertyReceiver* receiver) const
00569 {
00570         return PropertyHelper::pointToString(static_cast<const Window*>(receiver)->getPosition());
00571 }
00572 
00573 
00574 void Position::set(PropertyReceiver* receiver, const String& value)
00575 {
00576         static_cast<Window*>(receiver)->setPosition(PropertyHelper::stringToPoint(value));
00577 }
00578 
00579 
00580 String RelativePosition::get(const PropertyReceiver* receiver) const
00581 {
00582         return PropertyHelper::pointToString(static_cast<const Window*>(receiver)->getRelativePosition());
00583 }
00584 
00585 
00586 void RelativePosition::set(PropertyReceiver* receiver, const String& value)
00587 {
00588         static_cast<Window*>(receiver)->setPosition(Relative, PropertyHelper::stringToPoint(value));
00589 }
00590 
00591 
00592 String AbsolutePosition::get(const PropertyReceiver* receiver) const
00593 {
00594         return PropertyHelper::pointToString(static_cast<const Window*>(receiver)->getAbsolutePosition());
00595 }
00596 
00597 
00598 void AbsolutePosition::set(PropertyReceiver* receiver, const String& value)
00599 {
00600         static_cast<Window*>(receiver)->setPosition(Absolute, PropertyHelper::stringToPoint(value));
00601 }
00602 
00603 
00604 String Rect::get(const PropertyReceiver* receiver) const
00605 {
00606         return PropertyHelper::rectToString(static_cast<const Window*>(receiver)->getRect());
00607 }
00608 
00609 
00610 void Rect::set(PropertyReceiver* receiver, const String& value)
00611 {
00612         static_cast<Window*>(receiver)->setAreaRect(PropertyHelper::stringToRect(value));
00613 }
00614 
00615 
00616 String RelativeRect::get(const PropertyReceiver* receiver) const
00617 {
00618         return PropertyHelper::rectToString(static_cast<const Window*>(receiver)->getRelativeRect());
00619 }
00620 
00621 
00622 void RelativeRect::set(PropertyReceiver* receiver, const String& value)
00623 {
00624         static_cast<Window*>(receiver)->setRect(Relative, PropertyHelper::stringToRect(value));
00625 }
00626 
00627 
00628 String AbsoluteRect::get(const PropertyReceiver* receiver) const
00629 {
00630         return PropertyHelper::rectToString(static_cast<const Window*>(receiver)->getAbsoluteRect());
00631 }
00632 
00633 
00634 void AbsoluteRect::set(PropertyReceiver* receiver, const String& value)
00635 {
00636         static_cast<Window*>(receiver)->setRect(Absolute, PropertyHelper::stringToRect(value));
00637 }
00638 
00639 
00640 String ZOrderChangeEnabled::get(const PropertyReceiver* receiver) const
00641 {
00642         return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isZOrderingEnabled());
00643 }
00644 
00645 
00646 void ZOrderChangeEnabled::set(PropertyReceiver* receiver, const String& value)
00647 {
00648         static_cast<Window*>(receiver)->setZOrderingEnabled(PropertyHelper::stringToBool(value));
00649 }
00650 
00651 
00652 String WantsMultiClickEvents::get(const PropertyReceiver* receiver) const
00653 {
00654     return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->wantsMultiClickEvents());
00655 }
00656 
00657 
00658 void WantsMultiClickEvents::set(PropertyReceiver* receiver, const String& value)
00659 {
00660     static_cast<Window*>(receiver)->setWantsMultiClickEvents(PropertyHelper::stringToBool(value));
00661 }
00662 
00663 
00664 String MouseButtonDownAutoRepeat::get(const PropertyReceiver* receiver) const
00665 {
00666     return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isMouseAutoRepeatEnabled());
00667 }
00668 
00669 
00670 void MouseButtonDownAutoRepeat::set(PropertyReceiver* receiver, const String& value)
00671 {
00672     static_cast<Window*>(receiver)->setMouseAutoRepeatEnabled(PropertyHelper::stringToBool(value));
00673 }
00674 
00675 
00676 String AutoRepeatDelay::get(const PropertyReceiver* receiver) const
00677 {
00678     return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAutoRepeatDelay());
00679 }
00680 
00681 
00682 void AutoRepeatDelay::set(PropertyReceiver* receiver, const String& value)
00683 {
00684     static_cast<Window*>(receiver)->setAutoRepeatDelay(PropertyHelper::stringToFloat(value));
00685 }
00686 
00687 
00688 String AutoRepeatRate::get(const PropertyReceiver* receiver) const
00689 {
00690     return PropertyHelper::floatToString(static_cast<const Window*>(receiver)->getAutoRepeatRate());
00691 }
00692 
00693 
00694 void AutoRepeatRate::set(PropertyReceiver* receiver, const String& value)
00695 {
00696     static_cast<Window*>(receiver)->setAutoRepeatRate(PropertyHelper::stringToFloat(value));
00697 }
00698 
00699 
00700 String DistributeCapturedInputs::get(const PropertyReceiver* receiver) const
00701 {
00702     return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->distributesCapturedInputs());
00703 }
00704 
00705 
00706 void DistributeCapturedInputs::set(PropertyReceiver* receiver, const String& value)
00707 {
00708     static_cast<Window*>(receiver)->setDistributesCapturedInputs(PropertyHelper::stringToBool(value));
00709 }
00710 
00711 
00712 String CustomTooltipType::get(const PropertyReceiver* receiver) const
00713 {
00714     return static_cast<const Window*>(receiver)->getTooltipType();
00715 }
00716 
00717 
00718 void CustomTooltipType::set(PropertyReceiver* receiver, const String& value)
00719 {
00720     static_cast<Window*>(receiver)->setTooltipType(value);
00721 }
00722 
00723 String Tooltip::get(const PropertyReceiver* receiver) const
00724 {
00725     const Window* wnd = static_cast<const Window*>(receiver);
00726 
00727     if (!wnd->getParent() || !wnd->inheritsTooltipText() || (wnd->getTooltipText() != wnd->getParent()->getTooltipText()))
00728     {
00729         return wnd->getTooltipText();
00730     }
00731     else
00732     {
00733         return String("");
00734     }
00735 }
00736 
00737 
00738 void Tooltip::set(PropertyReceiver* receiver, const String& value)
00739 {
00740     static_cast<Window*>(receiver)->setTooltipText(value);
00741 }
00742 
00743 
00744 String InheritsTooltipText::get(const PropertyReceiver* receiver) const
00745 {
00746     return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->inheritsTooltipText());
00747 }
00748 
00749 
00750 void InheritsTooltipText::set(PropertyReceiver* receiver, const String& value)
00751 {
00752     static_cast<Window*>(receiver)->setInheritsTooltipText(PropertyHelper::stringToBool(value));
00753 }
00754 
00755 
00756 String RiseOnClick::get(const PropertyReceiver* receiver) const
00757 {
00758     return PropertyHelper::boolToString(static_cast<const Window*>(receiver)->isRiseOnClickEnabled());
00759 }
00760 
00761 
00762 void RiseOnClick::set(PropertyReceiver* receiver, const String& value)
00763 {
00764     static_cast<Window*>(receiver)->setRiseOnClickEnabled(PropertyHelper::stringToBool(value));
00765 }
00766 
00767 
00768 String VerticalAlignment::get(const PropertyReceiver* receiver) const
00769 {
00770     switch(static_cast<const Window*>(receiver)->getVerticalAlignment())
00771     {
00772         case VA_CENTRE:
00773             return String("Centre");
00774             break;
00775 
00776         case VA_BOTTOM:
00777             return String("Bottom");
00778             break;
00779 
00780         default:
00781             return String("Top");
00782     }
00783 }
00784 
00785 void VerticalAlignment::set(PropertyReceiver* receiver, const String& value)
00786 {
00787     CEGUI::VerticalAlignment align;
00788 
00789     if (value == "Centre")
00790     {
00791         align = VA_CENTRE;
00792     }
00793     else if (value == "Bottom")
00794     {
00795         align = VA_BOTTOM;
00796     }
00797     else
00798     {
00799         align = VA_TOP;
00800     }
00801     
00802     static_cast<Window*>(receiver)->setVerticalAlignment(align);
00803 }
00804 
00805 
00806 String HorizontalAlignment::get(const PropertyReceiver* receiver) const
00807 {
00808     switch(static_cast<const Window*>(receiver)->getHorizontalAlignment())
00809     {
00810         case HA_CENTRE:
00811             return String("Centre");
00812             break;
00813 
00814         case HA_RIGHT:
00815             return String("Right");
00816             break;
00817 
00818         default:
00819             return String("Left");
00820     }
00821 }
00822 
00823 void HorizontalAlignment::set(PropertyReceiver* receiver, const String& value)
00824 {
00825     CEGUI::HorizontalAlignment align;
00826 
00827     if (value == "Centre")
00828     {
00829         align = HA_CENTRE;
00830     }
00831     else if (value == "Right")
00832     {
00833         align = HA_RIGHT;
00834     }
00835     else
00836     {
00837         align = HA_LEFT;
00838     }
00839     
00840     static_cast<Window*>(receiver)->setHorizontalAlignment(align);
00841 }
00842 
00843 
00844 String UnifiedAreaRect::get(const PropertyReceiver* receiver) const
00845 {
00846     return PropertyHelper::urectToString(static_cast<const Window*>(receiver)->getWindowArea());
00847 }
00848 
00849 void UnifiedAreaRect::set(PropertyReceiver* receiver, const String& value)
00850 {
00851     static_cast<Window*>(receiver)->setWindowArea(PropertyHelper::stringToURect(value));
00852 }
00853 
00854 
00855 String UnifiedPosition::get(const PropertyReceiver* receiver) const
00856 {
00857     return PropertyHelper::uvector2ToString(static_cast<const Window*>(receiver)->getWindowPosition());
00858 }
00859 
00860 void UnifiedPosition::set(PropertyReceiver* receiver, const String& value)
00861 {
00862     static_cast<Window*>(receiver)->setWindowPosition(PropertyHelper::stringToUVector2(value));
00863 }
00864 
00865 
00866 String UnifiedXPosition::get(const PropertyReceiver* receiver) const
00867 {
00868     return PropertyHelper::udimToString(static_cast<const Window*>(receiver)->getWindowXPosition());
00869 }
00870 
00871 void UnifiedXPosition::set(PropertyReceiver* receiver, const String& value)
00872 {
00873     static_cast<Window*>(receiver)->setWindowXPosition(PropertyHelper::stringToUDim(value));
00874 }
00875 
00876 
00877 String UnifiedYPosition::get(const PropertyReceiver* receiver) const
00878 {
00879     return PropertyHelper::udimToString(static_cast<const Window*>(receiver)->getWindowYPosition());
00880 }
00881 
00882 void UnifiedYPosition::set(PropertyReceiver* receiver, const String& value)
00883 {
00884     static_cast<Window*>(receiver)->setWindowYPosition(PropertyHelper::stringToUDim(value));
00885 }
00886 
00887 
00888 String UnifiedSize::get(const PropertyReceiver* receiver) const
00889 {
00890     return PropertyHelper::uvector2ToString(static_cast<const Window*>(receiver)->getWindowSize());
00891 }
00892 
00893 void UnifiedSize::set(PropertyReceiver* receiver, const String& value)
00894 {
00895     static_cast<Window*>(receiver)->setWindowSize(PropertyHelper::stringToUVector2(value));
00896 }
00897 
00898 
00899 String UnifiedWidth::get(const PropertyReceiver* receiver) const
00900 {
00901     return PropertyHelper::udimToString(static_cast<const Window*>(receiver)->getWindowWidth());
00902 }
00903 
00904 void UnifiedWidth::set(PropertyReceiver* receiver, const String& value)
00905 {
00906     static_cast<Window*>(receiver)->setWindowWidth(PropertyHelper::stringToUDim(value));
00907 }
00908 
00909 
00910 String UnifiedHeight::get(const PropertyReceiver* receiver) const
00911 {
00912     return PropertyHelper::udimToString(static_cast<const Window*>(receiver)->getWindowHeight());
00913 }
00914 
00915 void UnifiedHeight::set(PropertyReceiver* receiver, const String& value)
00916 {
00917     static_cast<Window*>(receiver)->setWindowHeight(PropertyHelper::stringToUDim(value));
00918 }
00919 
00920 
00921 String UnifiedMinSize::get(const PropertyReceiver* receiver) const
00922 {
00923     return PropertyHelper::uvector2ToString(static_cast<const Window*>(receiver)->getWindowMinSize());
00924 }
00925 
00926 void UnifiedMinSize::set(PropertyReceiver* receiver, const String& value)
00927 {
00928     static_cast<Window*>(receiver)->setWindowMinSize(PropertyHelper::stringToUVector2(value));
00929 }
00930 
00931 
00932 String UnifiedMaxSize::get(const PropertyReceiver* receiver) const
00933 {
00934     return PropertyHelper::uvector2ToString(static_cast<const Window*>(receiver)->getWindowMaxSize());
00935 }
00936 
00937 void UnifiedMaxSize::set(PropertyReceiver* receiver, const String& value)
00938 {
00939     static_cast<Window*>(receiver)->setWindowMaxSize(PropertyHelper::stringToUVector2(value));
00940 }
00941 
00942 
00943 } // End of  WindowProperties namespace section
00944 
00945 } // End of  CEGUI namespace section

Generated on Wed Sep 7 09:56:35 2005 for Crazy Eddies GUI System by  doxygen 1.4.3