Applied patch [ 651287 ] adds missing wxTreeCtrl::GetEditControl

Peter Stieber


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-12-11 17:51:07 +00:00
parent 9c2a975b3c
commit f8a1c24cca
2 changed files with 28 additions and 2 deletions

View File

@@ -427,6 +427,8 @@ void wxTreeTextCtrl::Finish()
{
if ( !m_finished )
{
m_owner->ResetTextControl();
wxPendingDelete.Append(this);
m_finished = TRUE;
@@ -755,6 +757,7 @@ void wxGenericTreeCtrl::Init()
m_dragCount = 0;
m_isDragging = FALSE;
m_dropTarget = m_oldSelection = (wxGenericTreeItem *)NULL;
m_textCtrl = NULL;
m_renameTimer = NULL;
m_findTimer = NULL;
@@ -1265,6 +1268,12 @@ wxTreeItemId wxGenericTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
return wxTreeItemId();
}
// called by wxTextTreeCtrl when it marks itself for deletion
void wxGenericTreeCtrl::ResetTextControl()
{
m_textCtrl = NULL;
}
// find the first item starting with the given prefix after the given item
wxTreeItemId wxGenericTreeCtrl::FindItem(const wxTreeItemId& idParent,
const wxString& prefixOrig) const
@@ -2809,9 +2818,17 @@ void wxGenericTreeCtrl::Edit( const wxTreeItemId& item )
if ( m_dirty )
wxYieldIfNeeded();
wxTreeTextCtrl *text = new wxTreeTextCtrl(this, itemEdit);
m_textCtrl = new wxTreeTextCtrl(this, itemEdit);
text->SetFocus();
m_textCtrl->SetFocus();
}
// returns a pointer to the text edit control if the item is being
// edited, NULL otherwise (it's assumed that no more than one item may
// be edited simultaneously)
wxTextCtrl* wxGenericTreeCtrl::GetEditControl() const
{
return m_textCtrl;
}
bool wxGenericTreeCtrl::OnRenameAccept(wxGenericTreeItem *item,