return true from IsBeingDeleted() if any of the parent windows is marked for destruction too (see #9867)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -385,6 +385,8 @@ All (GUI):
|
|||||||
- Show busy cursor in wxLaunchDefaultBrowser and add wxBROWSER_NOBUSYCURSOR.
|
- Show busy cursor in wxLaunchDefaultBrowser and add wxBROWSER_NOBUSYCURSOR.
|
||||||
- Added wxFlexGridSizer::Is{Row,Col}Growable() (Marcin Wojdyr).
|
- Added wxFlexGridSizer::Is{Row,Col}Growable() (Marcin Wojdyr).
|
||||||
- Added "enabled" and "hidden" attributes to radio box items in XRC.
|
- Added "enabled" and "hidden" attributes to radio box items in XRC.
|
||||||
|
- wxWindow::IsBeingDeleted() now returns true not only if the window itself is
|
||||||
|
marked for destruction but also if any of its parent windows are.
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -199,7 +199,7 @@ public:
|
|||||||
bool DestroyChildren();
|
bool DestroyChildren();
|
||||||
|
|
||||||
// is the window being deleted?
|
// is the window being deleted?
|
||||||
bool IsBeingDeleted() const { return m_isBeingDeleted; }
|
bool IsBeingDeleted() const;
|
||||||
|
|
||||||
// window attributes
|
// window attributes
|
||||||
// -----------------
|
// -----------------
|
||||||
|
@@ -439,6 +439,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void DestroyChildren();
|
virtual void DestroyChildren();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns true if this window is in process of being destroyed.
|
||||||
|
|
||||||
|
The top level windows are not deleted immediately but are rather
|
||||||
|
scheduled for later destruction to give them time to process any
|
||||||
|
pending messages, see Destroy() description.
|
||||||
|
|
||||||
|
This function returns @true if this window, or one of its parent
|
||||||
|
windows, is scheduled for destruction and can be useful to avoid
|
||||||
|
manipulating it as it's usually useless to do something with a window
|
||||||
|
which is on the point of disappearing anyhow.
|
||||||
|
*/
|
||||||
|
bool IsBeingDeleted() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Disables the window. Same as @ref Enable() Enable(@false).
|
Disables the window. Same as @ref Enable() Enable(@false).
|
||||||
|
|
||||||
|
@@ -379,6 +379,12 @@ wxWindowBase::~wxWindowBase()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxWindowBase::IsBeingDeleted() const
|
||||||
|
{
|
||||||
|
return m_isBeingDeleted ||
|
||||||
|
(!IsTopLevel() && m_parent && m_parent->IsBeingDeleted());
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowBase::SendDestroyEvent()
|
void wxWindowBase::SendDestroyEvent()
|
||||||
{
|
{
|
||||||
wxWindowDestroyEvent event;
|
wxWindowDestroyEvent event;
|
||||||
|
Reference in New Issue
Block a user