From 2c1a1ed190133bc31ce75992bf8ba13cb3e171a6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 22 Sep 2009 00:22:52 +0000 Subject: [PATCH] Implement wxWindow::DoGetBorderSize() in wxUniv. As some wxUniv classes implement DoGetBestClientSize(), the new code in wxWindow::DoGetBestSize() implementation calls DoGetBorderSize() which asserts because it's not implemented, making it impossible to even start the minimal sample -- fix this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/window.h | 3 +++ include/wx/window.h | 4 ++-- src/univ/winuniv.cpp | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index 1dc43df024..d5aa30e4ba 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -243,6 +243,9 @@ protected: virtual wxSize DoGetBestClientSize() const; virtual wxSize DoGetBestSize() const; + // override the base class method to return the size of the window borders + virtual wxSize DoGetBorderSize() const; + // adjust the size of the window to take into account its borders wxSize AdjustSize(const wxSize& size) const; diff --git a/include/wx/window.h b/include/wx/window.h index 9d863ee516..d85c077433 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -1661,8 +1661,8 @@ protected: // of the left and the right border in the x component of the returned size // and the sum of the heights of the top and bottom borders in the y one // - // NB: this is new/temporary API only implemented by wxMSW so far and - // subject to change, don't use + // NB: this is new/temporary API only implemented by wxMSW and wxUniv so + // far and subject to change, don't use virtual wxSize DoGetBorderSize() const { wxFAIL_MSG( "must be overridden if called" ); diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index ce34052eb8..1f86e4861c 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -728,6 +728,11 @@ wxSize wxWindow::DoGetBestClientSize() const return wxWindowNative::DoGetBestSize(); } +wxSize wxWindow::DoGetBorderSize() const +{ + return AdjustSize(wxSize(0, 0)); +} + wxSize wxWindow::AdjustSize(const wxSize& size) const { wxSize sz = size;