Fix inserting tools removed from wxToolBar back into it in wxMSW.
Make sure to reset the "to be deleted" flag we set on the tool when removing it from the toolbar to avoid layout problems if the tool is added back later. Closes #16735. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -228,7 +228,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToBeDeleted() { m_toBeDeleted = true; }
|
void ToBeDeleted(bool toBeDeleted = true) { m_toBeDeleted = toBeDeleted; }
|
||||||
bool IsToBeDeleted() const { return m_toBeDeleted; }
|
bool IsToBeDeleted() const { return m_toBeDeleted; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -570,8 +570,13 @@ WXDWORD wxToolBar::MSWGetStyle(long style, WXDWORD *exstyle) const
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
|
bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos),
|
||||||
wxToolBarToolBase * WXUNUSED(tool))
|
wxToolBarToolBase *tool)
|
||||||
{
|
{
|
||||||
|
// We might be inserting back a tool previously removed from the toolbar,
|
||||||
|
// make sure to reset its "to be deleted" flag to ensure that we do take it
|
||||||
|
// into account during our layout even in this case.
|
||||||
|
static_cast<wxToolBarTool*>(tool)->ToBeDeleted(false);
|
||||||
|
|
||||||
// nothing special to do here - we really create the toolbar buttons in
|
// nothing special to do here - we really create the toolbar buttons in
|
||||||
// Realize() later
|
// Realize() later
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
|
Reference in New Issue
Block a user