]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
prevent deadlock in wxCSConv::DoCreate if it fails for wxConvLocal -- ugly but works
[wxWidgets.git] / src / stc / stc.cpp
index 829cb32e6173407be04e8cc4f1bdda9cda484b51..ab42de2dfe374631446818f9d109e8cdc3cd0748 100644 (file)
@@ -136,11 +136,24 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
                                    const wxPoint& pos,
                                    const wxSize& size,
                                    long style,
-                                   const wxString& name) :
-    wxControl(parent, id, pos, size,
-              style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN,
-              wxDefaultValidator, name)
+                                   const wxString& name)
 {
+    m_swx = NULL;
+    Create(parent, id, pos, size, style, name);
+}
+
+
+void wxStyledTextCtrl::Create(wxWindow *parent,
+                                   wxWindowID id,
+                                   const wxPoint& pos,
+                                   const wxSize& size,
+                                   long style,
+                                   const wxString& name)
+{
+    wxControl::Create(parent, id, pos, size,
+              style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN,
+              wxDefaultValidator, name);
+
 #ifdef LINK_LEXERS
     Scintilla_LinkLexers();
 #endif
@@ -2117,9 +2130,9 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
 
     bool success = file.Write(GetText(), *wxConvCurrent);
 
-    if (success) {
+    if (success)
         SetSavePoint();
-    }
+
     return success;
 }
 
@@ -2136,7 +2149,6 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 #else
         wxString buffer;
 #endif
-        
         off_t len = file.Length();
         if (len > 0)
         {
@@ -2164,6 +2176,18 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 }
 
 
+#if wxUSE_DRAG_AND_DROP
+wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { 
+        return m_swx->DoDragOver(x, y, def); 
+} 
+
+
+bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) { 
+    return m_swx->DoDropText(x, y, data);
+}
+#endif
+
+
 //----------------------------------------------------------------------
 // Event handlers
 
@@ -2190,8 +2214,10 @@ void wxStyledTextCtrl::OnScroll(wxScrollEvent& evt) {
 }
 
 void wxStyledTextCtrl::OnSize(wxSizeEvent& WXUNUSED(evt)) {
-    wxSize sz = GetClientSize();
-    m_swx->DoSize(sz.x, sz.y);
+    if (m_swx) {
+        wxSize sz = GetClientSize();
+        m_swx->DoSize(sz.x, sz.y);
+    }
 }
 
 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) {