X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07880314d4176c6205c83efbf0ad0ea9ad56d789..1286b7ba6c0e4d1513a0109cb6f57db622012881:/include/wx/toplevel.h diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 8881631c5c..fee628786c 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -196,17 +196,40 @@ public: void CentreOnScreen(int dir = wxBOTH) { DoCentre(dir | wxCENTRE_ON_SCREEN); } void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } - // Set window transparency if the platform supports it - 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 // ------------------------------- // override some base class virtuals virtual bool Destroy(); virtual bool IsTopLevel() const { return true; } + virtual bool IsVisible() const { return IsShown(); } virtual wxSize GetMaxSize() const; // event handlers @@ -264,6 +287,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() }; @@ -288,6 +317,9 @@ protected: #elif defined(__WXMGL__) #include "wx/mgl/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMGL +#elif defined(__WXDFB__) + #include "wx/dfb/toplevel.h" + #define wxTopLevelWindowNative wxTopLevelWindowDFB #elif defined(__WXMAC__) #include "wx/mac/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMac