Fixed size problem due to wxMac window implementation difference
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,6 +47,10 @@
|
|||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
|
#if defined(__WXMAC__) && wxUSE_SCROLLBAR
|
||||||
|
#include "wx/scrolbar.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_CONSTRAINTS
|
#if wxUSE_CONSTRAINTS
|
||||||
#include "wx/layout.h"
|
#include "wx/layout.h"
|
||||||
#endif // wxUSE_CONSTRAINTS
|
#endif // wxUSE_CONSTRAINTS
|
||||||
@@ -492,6 +496,24 @@ void wxWindowBase::FitInside()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On Mac, scrollbars are explicitly children.
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
static bool wxHasRealChildren(const wxWindowBase* win)
|
||||||
|
{
|
||||||
|
int realChildCount = 0;
|
||||||
|
|
||||||
|
for ( wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
|
||||||
|
node;
|
||||||
|
node = node->GetNext() )
|
||||||
|
{
|
||||||
|
wxWindow *win = node->GetData();
|
||||||
|
if ( !win->IsTopLevel() && win->IsShown() && !win->IsKindOf(CLASSINFO(wxScrollBar)))
|
||||||
|
realChildCount ++;
|
||||||
|
}
|
||||||
|
return (realChildCount > 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// return the size best suited for the current window
|
// return the size best suited for the current window
|
||||||
wxSize wxWindowBase::DoGetBestSize() const
|
wxSize wxWindowBase::DoGetBestSize() const
|
||||||
{
|
{
|
||||||
@@ -536,7 +558,11 @@ wxSize wxWindowBase::DoGetBestSize() const
|
|||||||
return wxSize(maxX, maxY);
|
return wxSize(maxX, maxY);
|
||||||
}
|
}
|
||||||
#endif // wxUSE_CONSTRAINTS
|
#endif // wxUSE_CONSTRAINTS
|
||||||
else if ( !GetChildren().empty() )
|
else if ( !GetChildren().empty()
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
&& wxHasRealChildren(this)
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// our minimal acceptable size is such that all our visible child windows fit inside
|
// our minimal acceptable size is such that all our visible child windows fit inside
|
||||||
int maxX = 0,
|
int maxX = 0,
|
||||||
|
Reference in New Issue
Block a user