Replace wxAuiManager_HasLiveResize() hack with normal accessor
For some unknown reason a free function taking "*this" was used instead of just an accessor. Add the latter to make this code less unusual.
This commit is contained in:
@@ -412,6 +412,7 @@ public:
|
|||||||
|
|
||||||
void SetFlags(unsigned int flags);
|
void SetFlags(unsigned int flags);
|
||||||
unsigned int GetFlags() const;
|
unsigned int GetFlags() const;
|
||||||
|
bool HasLiveResize() const;
|
||||||
|
|
||||||
void SetManagedWindow(wxWindow* managedWnd);
|
void SetManagedWindow(wxWindow* managedWnd);
|
||||||
wxWindow* GetManagedWindow() const;
|
wxWindow* GetManagedWindow() const;
|
||||||
|
@@ -310,6 +310,20 @@ public:
|
|||||||
wxAuiPaneInfo& GetPane(const wxString& name);
|
wxAuiPaneInfo& GetPane(const wxString& name);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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.
|
||||||
|
|
||||||
|
Using this accessor allows to verify whether live resizing is being
|
||||||
|
actually used.
|
||||||
|
|
||||||
|
@since 3.1.4
|
||||||
|
*/
|
||||||
|
bool HasLiveResize() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
HideHint() hides any docking hint that may be visible.
|
HideHint() hides any docking hint that may be visible.
|
||||||
*/
|
*/
|
||||||
|
@@ -771,17 +771,14 @@ unsigned int wxAuiManager::GetFlags() const
|
|||||||
return m_flags;
|
return m_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience function
|
bool wxAuiManager::HasLiveResize() const
|
||||||
static
|
|
||||||
bool wxAuiManager_HasLiveResize(wxAuiManager& manager)
|
|
||||||
{
|
{
|
||||||
// With Core Graphics on Mac, it's not possible to show sash feedback,
|
// With Core Graphics on Mac, it's not possible to show sash feedback,
|
||||||
// so we'll always use live update instead.
|
// so we'll always use live update instead.
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
wxUnusedVar(manager);
|
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
return (manager.GetFlags() & wxAUI_MGR_LIVE_RESIZE) == wxAUI_MGR_LIVE_RESIZE;
|
return (GetFlags() & wxAUI_MGR_LIVE_RESIZE) == wxAUI_MGR_LIVE_RESIZE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4429,13 +4426,13 @@ void wxAuiManager::OnLeftUp(wxMouseEvent& event)
|
|||||||
{
|
{
|
||||||
m_frame->ReleaseMouse();
|
m_frame->ReleaseMouse();
|
||||||
|
|
||||||
if (!wxAuiManager_HasLiveResize(*this))
|
if (!HasLiveResize())
|
||||||
{
|
{
|
||||||
// get rid of the hint rectangle
|
// get rid of the hint rectangle
|
||||||
wxScreenDC dc;
|
wxScreenDC dc;
|
||||||
DrawResizeHint(dc, m_actionHintRect);
|
DrawResizeHint(dc, m_actionHintRect);
|
||||||
}
|
}
|
||||||
if (m_currentDragItem != -1 && wxAuiManager_HasLiveResize(*this))
|
if (m_currentDragItem != -1 && HasLiveResize())
|
||||||
m_actionPart = & (m_uiParts.Item(m_currentDragItem));
|
m_actionPart = & (m_uiParts.Item(m_currentDragItem));
|
||||||
|
|
||||||
DoEndResizeAction(event);
|
DoEndResizeAction(event);
|
||||||
@@ -4539,7 +4536,7 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
|
|||||||
else
|
else
|
||||||
pos.x = wxMax(0, event.m_x - m_actionOffset.x);
|
pos.x = wxMax(0, event.m_x - m_actionOffset.x);
|
||||||
|
|
||||||
if (wxAuiManager_HasLiveResize(*this))
|
if (HasLiveResize())
|
||||||
{
|
{
|
||||||
m_frame->ReleaseMouse();
|
m_frame->ReleaseMouse();
|
||||||
DoEndResizeAction(event);
|
DoEndResizeAction(event);
|
||||||
|
Reference in New Issue
Block a user