X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98018a4b057dda20023a9276681f3d4ed335a6e1..55bfbcb92b41ab1c6a0d490f2f3fcadefc069bb7:/include/wx/toplevel.h diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index c737099e2f..268ecbd4ad 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -18,7 +18,7 @@ // headers // ---------------------------------------------------------------------------- -#include "wx/window.h" +#include "wx/nonownedwnd.h" #include "wx/iconbndl.h" // the default names for various classes @@ -115,7 +115,7 @@ enum // wxTopLevelWindow: a top level (as opposed to child) window // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTopLevelWindowBase : public wxWindow +class WXDLLEXPORT wxTopLevelWindowBase : public wxNonOwnedWindow { public: // construction @@ -145,16 +145,16 @@ public: virtual bool IsIconized() const = 0; // get the frame icon - const wxIcon& GetIcon() const { return m_icons.GetIcon( -1 ); } + wxIcon GetIcon() const; // get the frame icons const wxIconBundle& GetIcons() const { return m_icons; } - // set the frame icon - virtual void SetIcon(const wxIcon& icon) { m_icons = wxIconBundle( icon ); } + // set the frame icon: implemented in terms of SetIcons() + void SetIcon(const wxIcon& icon); // set the frame icons - virtual void SetIcons(const wxIconBundle& icons ) { m_icons = icons; } + virtual void SetIcons(const wxIconBundle& icons) { m_icons = icons; } // maximize the window to cover entire screen virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0; @@ -248,8 +248,6 @@ public: // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; -protected: - // a different API for SetSizeHints virtual void SetMinSize(const wxSize& minSize); virtual void SetMaxSize(const wxSize& maxSize); @@ -259,6 +257,7 @@ protected: int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, int incW = wxDefaultCoord, int incH = wxDefaultCoord ); +protected: // the frame client to screen translation should take account of the // toolbar which may shift the origin of the client area virtual void DoClientToScreen(int *x, int *y) const; @@ -296,6 +295,11 @@ protected: static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; } static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; } + // reset m_winDefault and m_winTmpDefault if they point to the window being + // destroyed + void OnChildDestroy(wxWindowDestroyEvent& event); + + // the frame icon wxIconBundle m_icons;