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

CEGUIWindow.h

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIWindow.h
00003         created:        21/2/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Defines abstract base class for Window objects
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 #ifndef _CEGUIWindow_h_
00027 #define _CEGUIWindow_h_
00028 
00029 #include "CEGUIBase.h"
00030 #include "CEGUIString.h"
00031 #include "CEGUIVector.h"
00032 #include "CEGUIRect.h"
00033 #include "CEGUISize.h"
00034 #include "CEGUIEventSet.h"
00035 #include "CEGUIPropertySet.h"
00036 #include "CEGUISystem.h"
00037 #include "CEGUIInputEvent.h"
00038 #include "CEGUIWindowProperties.h"
00039 #include "CEGUIUDim.h"
00040 #include "CEGUIRenderCache.h"
00041 #include <vector>
00042 
00043 
00044 #if defined(_MSC_VER)
00045 #       pragma warning(push)
00046 #       pragma warning(disable : 4251)
00047 #endif
00048 
00049 
00050 // Start of CEGUI namespace section
00051 namespace CEGUI
00052 {
00053 
00062 enum MetricsMode
00063 {
00064         Relative,               
00065         Absolute,               
00066         Inherited               
00067 };
00068 
00073 enum VerticalAlignment
00074 {
00075     VA_TOP,        
00076     VA_CENTRE,     
00077     VA_BOTTOM      
00078 };
00079 
00084 enum HorizontalAlignment
00085 {
00086     HA_LEFT,        
00087     HA_CENTRE,      
00088     HA_RIGHT        
00089 };
00090 
00100 class CEGUIEXPORT Window : public PropertySet, public EventSet
00101 {
00102 public:
00103         static const String EventNamespace;                             
00104 
00105         /*************************************************************************
00106                 Event name constants
00107         *************************************************************************/
00108         // generated internally by Window
00109         static const String EventParentSized;                           
00110         static const String EventSized;                                 
00111         static const String EventMoved;                                 
00112         static const String EventTextChanged;                           
00113         static const String EventFontChanged;                           
00114         static const String EventAlphaChanged;                  
00115         static const String EventIDChanged;                             
00116         static const String EventActivated;                             
00117         static const String EventDeactivated;                           
00118         static const String EventShown;                                 
00119         static const String EventHidden;                                        
00120         static const String EventEnabled;                                       
00121         static const String EventDisabled;                              
00122         static const String EventMetricsModeChanged;            
00123         static const String EventClippedByParentChanged;        
00124         static const String EventDestroyedByParentChanged;
00125         static const String EventInheritsAlphaChanged;  
00126         static const String EventAlwaysOnTopChanged;            
00127         static const String EventInputCaptureGained;            
00128         static const String EventInputCaptureLost;              
00129         static const String EventRenderingStarted;              
00130         static const String EventRenderingEnded;                        
00131         static const String EventChildAdded;                            
00132         static const String EventChildRemoved;                  
00133         static const String EventDestructionStarted;            
00134         static const String EventZOrderChanged;                 
00135         static const String EventDragDropItemEnters;    
00136         static const String EventDragDropItemLeaves;    
00137         static const String EventDragDropItemDropped;   
00138     static const String EventVerticalAlignmentChanged;    
00139     static const String EventHorizontalAlignmentChanged;  
00140 
00141         // generated externally (inputs)
00142         static const String EventMouseEnters;                           
00143         static const String EventMouseLeaves;                           
00144         static const String EventMouseMove;                             
00145         static const String EventMouseWheel;                            
00146         static const String EventMouseButtonDown;                       
00147         static const String EventMouseButtonUp;                 
00148         static const String EventMouseClick;                            
00149         static const String EventMouseDoubleClick;              
00150         static const String EventMouseTripleClick;              
00151         static const String EventKeyDown;                                       
00152         static const String EventKeyUp;                                 
00153         static const String EventCharacterKey;                  
00154 
00155 
00156         /*************************************************************************
00157                 Construction and Destruction
00158         *************************************************************************/
00169         Window(const String& type, const String& name);
00170 
00171 
00176         virtual ~Window(void);
00177 
00178 
00179         /*************************************************************************
00180                 Accessor functions
00181         *************************************************************************/
00189         const String& getType(void) const;
00190 
00191 
00199         const String& getName(void) const               {return d_name;}
00200 
00201 
00209         bool    isDestroyedByParent(void) const         {return d_destroyedByParent;}
00210 
00211 
00219         bool    isAlwaysOnTop(void) const                       {return d_alwaysOnTop;}
00220 
00221 
00233         bool    isDisabled(bool localOnly = false) const;
00234 
00235 
00250         bool    isVisible(bool localOnly = false) const;
00251 
00252 
00263         bool    isActive(void) const;
00264 
00265 
00273         bool    isClippedByParent(void) const           {return d_clippedByParent;}
00274 
00275 
00283         uint    getID(void) const               {return d_ID;}
00284 
00285 
00293         uint   getChildCount(void) const      {return (uint)d_children.size();}
00294 
00295 
00306         bool    isChild(const String& name) const;
00307 
00308 
00323         bool    isChild(uint ID) const;
00324 
00325 
00336         bool    isChild(const Window* window) const;
00337 
00338 
00356         Window* getChild(const String& name) const;
00357 
00358 
00376         Window* getChild(uint ID) const;
00377 
00378 
00390         Window* getChildAtIdx(uint idx) const           {return d_children[idx];}
00391 
00392 
00402         Window* getActiveChild(void);
00403         const Window* getActiveChild(void) const;
00404 
00405 
00416         bool    isAncestor(const String& name) const;
00417 
00418 
00429         bool    isAncestor(uint ID) const;
00430 
00431 
00442         bool    isAncestor(const Window* window) const;
00443 
00444 
00455         const Font*             getFont(bool useDefault = true) const;
00456 
00457 
00465         const String&   getText(void) const             {return d_text;}
00466 
00467 
00475         bool    inheritsAlpha(void) const               {return d_inheritsAlpha;}
00476 
00477 
00491         float   getAlpha(void) const                    {return d_alpha;}
00492 
00493 
00502         float   getEffectiveAlpha(void) const;
00503 
00504 
00513         Rect    getRect(void) const;
00514 
00515 
00527         virtual Rect    getPixelRect(void) const;
00528 
00529 
00537         Rect    getInnerRect(void) const;
00538 
00539 
00548         Rect    getUnclippedPixelRect(void) const;
00549 
00550 
00559         virtual Rect    getUnclippedInnerRect(void) const;
00560 
00561 
00569         static  Window* getCaptureWindow(void)          {return d_captureWindow;}
00570 
00571 
00579         bool    isCapturedByThis(void) const            {return getCaptureWindow() == this;}
00580 
00581 
00589         bool    isCapturedByAncestor(void) const        {return isAncestor(getCaptureWindow());}
00590 
00591 
00599         bool    isCapturedByChild(void) const           {return isChild(getCaptureWindow());}
00600 
00601 
00612         virtual bool    isHit(const Point& position) const;
00613 
00614 
00625         Window* getChildAtPosition(const Point& position) const;
00626 
00627 
00635         MetricsMode     getMetricsMode(void) const;
00636 
00637 
00646         float   getXPosition(void) const;
00647 
00648 
00657         float   getYPosition(void) const;
00658 
00659 
00668         Point   getPosition(void) const;
00669 
00670 
00679         float   getWidth(void) const;
00680 
00689         float   getHeight(void) const;
00690 
00691 
00700         Size    getSize(void) const;
00701 
00702 
00711         Window* getParent(void) const                           {return d_parent;}
00712 
00713 
00722         Size    getMaximumSize(void) const;
00723 
00724 
00733         Size    getMinimumSize(void) const;
00734 
00735 
00746         const Image*    getMouseCursor(bool useDefault = true) const;
00747 
00748 
00756     Rect        getRelativeRect(void) const                             { return d_area.asRelative(getParentSize()); }
00757 
00758 
00766         Point   getRelativePosition(void) const                 { return d_area.getPosition().asRelative(getParentSize()); }
00767 
00768 
00776         float   getRelativeXPosition(void) const                { return d_area.d_min.d_x.asRelative(getParentWidth()); }
00777 
00778 
00786         float   getRelativeYPosition(void) const                { return d_area.d_min.d_y.asRelative(getParentHeight()); }
00787 
00788 
00796     Size        getRelativeSize(void) const                             { return d_area.getSize().asRelative(getParentSize()).asSize(); }
00797 
00798 
00806         float   getRelativeWidth(void) const                    { return d_area.getWidth().asRelative(getParentWidth()); }
00807 
00808 
00816         float   getRelativeHeight(void) const                   { return d_area.getHeight().asRelative(getParentHeight()); }
00817 
00818 
00826     Rect        getAbsoluteRect(void) const                             { return Rect(d_area.getPosition().asAbsolute(getParentSize()), d_pixelSize); }
00827 
00828 
00836         Point   getAbsolutePosition(void) const                 { return d_area.getPosition().asAbsolute(getParentSize()); }
00837 
00838 
00846         float   getAbsoluteXPosition(void) const                { return d_area.d_min.d_x.asAbsolute(getParentWidth()); }
00847 
00848 
00856         float   getAbsoluteYPosition(void) const                { return d_area.d_min.d_y.asAbsolute(getParentHeight()); }
00857 
00858 
00866         Size    getAbsoluteSize(void) const                             { return d_pixelSize; }
00867 
00868 
00876         float   getAbsoluteWidth(void) const                    { return d_pixelSize.d_width; }
00877 
00878 
00886         float   getAbsoluteHeight(void) const                   { return d_pixelSize.d_height; }
00887 
00888 
00899         void*   getUserData(void) const                 {return d_userData;}
00900 
00901 
00912         float   getXPosition(MetricsMode mode) const;
00913 
00914 
00925         float   getYPosition(MetricsMode mode) const;
00926 
00927 
00938         Point   getPosition(MetricsMode mode) const;
00939 
00940 
00951         float   getWidth(MetricsMode mode) const;
00952 
00953 
00964         float   getHeight(MetricsMode mode) const;
00965 
00966 
00977         Size    getSize(MetricsMode mode) const;
00978 
00979 
00990         Rect    getRect(MetricsMode mode) const;
00991 
00992 
01003         bool    restoresOldCapture(void) const          {return d_restoreOldCapture;}
01004 
01005 
01014         bool    isZOrderingEnabled(void) const;
01015 
01016 
01025     bool    wantsMultiClickEvents(void) const;
01026 
01027 
01036     bool    isMouseAutoRepeatEnabled(void) const;
01037 
01038 
01046     float   getAutoRepeatDelay(void) const;
01047 
01048     
01056     float   getAutoRepeatRate(void) const;
01057 
01058 
01068     bool    distributesCapturedInputs(void) const;
01069 
01070 
01079     bool isUsingDefaultTooltip(void) const;
01080 
01089     Tooltip* getTooltip(void) const;
01090 
01098     String getTooltipType(void) const;
01099 
01107     const String& getTooltipText(void) const;
01108 
01117     bool inheritsTooltipText(void) const;
01118 
01127     bool isRiseOnClickEnabled(void) const   { return d_riseOnClick; }
01128 
01139         bool testClassName(const String& class_name) const              {return testClassName_impl(class_name);}
01140 
01151     VerticalAlignment getVerticalAlignment() const  {return d_vertAlign;}
01152 
01163     HorizontalAlignment getHorizontalAlignment() const  {return d_horzAlign;}
01164 
01172     RenderCache& getRenderCache()   { return d_renderCache; }
01173 
01182     const String& getLookNFeel();
01183 
01191         bool getModalState(void) const  {return (System::getSingleton().getModalTarget() == this);}
01192 
01193 
01206     const String& getUserString(const String& name) const;
01207 
01219     bool isUserStringDefined(const String& name) const;
01220 
01235     Window* getActiveSibling();
01236 
01237     /*************************************************************************
01238                 Manipulator functions
01239         *************************************************************************/
01250         virtual void    initialise(void) {}
01251 
01252 
01264         void    setDestroyedByParent(bool setting);
01265 
01266 
01277         void    setAlwaysOnTop(bool setting);
01278 
01279 
01290         void    setEnabled(bool setting);
01291 
01292 
01300         void    enable(void)            {setEnabled(true);}
01301 
01302 
01310         void    disable(void)           {setEnabled(false);}
01311 
01312 
01323         void    setVisible(bool setting);
01324 
01325 
01333         void    show(void)                      {setVisible(true);}
01334 
01335 
01343         void    hide(void)                      {setVisible(false);}
01344 
01345 
01353         void    activate(void);
01354 
01355 
01364         void    deactivate(void);
01365 
01366 
01378         void    setClippedByParent(bool setting);
01379         
01380 
01391         void    setID(uint ID);
01392 
01393 
01404         void    setText(const String& text);
01405 
01406 
01417         void    setWidth(float width);
01418 
01419 
01430         void    setHeight(float height);
01431 
01432 
01443         void    setSize(const Size& size);
01444 
01445 
01456         void    setXPosition(float x);
01457 
01458 
01469         void    setYPosition(float y);
01470 
01471 
01482         void    setPosition(const Point& position);
01483 
01484 
01496         void    setAreaRect(const Rect& area);
01497 
01498         
01509         void    setFont(const Font* font);
01510 
01511 
01524         void    setFont(const String& name);
01525 
01526 
01541         void    addChildWindow(const String& name);
01542 
01543 
01557         void    addChildWindow(Window* window);
01558 
01559 
01570         void    removeChildWindow(const String& name);
01571 
01572 
01583         void    removeChildWindow(Window* window);
01584 
01585 
01597         void    removeChildWindow(uint ID);
01598 
01599 
01611         void    moveToFront();
01612 
01613 
01624         void    moveToBack();
01625 
01626 
01635         bool    captureInput(void);
01636 
01637 
01645         void    releaseInput(void);
01646 
01647 
01663         void    setRestoreCapture(bool setting);
01664 
01665 
01682         void    setAlpha(float alpha);
01683 
01684 
01695         void    setInheritsAlpha(bool setting);
01696 
01697 
01705         void    requestRedraw(void) const;
01706 
01707 
01718         void setMetricsMode(MetricsMode mode);
01719 
01720 
01729         void    setMinimumSize(const Size& sz);
01730 
01731 
01740         void    setMaximumSize(const Size& sz);
01741 
01742 
01753         void    setMouseCursor(const Image* image)              {d_mouseCursor = image;}
01754 
01755 
01766         void    setMouseCursor(MouseCursorImage image)          {d_mouseCursor = (const Image*)image;}
01767 
01768 
01784         void    setMouseCursor(const String& imageset, const String& image_name);
01785 
01786 
01800         void    setUserData(void* user_data)            {d_userData = user_data;}
01801 
01802 
01816         void    setXPosition(MetricsMode mode, float x);
01817 
01818 
01832         void    setYPosition(MetricsMode mode, float y);
01833 
01834 
01848         void    setPosition(MetricsMode mode, const Point& position);
01849 
01850 
01864         void    setWidth(MetricsMode mode, float width);
01865 
01866 
01880         void    setHeight(MetricsMode mode, float height);
01881 
01882 
01896         void    setSize(MetricsMode mode, const Size& size);
01897 
01898 
01912         void    setRect(MetricsMode mode, const Rect& area);
01913 
01914 
01926         void    setZOrderingEnabled(bool setting);
01927 
01928 
01940     void setWantsMultiClickEvents(bool setting);
01941 
01942     
01954     void    setMouseAutoRepeatEnabled(bool setting);
01955 
01956 
01967     void   setAutoRepeatDelay(float delay);
01968 
01969     
01980     void   setAutoRepeatRate(float rate);
01981 
01982 
01992     void    setDistributesCapturedInputs(bool setting);
01993 
01999     void    notifyDragDropItemEnters(DragContainer* item);
02000 
02006     void    notifyDragDropItemLeaves(DragContainer* item);
02007 
02013     void    notifyDragDropItemDropped(DragContainer* item);
02014 
02028     virtual void    destroy(void);
02029 
02043     void setTooltip(Tooltip* tooltip);
02044 
02060     void setTooltipType(const String& tooltipType);
02061 
02072     void setTooltipText(const String& tip);
02073 
02085     void setInheritsTooltipText(bool setting);
02086 
02098     void setRiseOnClickEnabled(bool setting)    { d_riseOnClick = setting; }
02099 
02113     void setVerticalAlignment(const VerticalAlignment alignment);
02114 
02128     void setHorizontalAlignment(const HorizontalAlignment alignment);
02129 
02146     void setLookNFeel(const String& falagardType, const String& look);
02147 
02160         void setModalState(bool state);
02161 
02172     virtual void performChildWindowLayout();
02173 
02187     void setUserString(const String& name, const String& value);
02188 
02189     /*************************************************************************
02190                 Co-ordinate and Size Conversion Functions
02191         *************************************************************************/
02202         float   absoluteToRelativeX(float val) const;
02203 
02204 
02215         float   absoluteToRelativeY(float val) const;
02216 
02217 
02228         Point   absoluteToRelative(const Point& pt) const;
02229 
02230 
02241         Size    absoluteToRelative(const Size& sze) const;
02242 
02243 
02254         Rect    absoluteToRelative(const Rect& rect) const;
02255 
02256 
02267         float   relativeToAbsoluteX(float val) const;
02268 
02269 
02280         float   relativeToAbsoluteY(float val) const;
02281 
02282 
02293         Point   relativeToAbsolute(const Point& pt) const;
02294 
02295 
02306         Size    relativeToAbsolute(const Size& sze) const;
02307 
02308 
02319         Rect    relativeToAbsolute(const Rect& rect) const;
02320 
02321 
02332         float   windowToScreenX(float x) const;
02333 
02334 
02345         float   windowToScreenY(float y) const;
02346         
02347         
02358         Point   windowToScreen(const Point& pt) const;
02359 
02360 
02371         Size    windowToScreen(const Size& sze) const;
02372 
02373 
02384         Rect    windowToScreen(const Rect& rect) const;
02385 
02386 
02397         float   screenToWindowX(float x) const;
02398 
02399 
02410         float   screenToWindowY(float y) const;
02411 
02412 
02423         Point   screenToWindow(const Point& pt) const;
02424 
02425 
02436         Size    screenToWindow(const Size& sze) const;
02437 
02438 
02449         Rect    screenToWindow(const Rect& rect) const;
02450 
02451 
02462     float unifiedToRelativeX(const UDim& val) const;
02463 
02464 
02475     float       unifiedToRelativeY(const UDim& val) const;
02476 
02477 
02488     Vector2 unifiedToRelative(const UVector2& val) const;
02489 
02490 
02501     Rect unifiedToRelative(const URect& val) const;
02502 
02503 
02514     float unifiedToAbsoluteX(const UDim& val) const;
02515 
02516 
02527     float       unifiedToAbsoluteY(const UDim& val) const;
02528 
02529 
02540     Vector2 unifiedToAbsolute(const UVector2& val) const;
02541 
02542 
02553     Rect unifiedToAbsolute(const URect& val) const;
02554 
02555 
02566     float windowToScreenX(const UDim& x) const;
02567 
02568 
02579     float windowToScreenY(const UDim& y) const;
02580 
02581 
02592     Vector2 windowToScreen(const UVector2& vec) const;
02593 
02594 
02605     Rect windowToScreen(const URect& rect) const;
02606 
02607 
02618     float screenToWindowX(const UDim& x) const;
02619 
02620 
02631     float screenToWindowY(const UDim& y) const;
02632 
02633 
02644     Vector2 screenToWindow(const UVector2& vec) const;
02645 
02646 
02657     Rect screenToWindow(const URect& rect) const;
02658 
02659 
02660     /*************************************************************************
02661         Interface to unified co-ordinate system
02662     *************************************************************************/
02687     void setWindowArea(const UDim& xpos, const UDim& ypos, const UDim& width, const UDim& height);
02688     
02707     void setWindowArea(const UVector2& pos, const UVector2& size);
02708     
02724     void setWindowArea(const URect& area);
02725     
02741     void setWindowPosition(const UVector2& pos);
02742 
02758     void setWindowXPosition(const UDim& x);
02759 
02775     void setWindowYPosition(const UDim& y);
02776 
02790     void setWindowSize(const UVector2& size);
02791 
02805     void setWindowWidth(const UDim& width);
02806 
02820     void setWindowHeight(const UDim& height);
02821 
02836     void setWindowMaxSize(const UVector2& size);
02837 
02852     void setWindowMinSize(const UVector2& size);
02853 
02869     const URect& getWindowArea() const;
02870 
02886     const UVector2& getWindowPosition() const;
02887 
02903     const UDim& getWindowXPosition() const;
02904 
02920     const UDim& getWindowYPosition() const;
02921 
02935     UVector2 getWindowSize() const;
02936 
02950     UDim getWindowWidth() const;
02951 
02965     UDim getWindowHeight() const;
02966 
02981     const UVector2& getWindowMaxSize() const;
02982 
02997     const UVector2& getWindowMinSize() const;
02998 
02999 
03000         /*************************************************************************
03001                 Main render function.
03002         *************************************************************************/
03010         void    render(void);
03011 
03012 
03028         void    update(float elapsed);
03029 
03030 
03041     virtual void writeXMLToStream(OutStream& out_stream) const;
03042 
03043 protected:
03044         /*************************************************************************
03045                 System object can trigger events directly
03046         *************************************************************************/
03047         friend  class System;
03048 
03049 
03050         /*************************************************************************
03051                 Event trigger methods
03052         *************************************************************************/
03061         virtual void    onSized(WindowEventArgs& e);
03062 
03063 
03072         virtual void    onMoved(WindowEventArgs& e);
03073 
03074 
03083         virtual void    onTextChanged(WindowEventArgs& e);
03084 
03085 
03094         virtual void    onFontChanged(WindowEventArgs& e);
03095 
03096 
03105         virtual void    onAlphaChanged(WindowEventArgs& e);
03106 
03107 
03116         virtual void    onIDChanged(WindowEventArgs& e);
03117 
03118 
03127         virtual void    onShown(WindowEventArgs& e);
03128 
03129 
03138         virtual void    onHidden(WindowEventArgs& e);
03139 
03140 
03149         virtual void    onEnabled(WindowEventArgs& e);
03150 
03151 
03160         virtual void    onDisabled(WindowEventArgs& e);
03161 
03162 
03171         virtual void    onMetricsChanged(WindowEventArgs& e);
03172 
03173 
03182         virtual void    onClippingChanged(WindowEventArgs& e);
03183 
03184 
03193         virtual void    onParentDestroyChanged(WindowEventArgs& e);
03194 
03195 
03204         virtual void    onInheritsAlphaChanged(WindowEventArgs& e);
03205 
03206 
03215         virtual void    onAlwaysOnTopChanged(WindowEventArgs& e);
03216 
03217 
03226         virtual void    onCaptureGained(WindowEventArgs& e);
03227 
03228 
03237         virtual void    onCaptureLost(WindowEventArgs& e);
03238 
03239 
03248         virtual void    onRenderingStarted(WindowEventArgs& e);
03249 
03250 
03259         virtual void    onRenderingEnded(WindowEventArgs& e);
03260 
03261 
03270         virtual void    onZChanged(WindowEventArgs& e);
03271 
03272 
03281         virtual void    onDestructionStarted(WindowEventArgs& e);
03282 
03283 
03291         virtual void    onActivated(ActivationEventArgs& e);
03292 
03293 
03301         virtual void    onDeactivated(ActivationEventArgs& e);
03302 
03303 
03313         virtual void    onParentSized(WindowEventArgs& e);
03314 
03315 
03323         virtual void    onChildAdded(WindowEventArgs& e);
03324 
03325 
03333         virtual void    onChildRemoved(WindowEventArgs& e);
03334 
03335 
03343         virtual void    onMouseEnters(MouseEventArgs& e);
03344 
03345 
03353         virtual void    onMouseLeaves(MouseEventArgs& e);
03354 
03355 
03363         virtual void    onMouseMove(MouseEventArgs& e);
03364 
03365 
03373         virtual void    onMouseWheel(MouseEventArgs& e);
03374 
03375 
03383         virtual void    onMouseButtonDown(MouseEventArgs& e);
03384 
03385 
03393         virtual void    onMouseButtonUp(MouseEventArgs& e);
03394 
03395 
03404         virtual void    onMouseClicked(MouseEventArgs& e);
03405 
03406 
03414         virtual void    onMouseDoubleClicked(MouseEventArgs& e);
03415 
03416 
03424         virtual void    onMouseTripleClicked(MouseEventArgs& e);
03425 
03426 
03435         virtual void    onKeyDown(KeyEventArgs& e);
03436 
03437 
03447         virtual void    onKeyUp(KeyEventArgs& e);
03448 
03449 
03459         virtual void    onCharacter(KeyEventArgs& e);
03460 
03470     virtual void    onDragDropItemEnters(DragDropEventArgs& e);
03471 
03472 
03482     virtual void    onDragDropItemLeaves(DragDropEventArgs& e);
03483 
03484 
03494     virtual void    onDragDropItemDropped(DragDropEventArgs& e);
03495 
03496     
03505     virtual void    onVerticalAlignmentChanged(WindowEventArgs& e);
03506 
03507     
03516     virtual void    onHorizontalAlignmentChanged(WindowEventArgs& e);
03517 
03518     
03519         /*************************************************************************
03520                 Implementation Functions
03521         *************************************************************************/
03532         virtual void    updateSelf(float elapsed);
03533 
03534 
03545         virtual void    drawSelf(float z);
03546 
03547 
03554     virtual void populateRenderCache()  {}
03555 
03556 
03567         virtual bool    testClassName_impl(const String& class_name) const
03568         {
03569                 if (class_name==(const utf8*)"Window")  return true;
03570                 return false;
03571         }
03572 
03573 
03584         void    setParent(Window* parent);
03585 
03586 
03594         float   getParentWidth(void) const;
03595 
03596 
03604         float   getParentHeight(void) const;
03605 
03606 
03614         Size    getParentSize(void) const;
03615 
03616 
03631         Rect    absoluteToRelative_impl(const Window* window, const Rect& rect) const;
03632         Size    absoluteToRelative_impl(const Window* window, const Size& sz) const;
03633         Point   absoluteToRelative_impl(const Window* window, const Point& pt) const;
03634         float   absoluteToRelativeX_impl(const Window* window, float x) const;
03635         float   absoluteToRelativeY_impl(const Window* window, float y) const;
03636 
03637 
03652         Rect    relativeToAbsolute_impl(const Window* window, const Rect& rect) const;
03653         Size    relativeToAbsolute_impl(const Window* window, const Size& sz) const;
03654         Point   relativeToAbsolute_impl(const Window* window, const Point& pt) const;
03655         float   relativeToAbsoluteX_impl(const Window* window, float x) const;
03656         float   relativeToAbsoluteY_impl(const Window* window, float y) const;
03657 
03658         Size    getWindowSize_impl(const Window* window) const;
03659 
03660 
03666         MetricsMode getInheritedMetricsMode(void) const;
03667 
03668     
03673     void    generateAutoRepeatEvent(MouseButton button);
03674 
03675 
03676         /*************************************************************************
03677                 Implementation Data
03678         *************************************************************************/
03679         // child stuff
03680         typedef std::vector<Window*>    ChildList;
03681         ChildList               d_children;                     
03682     ChildList       d_drawList;         
03683 
03684         // general data
03685         MetricsMode             d_metricsMode;          
03686         static Window*  d_captureWindow;        
03687         Window*                 d_oldCapture;           
03688         Window*                 d_parent;                       
03689         const Font*             d_font;                         
03690         String                  d_text;                         
03691         uint                    d_ID;                           
03692         float                   d_alpha;                        
03693     URect                       d_area;             
03694     Size            d_pixelSize;        
03695         const Image*    d_mouseCursor;          
03696         void*                   d_userData;                     
03697 
03698         typedef std::map<String, String>   UserStringMap;
03699         UserStringMap  d_userStrings;      
03700 
03701     // positional alignments
03702     HorizontalAlignment d_horzAlign;    
03703     VerticalAlignment   d_vertAlign;    
03704     
03705         // maximum and minimum sizes
03706         UVector2       d_minSize;          
03707         UVector2       d_maxSize;          
03708 
03709         // settings
03710         bool    d_enabled;                                      
03711         bool    d_visible;                                      
03712         bool    d_active;                                       
03713         bool    d_clippedByParent;                      
03714         bool    d_destroyedByParent;            
03715         bool    d_alwaysOnTop;                          
03716         bool    d_inheritsAlpha;                        
03717         bool    d_restoreOldCapture;            
03718         bool    d_zOrderingEnabled;                     
03719     bool    d_wantsMultiClicks;         
03720     bool    d_distCapturedInputs;       
03721     bool    d_riseOnClick;              
03722 
03723     // mouse button autorepeat data
03724     bool    d_autoRepeat;       
03725     float   d_repeatDelay;      
03726     float   d_repeatRate;       
03727     bool    d_repeating;        
03728     float   d_repeatElapsed;    
03729     MouseButton d_repeatButton; 
03730 
03731     // Tooltip stuff
03732     String   d_tooltipText;     
03733     Tooltip* d_customTip;       
03734     bool     d_weOwnTip;        
03735     bool     d_inheritsTipText; 
03736 
03737     // rendering
03738     RenderCache d_renderCache;  
03739     mutable bool d_needsRedraw;      
03740 
03741     // Look'N'Feel stuff
03742     String  d_lookName;         
03743 
03744 protected:
03745         /*************************************************************************
03746                 Properties for Window base class
03747         *************************************************************************/
03748         static  WindowProperties::AbsoluteHeight        d_absHeightProperty;
03749         static  WindowProperties::AbsoluteMaxSize       d_absMaxSizeProperty;
03750         static  WindowProperties::AbsoluteMinSize       d_absMinSizeProperty;
03751         static  WindowProperties::AbsolutePosition      d_absPositionProperty;
03752         static  WindowProperties::AbsoluteRect          d_absRectProperty;
03753         static  WindowProperties::AbsoluteSize          d_absSizeProperty;
03754         static  WindowProperties::AbsoluteWidth         d_absWidthProperty;
03755         static  WindowProperties::AbsoluteXPosition     d_absXPosProperty;
03756         static  WindowProperties::AbsoluteYPosition     d_absYPosProperty;
03757         static  WindowProperties::Alpha                         d_alphaProperty;
03758         static  WindowProperties::AlwaysOnTop           d_alwaysOnTopProperty;
03759         static  WindowProperties::ClippedByParent       d_clippedByParentProperty;
03760         static  WindowProperties::DestroyedByParent     d_destroyedByParentProperty;
03761         static  WindowProperties::Disabled                      d_disabledProperty;
03762         static  WindowProperties::Font                          d_fontProperty;
03763         static  WindowProperties::Height                        d_heightProperty;
03764         static  WindowProperties::ID                            d_IDProperty;
03765         static  WindowProperties::InheritsAlpha         d_inheritsAlphaProperty;
03766         static  WindowProperties::MetricsMode           d_metricsModeProperty;
03767         static  WindowProperties::MouseCursorImage      d_mouseCursorProperty;
03768         static  WindowProperties::Position                      d_positionProperty;
03769         static  WindowProperties::Rect                          d_rectProperty;
03770         static  WindowProperties::RelativeHeight        d_relHeightProperty;
03771         static  WindowProperties::RelativeMaxSize       d_relMaxSizeProperty;
03772         static  WindowProperties::RelativeMinSize       d_relMinSizeProperty;
03773         static  WindowProperties::RelativePosition      d_relPositionProperty;
03774         static  WindowProperties::RelativeRect          d_relRectProperty;
03775         static  WindowProperties::RelativeSize          d_relSizeProperty;
03776         static  WindowProperties::RelativeWidth         d_relWidthProperty;
03777         static  WindowProperties::RelativeXPosition     d_relXPosProperty;
03778         static  WindowProperties::RelativeYPosition     d_relYPosProperty;
03779         static  WindowProperties::RestoreOldCapture     d_restoreOldCaptureProperty;
03780         static  WindowProperties::Size                          d_sizeProperty;
03781         static  WindowProperties::Text                          d_textProperty;
03782         static  WindowProperties::Visible                       d_visibleProperty;
03783         static  WindowProperties::Width                         d_widthProperty;
03784         static  WindowProperties::XPosition                     d_xPosProperty;
03785         static  WindowProperties::YPosition                     d_yPosProperty;
03786         static  WindowProperties::ZOrderChangeEnabled   d_zOrderChangeProperty;
03787     static  WindowProperties::WantsMultiClickEvents d_wantsMultiClicksProperty;
03788     static  WindowProperties::MouseButtonDownAutoRepeat d_autoRepeatProperty;
03789     static  WindowProperties::AutoRepeatDelay   d_autoRepeatDelayProperty;
03790     static  WindowProperties::AutoRepeatRate    d_autoRepeatRateProperty;
03791     static  WindowProperties::DistributeCapturedInputs d_distInputsProperty;
03792     static  WindowProperties::CustomTooltipType d_tooltipTypeProperty;
03793     static  WindowProperties::Tooltip           d_tooltipProperty;
03794     static  WindowProperties::InheritsTooltipText d_inheritsTooltipProperty;
03795     static  WindowProperties::RiseOnClick       d_riseOnClickProperty;
03796     static  WindowProperties::VerticalAlignment   d_vertAlignProperty;
03797     static  WindowProperties::HorizontalAlignment d_horzAlignProperty;
03798     static      WindowProperties::UnifiedAreaRect       d_unifiedAreaRectProperty;
03799     static      WindowProperties::UnifiedPosition       d_unifiedPositionProperty;
03800     static      WindowProperties::UnifiedXPosition      d_unifiedXPositionProperty;
03801     static      WindowProperties::UnifiedYPosition      d_unifiedYPositionProperty;
03802     static      WindowProperties::UnifiedSize           d_unifiedSizeProperty;
03803     static      WindowProperties::UnifiedWidth          d_unifiedWidthProperty;
03804     static      WindowProperties::UnifiedHeight         d_unifiedHeightProperty;
03805     static      WindowProperties::UnifiedMinSize        d_unifiedMinSizeProperty;
03806     static      WindowProperties::UnifiedMaxSize        d_unifiedMaxSizeProperty;
03807 
03808 
03809         /*************************************************************************
03810                 implementation functions
03811         *************************************************************************/
03816         void    addStandardEvents(void);
03817 
03822         virtual void    cleanupChildren(void);
03823 
03828         virtual void    addChild_impl(Window* wnd);
03829 
03834         virtual void    removeChild_impl(Window* wnd);
03835 
03840         virtual void    onZChange_impl(void);
03841 
03842 
03847         void    addStandardProperties(void);
03848 
03849 
03854     virtual void moveToFront_impl(bool wasClicked);
03855 
03856 
03861     void doRiseOnClick(void);
03862 
03863     
03891     void setWindowArea_impl(const UVector2& pos, const UVector2& size, bool topLeftSizing = false, bool fireEvents = true);
03892 
03910     void addWindowToDrawList(Window& wnd, bool at_back = false);
03911 
03923     void removeWindowFromDrawList(const Window& wnd);
03924 
03925     virtual int writePropertiesXML(OutStream& out_stream) const;
03926     virtual int writeChildWindowsXML(OutStream& out_stream) const;
03927         
03928         /*************************************************************************
03929                 May not copy or assign Window objects
03930         *************************************************************************/
03931         Window(const Window& wnd) {}
03932         Window& operator=(const Window& wnd) {return *this;}
03933 
03934         /*************************************************************************
03935                 Private implementation Data
03936         *************************************************************************/
03937         const String    d_type;                 
03938         const String    d_name;                 
03939         String    d_falagardType;       
03940 };
03941 
03942 } // End of  CEGUI namespace section
03943 
03944 
03945 #if defined(_MSC_VER)
03946 #       pragma warning(pop)
03947 #endif
03948 
03949 #endif  // end of guard _CEGUIWindow_h_

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