This fixes an assert in wxGenericStaticText which overrode
DoGetBestClientSize() but not DoGetBorderSize().
It would still be useful to implement DoGetBorderSize() in wxGTK (and other
ports) in general too as using wxGenericStaticText with non-default border
still doesn't work.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62820
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// 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 and wxUniv so
- // far and subject to change, don't use
- virtual wxSize DoGetBorderSize() const
- {
- wxFAIL_MSG( "must be overridden if called" );
-
- return wxDefaultSize;
- }
+ // NB: this is currently only implemented by wxMSW and wxUniv so far and
+ // simply asserts in the other ports
+ virtual wxSize DoGetBorderSize() const;
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize() and would usually just
return min;
}
+wxSize wxWindowBase::DoGetBorderSize() const
+{
+ // there is one case in which we can implement it for all ports easily:
+ // do it as some classes used by both wxUniv and native ports (e.g.
+ // wxGenericStaticText) do override DoGetBestClientSize() and so this
+ // method must work for them and that ensures that it does, at least in
+ // the default case)
+ if ( GetBorder() == wxBORDER_NONE )
+ return wxSize(0, 0);
+
+ wxFAIL_MSG( "must be overridden if called" );
+
+ return wxDefaultSize;
+}
+
wxSize wxWindowBase::GetBestSize() const
{
if ( !m_windowSizer && m_bestSizeCache.IsFullySpecified() )