#define TV_FIRST 0x1100
#endif
+#ifndef TVS_CHECKBOXES
+ #define TVS_CHECKBOXES 0x0100
+#endif
+
// old headers might miss these messages (comctl32.dll 4.71+ only)
#ifndef TVM_SETBKCOLOR
#define TVM_SETBKCOLOR (TV_FIRST + 29)
tvht.pt.x = x;
tvht.pt.y = y;
- return TreeView_HitTest(hwndTV, &tvht);
+ // TreeView_HitTest() doesn't do the right cast in mingw32 headers
+ return (HTREEITEM)TreeView_HitTest(hwndTV, &tvht);
}
// ----------------------------------------------------------------------------
!defined( __WATCOMC__ ) && \
(!defined(__VISUALC__) || (__VISUALC__ > 1010))
-#ifndef TVS_CHECKBOXES
-#define TVS_CHECKBOXES 0x0100
-#endif
-
// we emulate the multiple selection tree controls by using checkboxes: set
// up the image list we need for this if we do have multiple selections
if ( m_windowStyle & wxTR_MULTIPLE )
wxTextCtrl* wxTreeCtrl::GetEditControl() const
{
+ // normally, we could try to do something like this to return something
+ // even when the editing was started by the user and not by calling
+ // EditLabel() - but as nobody has asked for this so far and there might be
+ // problems in the code below, I leave it disabled for now (VZ)
+#if 0
+ if ( !m_textCtrl )
+ {
+ HWND hwndText = TreeView_GetEditControl(GetHwnd());
+ if ( hwndText )
+ {
+ m_textCtrl = new wxTextCtrl(this, -1);
+ m_textCtrl->Hide();
+ m_textCtrl->SetHWND((WXHWND)hwndText);
+ }
+ //else: not editing label right now
+ }
+#endif // 0
+
return m_textCtrl;
}
{
wxASSERT( textControlClass->IsKindOf(CLASSINFO(wxTextCtrl)) );
+ DeleteTextCtrl();
+
HWND hWnd = (HWND) TreeView_EditLabel(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item);
// this is not an error - the TVN_BEGINLABELEDIT handler might have
return NULL;
}
- DeleteTextCtrl();
-
m_textCtrl = (wxTextCtrl *)textControlClass->CreateObject();
m_textCtrl->SetHWND((WXHWND)hWnd);
m_textCtrl->SubclassWin((WXHWND)hWnd);