X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50f3c41d61bd9ae69f215bad923f562d509e063c..54aa3821fc7c1df012efc5e5dd4a09ab5ed8d90d:/include/wx/toplevel.h?ds=sidebyside diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 50409bb5ce..e9be5bb460 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -197,10 +197,36 @@ public: void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } // Set window transparency if the platform supports it - virtual bool SetTranslucency(int WXUNUSED(alpha)) { return false; } - virtual bool CanSetTranslucency() { return false; } + virtual bool SetTransparent(wxByte WXUNUSED(alpha)) { return false; } + virtual bool CanSetTransparent() { return false; } + + + // default item access: we have a permanent default item which is the one + // set by the user code but we may also have a temporary default item which + // would be chosen if the user pressed "Enter" now but the default action + // reverts to the "permanent" default as soon as this temporary default + // item loses focus + + // used to reset default if pointing to removed child + virtual void RemoveChild(wxWindowBase *child); + + // get the default item, temporary or permanent + wxWindow *GetDefaultItem() const + { return m_winTmpDefault ? m_winTmpDefault : m_winDefault; } + + // set the permanent default item, return the old default + wxWindow *SetDefaultItem(wxWindow *win) + { wxWindow *old = GetDefaultItem(); m_winDefault = win; return old; } + + // return the temporary default item, can be NULL + wxWindow *GetTmpDefaultItem() const { return m_winTmpDefault; } + + // set a temporary default item, SetTmpDefaultItem(NULL) should be called + // soon after a call to SetTmpDefaultItem(window), return the old default + wxWindow *SetTmpDefaultItem(wxWindow *win) + { wxWindow *old = GetDefaultItem(); m_winTmpDefault = win; return old; } + - // implementation only from now on // ------------------------------- @@ -264,6 +290,12 @@ protected: // the frame icon wxIconBundle m_icons; + // a default window (usually a button) or NULL + wxWindow *m_winDefault; + + // a temporary override of m_winDefault, use the latter if NULL + wxWindow *m_winTmpDefault; + DECLARE_NO_COPY_CLASS(wxTopLevelWindowBase) DECLARE_EVENT_TABLE() };