Destroy the in-place edit control in wxGenericListCtrl dtor.
If the in-place text control was still alive when wxGenericListCtrl was destroyed, it resulted in asserts from wxWindow dtor about child windows still being alive, so explicitly destroy it from wxListMainWindow dtor. As this required a slightly different behaviour from wxListTextCtrlWrapper:: EndEdit(), replace its bool argument with an enum one which can take more than 2 values. Not using bool values when calling it also made the code more clear. Finally, added a unit test verifying that the in-place control is indeed destroyed correctly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -402,7 +402,17 @@ public:
|
||||
|
||||
wxTextCtrl *GetText() const { return m_text; }
|
||||
|
||||
void EndEdit( bool discardChanges );
|
||||
// Different reasons for calling EndEdit():
|
||||
//
|
||||
// It was called because:
|
||||
enum EndReason
|
||||
{
|
||||
End_Accept, // user has accepted the changes.
|
||||
End_Discard, // user has cancelled editing.
|
||||
End_Destroy // the entire control is being destroyed.
|
||||
};
|
||||
|
||||
void EndEdit(EndReason reason);
|
||||
|
||||
protected:
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
Reference in New Issue
Block a user