X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45a959a33bac277694a647495b2efc7c023a58b7..997176a34641a870b1f6c6102e30f64f86b4122a:/include/wx/window.h diff --git a/include/wx/window.h b/include/wx/window.h index 1c57f21291..7839127ea9 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -107,7 +107,7 @@ public: // pseudo ctor (can't be virtual, called from ctor) bool CreateBase(wxWindowBase *parent, - wxWindowID id, + wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -116,16 +116,6 @@ public: virtual ~wxWindowBase(); -#if wxUSE_WX_RESOURCES - // these functions are implemented in resource.cpp and resourc2.cpp - virtual bool LoadFromResource(wxWindow *parent, - const wxString& resourceName, - const wxResourceTable *table = (const wxResourceTable *) NULL); - virtual wxControl *CreateItem(const wxItemResource* childResource, - const wxItemResource* parentResource, - const wxResourceTable *table = (const wxResourceTable *) NULL); -#endif // wxUSE_WX_RESOURCES - // deleting the window // ------------------- @@ -169,7 +159,7 @@ public: // window id uniquely identifies the window among its siblings unless // it is -1 which means "don't care" - void SetId( wxWindowID id ) { m_windowId = id; } + void SetId( wxWindowID winid ) { m_windowId = winid; } wxWindowID GetId() const { return m_windowId; } // generate a control id for the controls which were not given one by @@ -177,10 +167,10 @@ public: static int NewControlId() { return --ms_lastControlId; } // get the id of the control following the one with the given // (autogenerated) id - static int NextControlId(int id) { return id - 1; } + static int NextControlId(int winid) { return winid - 1; } // get the id of the control preceding the one with the given // (autogenerated) id - static int PrevControlId(int id) { return id + 1; } + static int PrevControlId(int winid) { return winid + 1; } // moving/resizing // --------------- @@ -464,11 +454,11 @@ public: // find window among the descendants of this one either by id or by // name (return NULL if not found) - wxWindow *FindWindow( long id ); + wxWindow *FindWindow( long winid ); wxWindow *FindWindow( const wxString& name ); // Find a window among any window (all return NULL if not found) - static wxWindow *FindWindowById( long id, const wxWindow *parent = NULL ); + static wxWindow *FindWindowById( long winid, const wxWindow *parent = NULL ); static wxWindow *FindWindowByName( const wxString& name, const wxWindow *parent = NULL ); static wxWindow *FindWindowByLabel( const wxString& label, @@ -690,11 +680,19 @@ public: // misc // ---- - // get the window border style: uses the current style and falls back to - // the default style for this class otherwise (see GetDefaultBorder()) - wxBorder GetBorder() const; + // get the window border style from the given flags: this is different from + // simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to + // translate wxBORDER_DEFAULT to something reasonable + wxBorder GetBorder(long flags) const; + + // get border for the flags of this window + wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); } - void UpdateWindowUI(); + // send wxUpdateUIEvents to this window, and children if recurse is TRUE + virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE); + + // do the window-specific processing after processing the update event + virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; #if wxUSE_MENUS bool PopupMenu( wxMenu *menu, const wxPoint& pos ) @@ -864,7 +862,14 @@ public: void OnHelp(wxHelpEvent& event); #endif // wxUSE_HELP - // get the haqndle of the window for the underlying window system: this + // virtual function for implementing internal idle + // behaviour + virtual void OnInternalIdle() {} + + // call internal idle recursively + void ProcessInternalIdle() ; + + // get the handle of the window for the underlying window system: this // is only used for wxWin itself or for user code which wants to call // platform-specific APIs virtual WXWidget GetHandle() const = 0; @@ -886,11 +891,21 @@ public: #endif // wxUSE_PALETTE protected: + // event handling specific to wxWindow +#if wxUSE_VALIDATORS + virtual bool TryValidator(wxEvent& event); +#endif // wxUSE_VALIDATORS + virtual bool TryParent(wxEvent& event); + + #if wxUSE_CONSTRAINTS // satisfy the constraints for the windows but don't set the window sizes void SatisfyConstraints(); #endif // wxUSE_CONSTRAINTS + // Send the wxWindowDestroyEvent + void SendDestroyEvent(); + // the window id - a number which uniquely identifies a window among // its siblings unless it is -1 wxWindowID m_windowId; @@ -1152,6 +1167,14 @@ private: #define sm_classwxWindowMac sm_classwxWindow #endif // wxUniv #include "wx/mac/window.h" +#elif defined(__WXCOCOA__) + #ifdef __WXUNIVERSAL__ + #define wxWindowNative wxWindowCocoa + #else // !wxUniv + #define wxWindowCocoa wxWindow + #define sm_classwxWindowCocoa sm_classwxWindow + #endif // wxUniv + #include "wx/cocoa/window.h" #elif defined(__WXPM__) #ifdef __WXUNIVERSAL__ #define wxWindowNative wxWindowOS2 @@ -1210,7 +1233,7 @@ inline int NewControlId() { return wxWindowBase::NewControlId(); } class WXDLLEXPORT wxWindowAccessible: public wxAccessible { public: - wxWindowAccessible(wxWindow* win): wxAccessible(win) {} + wxWindowAccessible(wxWindow* win): wxAccessible(win) { if (win) win->SetAccessible(this); } virtual ~wxWindowAccessible() {}; // Overridables @@ -1230,7 +1253,7 @@ public: virtual wxAccStatus GetName(int childId, wxString* name); // Gets the number of children. - virtual wxAccStatus GetChildCount(int* childId); + virtual wxAccStatus GetChildCount(int* childCount); // Gets the specified child (starting from 1). // If *child is NULL and return value is wxACC_OK,