]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
Committing in .
[wxWidgets.git] / src / stc / stc.cpp
index bda10615e501e2fd396dc8fc2bc84a7aa6fcb48a..7ab2c32a0b46c4bda849946a99c4d6e4bbfbdead 100644 (file)
@@ -107,7 +107,7 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
     EVT_SET_FOCUS               (wxStyledTextCtrl::OnGainFocus)
     EVT_SYS_COLOUR_CHANGED      (wxStyledTextCtrl::OnSysColourChanged)
     EVT_ERASE_BACKGROUND        (wxStyledTextCtrl::OnEraseBackground)
-    EVT_MENU_RANGE              (-1, -1, wxStyledTextCtrl::OnMenu)
+    EVT_MENU_RANGE              (10, 16, wxStyledTextCtrl::OnMenu)
     EVT_LISTBOX_DCLICK          (-1, wxStyledTextCtrl::OnListBox)
 END_EVENT_TABLE()
 
@@ -115,8 +115,10 @@ END_EVENT_TABLE()
 IMPLEMENT_CLASS(wxStyledTextCtrl, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxStyledTextEvent, wxCommandEvent)
 
+#ifdef LINK_LEXERS
 // forces the linking of the lexer modules
-int Scintilla_LinkLexers();
+int wxForceScintillaLexers();
+#endif
 
 //----------------------------------------------------------------------
 // Constructor and Destructor
@@ -131,7 +133,9 @@ wxStyledTextCtrl::wxStyledTextCtrl(wxWindow *parent,
               style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN,
               wxDefaultValidator, name)
 {
-    Scintilla_LinkLexers();
+#ifdef LINK_LEXERS
+    wxForceScintillaLexers();
+#endif
     m_swx = new ScintillaWX(this);
     m_stopWatch.Start();
     m_lastKeyDownConsumed = FALSE;
@@ -951,7 +955,8 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
                      TextToFind  ft;
                      ft.chrg.cpMin = minPos;
                      ft.chrg.cpMax = maxPos;
-                     ft.lpstrText = (char*)(const char*)wx2stc(text);
+                     wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+                     ft.lpstrText = (char*)(const char*)buf;
 
                      return SendMsg(2150, flags, (long)&ft);
 }
@@ -1564,12 +1569,12 @@ void* wxStyledTextCtrl::CreateDocument() {
 
 // Extend life of document.
 void wxStyledTextCtrl::AddRefDocument(void* docPointer) {
-                           SendMsg(2376, (long)docPointer);
+                           SendMsg(2376, 0, (long)docPointer);
 }
 
 // Release a reference to the document, deleting document if it fades to black.
 void wxStyledTextCtrl::ReleaseDocument(void* docPointer) {
-                           SendMsg(2377, (long)docPointer);
+                           SendMsg(2377, 0, (long)docPointer);
 }
 
 // Get which document modification events are sent to the container.
@@ -1876,6 +1881,7 @@ void wxStyledTextCtrl::OnSize(wxSizeEvent& evt) {
 }
 
 void wxStyledTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) {
+    SetFocus();
     wxPoint pt = evt.GetPosition();
     m_swx->DoButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(),
                       evt.ShiftDown(), evt.ControlDown(), evt.AltDown());
@@ -1910,7 +1916,8 @@ void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
     m_swx->DoMouseWheel(evt.GetWheelRotation(),
                         evt.GetWheelDelta(),
                         evt.GetLinesPerAction(),
-                        evt.ControlDown());
+                        evt.ControlDown(),
+                        evt.IsPageScroll());
 }