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 (for 3.0). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -597,6 +597,7 @@ wxMSW:
|
||||
- Fix best size calculation for bitmaps with buttons (Artur Wieczorek).
|
||||
- Fix size of the icon returned from wxFSVolume::GetIcon() (troelsk).
|
||||
- Fix autosize after expanding/collapsing items in wxDataViewCtrl (ciglesias).
|
||||
- Fix inserting tools removed from wxToolBar back into it (sbrowne).
|
||||
|
||||
|
||||
3.0.2: (released 2014-10-06)
|
||||
|
@@ -235,7 +235,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void ToBeDeleted() { m_toBeDeleted = true; }
|
||||
void ToBeDeleted(bool toBeDeleted = true) { m_toBeDeleted = toBeDeleted; }
|
||||
bool IsToBeDeleted() const { return m_toBeDeleted; }
|
||||
|
||||
private:
|
||||
@@ -561,8 +561,13 @@ WXDWORD wxToolBar::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
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
|
||||
// Realize() later
|
||||
InvalidateBestSize();
|
||||
|
Reference in New Issue
Block a user