+ // set ES_WANTRETURN ( like we do in BeginLabelEdit )
+ if(event.IsAllowed())
+ {
+ HWND hText = TreeView_GetEditControl(GetHwnd());
+ if(hText != NULL)
+ {
+ // MBN: if m_textCtrl already has an HWND, it is a stale
+ // pointer from a previous edit (because the user
+ // didn't modify the label before dismissing the control,
+ // and TVN_ENDLABELEDIT was not sent), so delete it
+ if(m_textCtrl && m_textCtrl->GetHWND() != 0)
+ DeleteTextCtrl();
+ if(!m_textCtrl)
+ m_textCtrl = new wxTextCtrl();
+ m_textCtrl->SetParent(this);
+ m_textCtrl->SetHWND((WXHWND)hText);
+ m_textCtrl->SubclassWin((WXHWND)hText);
+
+ // set wxTE_PROCESS_ENTER style for the text control to
+ // force it to process the Enter presses itself, otherwise
+ // they could be stolen from it by the dialog
+ // navigation code
+ m_textCtrl->SetWindowStyle(m_textCtrl->GetWindowStyle()
+ | wxTE_PROCESS_ENTER);
+ }
+ }