]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/window.h
renaming mac to osx and subdirs
[wxWidgets.git] / interface / window.h
index 79235c42cad76769405c69be9eef67df418c06a4..931d98b266ce7dc3b50cb0b6d6973999e28e4d95 100644 (file)
     Please note that all children of the window will be deleted automatically by
     the destructor before the window itself is deleted which means that you don't
     have to worry about deleting them manually. Please see the @ref
-    overview_windowdeletionoverview "window
-    deletion overview" for more information.
+    overview_windowdeletion "window deletion overview" for more information.
 
     Also note that in this, and many others, wxWidgets classes some
     @c GetXXX() methods may be overloaded (as, for example,
-    wxWindow::GetSize or
-    wxWindow::GetClientSize). In this case, the overloads
+    wxWindow::GetSize or wxWindow::GetClientSize). In this case, the overloads
     are non-virtual because having multiple virtual functions with the same name
     results in a virtual function name hiding at the derived class level (in
     English, this means that the derived class has to override all overloaded
     @library{wxcore}
     @category{FIXME}
 
-    @see @ref overview_eventhandlingoverview, @ref overview_windowsizingoverview
-    "Window sizing overview"
+    @see @ref overview_eventhandling "Event handling overview", 
+         @ref overview_windowsizing "Window sizing overview"
 */
 class wxWindow : public wxEvtHandler
 {
 public:
-    //@{
+    /**
+       Default constructor
+    */
+    wxWindow();
+    
     /**
         Constructs a window, which can be a child of a frame, dialog or any other
         non-control window.
@@ -161,13 +163,11 @@ public:
         @param name
             Window name.
     */
-    wxWindow();
     wxWindow(wxWindow* parent, wxWindowID id,
              const wxPoint& pos = wxDefaultPosition,
              const wxSize& size = wxDefaultSize,
              long style = 0,
              const wxString& name = wxPanelNameStr);
-    //@}
 
     /**
         Destructor. Deletes all sub-windows, then deletes itself. Instead of using
@@ -187,7 +187,7 @@ public:
 
         @see AcceptsFocusFromKeyboard()
     */
-    bool AcceptsFocus() const;
+    virtual bool AcceptsFocus() const;
 
     /**
         This method may be overridden in the derived classes to return @false to
@@ -195,8 +195,15 @@ public:
         clicks it with the mouse, it shouldn't be included in the TAB traversal chain
         when using the keyboard.
     */
-    bool AcceptsFocusFromKeyboard() const;
+    virtual bool AcceptsFocusFromKeyboard() const;
 
+     /**
+        Overridden to indicate wehter this window or one of its children accepts
+        focus. Usually it's the same as AcceptsFocus() but is overridden for
+        container windows
+     */
+    virtual bool AcceptsFocusRecursively() const;
+    
     /**
         Adds a child window.  This is called automatically by window creation
         functions so should not be required by the application programmer.
@@ -319,8 +326,8 @@ public:
         @param pt
             The client position for the second form of the function.
     */
-    virtual void ClientToScreen(int* x, int* y) const;
-    const virtual wxPoint  ClientToScreen(const wxPoint& pt) const;
+    void ClientToScreen(int* x, int* y) const;
+    wxPoint ClientToScreen(const wxPoint& pt) const;
     //@}
 
     /**
@@ -509,13 +516,18 @@ public:
     */
     static wxWindow* FindFocus();
 
-    //@{
     /**
-        Find a child of this window, by name.
+        Find a child of this window, by @a id. May return @a this if
+        it matches itself.
     */
     wxWindow* FindWindow(long id) const;
-    const wxWindow*  FindWindow(const wxString& name) const;
-    //@}
+    
+
+    /**
+        Find a child of this window, by name. May return @a this if
+        it matches itself.
+    */
+    wxWindow* FindWindow(const wxString& name) const;
 
     /**
         Find the first window with the given @e id.
@@ -629,7 +641,7 @@ public:
         @see SetBackgroundColour(), SetForegroundColour(),
              GetForegroundColour()
     */
-    virtual wxColour GetBackgroundColour() const;
+    wxColour GetBackgroundColour() const;
 
     /**
         Returns the background style of the window. The background style can be one of:
@@ -702,11 +714,10 @@ public:
     //@{
     /**
         Returns a reference to the list of the window's children. @c wxWindowList
-        is a type-safe wxList-like class whose elements are of type
-        @c wxWindow *.
+        is a type-safe wxList-like class whose elements are of type @c wxWindow*.
     */
-    wxWindowList GetChildren() const;
-    const wxWindowList GetChildren() const;
+    wxWindowList& GetChildren();
+    const wxWindowList& GetChildren() const;
     //@}
 
     /**
@@ -749,7 +760,7 @@ public:
         @see GetSize(), GetVirtualSize()
     */
     void GetClientSize(int* width, int* height) const;
-    const wxSize  GetClientSize() const;
+    wxSize GetClientSize() const;
     //@}
 
     /**
@@ -761,14 +772,14 @@ public:
         Return the sizer that this window is a member of, if any, otherwise
         @NULL.
     */
-    const wxSizer* GetContainingSizer() const;
+    wxSizer* GetContainingSizer() const;
 
     /**
         Return the cursor associated with this window.
 
         @see SetCursor()
     */
-    const wxCursor GetCursor() const;
+    const wxCursor& GetCursor() const;
 
     /**
         Currently this is the same as calling
@@ -833,7 +844,7 @@ public:
         @see SetForegroundColour(), SetBackgroundColour(),
              GetBackgroundColour()
     */
-    virtual wxColour GetForegroundColour();
+    wxColour GetForegroundColour();
 
     /**
         Returns the grandparent of a window, or @NULL if there isn't one.
@@ -927,10 +938,10 @@ public:
 
     /**
         Returns the minimum size of the window, an indication to the sizer layout
-        mechanism
-        that this is the minimum required size. It normally just returns the value set
-        by SetMinSize(), but it can be overridden to do the
-        calculation on demand.
+        mechanism that this is the minimum required size.
+
+        This method normally just returns the value set by SetMinSize(), but it
+        can be overridden to do the calculation on demand.
 
         @see GetMinClientSize()
     */
@@ -999,8 +1010,8 @@ public:
 
         @see GetScreenPosition()
     */
-    virtual void GetPosition(int* x, int* y) const;
-    const wxPoint  GetPosition() const;
+    void GetPosition(int* x, int* y) const;
+    wxPoint GetPosition() const;
     //@}
 
     /**
@@ -1019,7 +1030,7 @@ public:
 
         @see GetScreenRect()
     */
-    virtual wxRect GetRect() const;
+    wxRect GetRect() const;
 
     //@{
     /**
@@ -1033,8 +1044,8 @@ public:
 
         @see GetPosition()
     */
-    virtual void GetScreenPosition(int* x, int* y) const;
-    const wxPoint  GetScreenPosition() const;
+    void GetScreenPosition(int* x, int* y) const;
+    wxPoint GetScreenPosition() const;
     //@}
 
     /**
@@ -1043,7 +1054,7 @@ public:
 
         @see GetRect()
     */
-    virtual wxRect GetScreenRect() const;
+    wxRect GetScreenRect() const;
 
     /**
         Returns the built-in scrollbar position.
@@ -2122,18 +2133,30 @@ public:
     /**
         Sets the minimum client size of the window, to indicate to the sizer
         layout mechanism that this is the minimum required size of window's client
-        area. You may need to call this if you change the window size after
+        area.
+
+        You may need to call this if you change the window size after
         construction and before adding to its parent sizer.
 
+        Note, that just as with SetMinSize(), calling this method doesn't
+        prevent the program from explicitly making the window smaller than the
+        specified size.
+
         @see SetMinSize()
     */
     void SetMinClientSize(const wxSize& size);
 
     /**
-        Sets the minimum size of the window, to indicate to the sizer layout mechanism
-        that this is the minimum required size. You may need to call this
-        if you change the window size after construction and before adding
-        to its parent sizer.
+        Sets the minimum size of the window, to indicate to the sizer layout
+        mechanism that this is the minimum required size.
+
+        You may need to call this if you change the window size after
+        construction and before adding to its parent sizer.
+
+        Notice that calling this method doesn't prevent the program from making
+        the window explicitly smaller than the specified size by calling
+        SetSize(), it just ensures that it won't become smaller than this size
+        during the automatic layout.
 
         @see SetMinClientSize()
     */
@@ -2286,16 +2309,6 @@ public:
     virtual void SetSize(const wxSize& size);
     //@}
 
-    /**
-        Use of this function for windows which are not toplevel windows
-        (such as wxDialog or wxFrame) is discouraged. Please use
-        SetMinSize() and SetMaxSize()
-        instead.
-
-        @see wxTopLevelWindow::SetSizeHints.
-    */
-
-
     /**
         Sets the window to have the given layout sizer. The window
         will then own the object, and will take care of its deletion.
@@ -2374,34 +2387,6 @@ public:
     void SetVirtualSize(const wxSize& size);
     //@}
 
-    //@{
-    /**
-        Allows specification of minimum and maximum virtual window sizes.
-        If a pair of values is not set (or set to -1), the default values
-        will be used.
-
-        @param minW
-            Specifies the minimum width allowable.
-        @param minH
-            Specifies the minimum height allowable.
-        @param maxW
-            Specifies the maximum width allowable.
-        @param maxH
-            Specifies the maximum height allowable.
-        @param minSize
-            Minimum size.
-        @param maxSize
-            Maximum size.
-
-        @remarks If this function is called, the user will not be able to size
-                 the virtual area of the window outside the given bounds.
-    */
-    virtual void SetVirtualSizeHints(int minW, int minH, int maxW = -1,
-                                     int maxH = -1);
-    void SetVirtualSizeHints(const wxSize& minSize = wxDefaultSize,
-                             const wxSize& maxSize = wxDefaultSize);
-    //@}
-
     /**
         Identical to SetWindowStyleFlag().
     */