]> git.saurik.com Git - wxWidgets.git/commitdiff
Patch #826420, and also adapted to new SWIG
authorRobin Dunn <robin@alldunn.com>
Fri, 31 Oct 2003 01:12:25 +0000 (01:12 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 31 Oct 2003 01:12:25 +0000 (01:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/include/wx/stc/stc.h
contrib/src/stc/stc.cpp
contrib/src/stc/stc.cpp.in
contrib/src/stc/stc.h.in
include/wx/stc/stc.h
src/stc/stc.cpp
src/stc/stc.cpp.in
src/stc/stc.h.in

index b02b934ccec84d974d76eaf5fc24086ffe898dbc..c6788b84bf7a0b6a26a5aafaa9e7a2e29502270d 100644 (file)
@@ -24,7 +24,7 @@
 #include <wx/wx.h>
 #include <wx/dnd.h>
 
-#ifndef SWIG
+
 #ifdef WXMAKINGDLL_STC
     #define WXDLLIMPEXP_STC WXEXPORT
 #elif defined(WXUSINGDLL)
@@ -32,7 +32,6 @@
 #else // not making nor using DLL
     #define WXDLLIMPEXP_STC
 #endif
-#endif // SWIG
 
 
 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
@@ -1141,31 +1140,34 @@ class  WXDLLIMPEXP_STC wxStyledTextEvent;
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
-#else
-class wxStyledTextCtrl : public wxControl {
-#endif
 public:
 
 #ifdef SWIG
+    %addtofunc wxStyledTextCtrl   "self._setOORInfo(self)"
+    %addtofunc wxStyledTextCtrl() ""
+
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
-    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
-
+    %name(PreStyledTextCtrl) wxStyledTextCtrl();
+    
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxSTCNameStr);
+    wxStyledTextCtrl() { m_swx = NULL; }
+    ~wxStyledTextCtrl();
+    
 #endif
 
+    void Create(wxWindow *parent, wxWindowID id,
+                     const wxPoint& pos = wxDefaultPosition,
+                     const wxSize& size = wxDefaultSize, long style = 0,
+                     const wxString& name = wxSTCNameStr);
 
-#ifndef SWIG
-    ~wxStyledTextCtrl();
-#endif
 
 //----------------------------------------------------------------------
 // BEGIN generated section.  The following code is automatically generated
@@ -2344,11 +2346,7 @@ protected:
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
-#else
-class wxStyledTextEvent : public wxCommandEvent {
-#endif
 public:
     wxStyledTextEvent(wxEventType commandType=0, int id=0);
 #ifndef SWIG
index c6438a351e05f84d8a430bd177ab31360d6dfc5f..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
@@ -2201,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) {
index 2b531a6f5416163d3d721017ba98d72068ad3d64..4cc177306fdeb4d35c55fb4386947b63d120edd8 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
@@ -406,8 +419,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) {
index 9ea0102760f2341431c5064f0a97505c4a13a638..514357984a9868d959c6e897128aae1f979223d2 100644 (file)
@@ -24,7 +24,7 @@
 #include <wx/wx.h>
 #include <wx/dnd.h>
 
-#ifndef SWIG
+
 #ifdef WXMAKINGDLL_STC
     #define WXDLLIMPEXP_STC WXEXPORT
 #elif defined(WXUSINGDLL)
@@ -32,7 +32,6 @@
 #else // not making nor using DLL
     #define WXDLLIMPEXP_STC
 #endif
-#endif // SWIG
 
 
 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
@@ -80,31 +79,34 @@ class  WXDLLIMPEXP_STC wxStyledTextEvent;
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
-#else
-class wxStyledTextCtrl : public wxControl {
-#endif
 public:
 
 #ifdef SWIG
+    %%addtofunc wxStyledTextCtrl   "self._setOORInfo(self)"
+    %%addtofunc wxStyledTextCtrl() ""
+
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
-    %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
-
+    %%name(PreStyledTextCtrl) wxStyledTextCtrl();
+    
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxSTCNameStr);
+    wxStyledTextCtrl() { m_swx = NULL; }
+    ~wxStyledTextCtrl();
+    
 #endif
 
+    void Create(wxWindow *parent, wxWindowID id,
+                     const wxPoint& pos = wxDefaultPosition,
+                     const wxSize& size = wxDefaultSize, long style = 0,
+                     const wxString& name = wxSTCNameStr);
 
-#ifndef SWIG
-    ~wxStyledTextCtrl();
-#endif
 
 //----------------------------------------------------------------------
 // BEGIN generated section.  The following code is automatically generated
@@ -260,11 +262,7 @@ protected:
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
-#else
-class wxStyledTextEvent : public wxCommandEvent {
-#endif
 public:
     wxStyledTextEvent(wxEventType commandType=0, int id=0);
 #ifndef SWIG
index b02b934ccec84d974d76eaf5fc24086ffe898dbc..c6788b84bf7a0b6a26a5aafaa9e7a2e29502270d 100644 (file)
@@ -24,7 +24,7 @@
 #include <wx/wx.h>
 #include <wx/dnd.h>
 
-#ifndef SWIG
+
 #ifdef WXMAKINGDLL_STC
     #define WXDLLIMPEXP_STC WXEXPORT
 #elif defined(WXUSINGDLL)
@@ -32,7 +32,6 @@
 #else // not making nor using DLL
     #define WXDLLIMPEXP_STC
 #endif
-#endif // SWIG
 
 
 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
@@ -1141,31 +1140,34 @@ class  WXDLLIMPEXP_STC wxStyledTextEvent;
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
-#else
-class wxStyledTextCtrl : public wxControl {
-#endif
 public:
 
 #ifdef SWIG
+    %addtofunc wxStyledTextCtrl   "self._setOORInfo(self)"
+    %addtofunc wxStyledTextCtrl() ""
+
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
-    %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
-
+    %name(PreStyledTextCtrl) wxStyledTextCtrl();
+    
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxSTCNameStr);
+    wxStyledTextCtrl() { m_swx = NULL; }
+    ~wxStyledTextCtrl();
+    
 #endif
 
+    void Create(wxWindow *parent, wxWindowID id,
+                     const wxPoint& pos = wxDefaultPosition,
+                     const wxSize& size = wxDefaultSize, long style = 0,
+                     const wxString& name = wxSTCNameStr);
 
-#ifndef SWIG
-    ~wxStyledTextCtrl();
-#endif
 
 //----------------------------------------------------------------------
 // BEGIN generated section.  The following code is automatically generated
@@ -2344,11 +2346,7 @@ protected:
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
-#else
-class wxStyledTextEvent : public wxCommandEvent {
-#endif
 public:
     wxStyledTextEvent(wxEventType commandType=0, int id=0);
 #ifndef SWIG
index c6438a351e05f84d8a430bd177ab31360d6dfc5f..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
@@ -2201,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) {
index 2b531a6f5416163d3d721017ba98d72068ad3d64..4cc177306fdeb4d35c55fb4386947b63d120edd8 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
@@ -406,8 +419,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) {
index 9ea0102760f2341431c5064f0a97505c4a13a638..514357984a9868d959c6e897128aae1f979223d2 100644 (file)
@@ -24,7 +24,7 @@
 #include <wx/wx.h>
 #include <wx/dnd.h>
 
-#ifndef SWIG
+
 #ifdef WXMAKINGDLL_STC
     #define WXDLLIMPEXP_STC WXEXPORT
 #elif defined(WXUSINGDLL)
@@ -32,7 +32,6 @@
 #else // not making nor using DLL
     #define WXDLLIMPEXP_STC
 #endif
-#endif // SWIG
 
 
 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
@@ -80,31 +79,34 @@ class  WXDLLIMPEXP_STC wxStyledTextEvent;
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
-#else
-class wxStyledTextCtrl : public wxControl {
-#endif
 public:
 
 #ifdef SWIG
+    %%addtofunc wxStyledTextCtrl   "self._setOORInfo(self)"
+    %%addtofunc wxStyledTextCtrl() ""
+
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
-    %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
-
+    %%name(PreStyledTextCtrl) wxStyledTextCtrl();
+    
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxSTCNameStr);
+    wxStyledTextCtrl() { m_swx = NULL; }
+    ~wxStyledTextCtrl();
+    
 #endif
 
+    void Create(wxWindow *parent, wxWindowID id,
+                     const wxPoint& pos = wxDefaultPosition,
+                     const wxSize& size = wxDefaultSize, long style = 0,
+                     const wxString& name = wxSTCNameStr);
 
-#ifndef SWIG
-    ~wxStyledTextCtrl();
-#endif
 
 //----------------------------------------------------------------------
 // BEGIN generated section.  The following code is automatically generated
@@ -260,11 +262,7 @@ protected:
 
 //----------------------------------------------------------------------
 
-#ifndef SWIG
 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
-#else
-class wxStyledTextEvent : public wxCommandEvent {
-#endif
 public:
     wxStyledTextEvent(wxEventType commandType=0, int id=0);
 #ifndef SWIG