]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
info about removal of wxhtml.rc
[wxWidgets.git] / src / msw / textctrl.cpp
index 12716ffeb5165b8e13154da8b699a7e2f0b35aaa..43ca7b27ef2755eede5f3e286b6e707dd3d33d46 100644 (file)
@@ -844,6 +844,12 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
 
 bool wxTextCtrl::IsEditable() const
 {
+    // strangely enough, we may be called before the control is created: our
+    // own Create() calls MSWGetStyle() which calls AcceptsFocus() which calls
+    // us
+    if ( !m_hWnd )
+        return TRUE;
+
     long style = ::GetWindowLong(GetHwnd(), GWL_STYLE);
 
     return (style & ES_READONLY) == 0;
@@ -1483,7 +1489,6 @@ bool wxTextCtrl::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *re
                 ::SetCursor(GetHcursorOf(wxCursor(wxCURSOR_HAND)));
                 *result = TRUE;
                 break;
-
             case WM_MOUSEMOVE:
             case WM_LBUTTONDOWN:
             case WM_LBUTTONUP: