- HWND hWnd = (HWND) ListView_EditLabel((HWND) GetHWND(), (int) item);
- m_textCtrl.SetHWND((WXHWND) hWnd);
- return m_textCtrl;
+ wxASSERT( (textControlClass->IsKindOf(CLASSINFO(wxTextCtrl))) );
+
+ HWND hWnd = (HWND) ListView_EditLabel((HWND) GetHWND(), item);
+
+ if (m_textCtrl)
+ {
+ m_textCtrl->UnsubclassWin();
+ m_textCtrl->SetHWND(0);
+ delete m_textCtrl;
+ m_textCtrl = NULL;
+ }
+
+ m_textCtrl = (wxTextCtrl*) textControlClass->CreateObject();
+ m_textCtrl->SetHWND((WXHWND) hWnd);
+ m_textCtrl->SubclassWin((WXHWND) hWnd);
+
+ return m_textCtrl;
+}
+
+// End label editing, optionally cancelling the edit
+bool wxListCtrl::EndEditLabel(bool cancel)
+{
+ wxASSERT( FALSE);
+
+/* I don't know how to implement this: there's no such macro as ListView_EndEditLabelNow.
+ * ???
+ bool success = (ListView_EndEditLabelNow((HWND) GetHWND(), cancel) != 0);
+
+ if (m_textCtrl)
+ {
+ m_textCtrl->UnsubclassWin();
+ m_textCtrl->SetHWND(0);
+ delete m_textCtrl;
+ m_textCtrl = NULL;
+ }
+ return success;
+*/
+ return FALSE;