]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/window.h
no changes, just fix a typo in comment
[wxWidgets.git] / include / wx / window.h
index 4f5388aaa97cdcb88da4f1b7ff0d73aae0b1d3da..013426c8f80e1877375d33536654f199091830d7 100644 (file)
@@ -228,17 +228,21 @@ public:
     void SetId( wxWindowID winid ) { m_windowId = winid; }
     wxWindowID GetId() const { return m_windowId; }
 
-        // returns true if this id value belong to the range reserved for the
-        // auto-generated (by NewControlId()) ids (they're always negative)
-    static bool IsAutoGeneratedId(wxWindowID id);
-
         // generate a unique id (or count of them consecutively), returns a
-        // valid id in IsAutoGeneratedId() range or wxID_NONE if failed
-    static wxWindowID NewControlId(int count = 1);
+        // valid id in the auto-id range or wxID_NONE if failed.  If using
+        // autoid management, it will mark the id as reserved until it is
+        // used (by assigning it to a wxWindowIDRef) or unreserved.
+    static wxWindowID NewControlId(int count = 1)
+    {
+        return wxIdManager::ReserveId(count);
+    }
 
-        // mark an id previously returned by NewControlId() as being unused any
-        // more so that it can be reused again for another control later
-    static void ReleaseControlId(wxWindowID id);
+        // If an ID generated from NewControlId is not assigned to a wxWindowIDRef,
+        // it must be unreserved
+    static void UnreserveControlId(wxWindowID id, int count = 1)
+    {
+        wxIdManager::UnreserveId(id, count);
+    }
 
 
     // moving/resizing
@@ -616,6 +620,11 @@ public:
 
     static wxWindow *DoFindFocus() /* = 0: implement in derived classes */;
 
+        // return true if the window has focus (handles composite windows
+        // correctly - returns true if GetMainWindowOfCompositeControl()
+        // has focus)
+    virtual bool HasFocus() const;
+
         // can this window have focus in principle?
         //
         // the difference between AcceptsFocus[FromKeyboard]() and CanAcceptFocus
@@ -1356,7 +1365,7 @@ protected:
 
     // the window id - a number which uniquely identifies a window among
     // its siblings unless it is wxID_ANY
-    wxWindowID           m_windowId;
+    wxWindowIDRef        m_windowId;
 
     // the parent window of this window (or NULL) and the list of the children
     // of this window
@@ -1425,10 +1434,6 @@ protected:
     // Layout() window automatically when its size changes?
     bool                 m_autoLayout:1;
 
-    // true if we had automatically allocated the id value for this window
-    // (i.e. wxID_ANY had been passed to the ctor)
-    bool                 m_freeId:1;
-
     // window state
     bool                 m_isShown:1;
     bool                 m_isEnabled:1;
@@ -1747,8 +1752,8 @@ WXDLLEXPORT wxWindow* wxGetTopLevelParent(wxWindow *win);
 
 #if WXWIN_COMPATIBILITY_2_6
     // deprecated (doesn't start with 'wx' prefix), use wxWindow::NewControlId()
-    wxDEPRECATED( int NewControlId() );
-    inline int NewControlId() { return wxWindowBase::NewControlId(); }
+    wxDEPRECATED( wxWindowID NewControlId() );
+    inline wxWindowID NewControlId() { return wxWindowBase::NewControlId(); }
 #endif // WXWIN_COMPATIBILITY_2_6
 
 #if wxUSE_ACCESSIBILITY