diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 2d94200ba3..fa3b98dabd 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -412,6 +412,8 @@ public: void SetFlags(unsigned int flags); unsigned int GetFlags() const; + + static bool AlwaysUsesLiveResize(); bool HasLiveResize() const; void SetManagedWindow(wxWindow* managedWnd); diff --git a/interface/wx/aui/framemanager.h b/interface/wx/aui/framemanager.h index 34fabd3f89..ab2352a149 100644 --- a/interface/wx/aui/framemanager.h +++ b/interface/wx/aui/framemanager.h @@ -207,6 +207,19 @@ public: const wxPoint& drop_pos); //@} + /** + Returns true if live resize is always used on the current platform. + + If this function returns true, ::wxAUI_MGR_LIVE_RESIZE flag is ignored + and live resize is always used, whether it's specified or not. + + Currently this is the case for wxOSX port, as live resizing is the only + implemented method there. + + @since 3.1.4 + */ + static bool AlwaysUsesLiveResize(); + /** This function is used by controls to calculate the drop hint rectangle. @@ -313,9 +326,9 @@ public: /** Returns true if windows are resized live. - Live resizing behaviour is specified by wxAUI_MGR_LIVE_RESIZE flag, - however some platforms (currently wxOSX) ignore it and always use live - resizing because this is the only implemented resize mode. + This function combines the check for AlwaysUsesLiveResize() and, for + the platforms where live resizing is optional, the check for + wxAUI_MGR_LIVE_RESIZE flag. Using this accessor allows to verify whether live resizing is being actually used. diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index 8c22e15cb2..492f0ba61b 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -709,7 +709,9 @@ MyFrame::MyFrame(wxWindow* parent, options_menu->AppendCheckItem(ID_NoVenetianFade, _("Disable Venetian Blinds Hint Fade-in")); options_menu->AppendCheckItem(ID_TransparentDrag, _("Transparent Drag")); options_menu->AppendCheckItem(ID_AllowActivePane, _("Allow Active Pane")); - options_menu->AppendCheckItem(ID_LiveUpdate, _("Live Resize Update")); + // Only show "live resize" toggle if it's actually functional. + if ( !wxAuiManager::AlwaysUsesLiveResize() ) + options_menu->AppendCheckItem(ID_LiveUpdate, _("Live Resize Update")); options_menu->AppendSeparator(); options_menu->AppendRadioItem(ID_NoGradient, _("No Caption Gradient")); options_menu->AppendRadioItem(ID_VerticalGradient, _("Vertical Caption Gradient")); diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 7da7035baf..db03fe45cf 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -772,11 +772,22 @@ unsigned int wxAuiManager::GetFlags() const return m_flags; } +// With Core Graphics on Mac, it's not possible to show sash feedback, +// so we'll always use live update instead. +#if defined(__WXMAC__) + #define wxUSE_AUI_LIVE_RESIZE_ALWAYS 1 +#else + #define wxUSE_AUI_LIVE_RESIZE_ALWAYS 0 +#endif + +/* static */ bool wxAuiManager::AlwaysUsesLiveResize() +{ + return wxUSE_AUI_LIVE_RESIZE_ALWAYS; +} + bool wxAuiManager::HasLiveResize() const { - // With Core Graphics on Mac, it's not possible to show sash feedback, - // so we'll always use live update instead. -#if defined(__WXMAC__) +#if wxUSE_AUI_LIVE_RESIZE_ALWAYS return true; #else return (GetFlags() & wxAUI_MGR_LIVE_RESIZE) == wxAUI_MGR_LIVE_RESIZE;