From c6cc416977228b35d161cbc3a506e993922e7573 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 21 Oct 2018 16:45:24 +0200 Subject: [PATCH] Propagate InformFirstDirection() to wxCollapsiblePane pane As wxCollapsiblePane doesn't use sizers for layout (and while this could be changed for the generic version, it still wouldn't fix the problem for the native one), default InformFirstDirection() implementation forwarding it to the window sizer doesn't work for it and we need to explicitly let the contents of wxCollapsiblePane know about the available size. --- include/wx/collpane.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/wx/collpane.h b/include/wx/collpane.h index 54ccd73650..168dc7c06e 100644 --- a/include/wx/collpane.h +++ b/include/wx/collpane.h @@ -43,6 +43,23 @@ public: virtual wxString GetLabel() const wxOVERRIDE = 0; virtual void SetLabel(const wxString& label) wxOVERRIDE = 0; + + virtual bool + InformFirstDirection(int direction, + int size, + int availableOtherDir) wxOVERRIDE + { + wxWindow* const p = GetPane(); + if ( !p ) + return false; + + if ( !p->InformFirstDirection(direction, size, availableOtherDir) ) + return false; + + InvalidateBestSize(); + + return true; + } };