]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
added the static function GetLabelText() to wxStaticText which was mentioned in the...
[wxWidgets.git] / src / stc / stc.cpp
index bc54bf966ca796c45430a192f3600b658e851c75..dda75ca9d36af95fab7edb6d8adf564aee13fe03 100644 (file)
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#if wxUSE_STC
+
+#include "wx/stc/stc.h"
+#include "wx/stc/private.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/wx.h"
+#endif // WX_PRECOMP
+
 #include <ctype.h>
 
-#include "wx/wx.h"
 #include "wx/tokenzr.h"
 #include "wx/mstream.h"
 #include "wx/image.h"
 #include "wx/file.h"
 
-#include "wx/stc/stc.h"
 #include "ScintillaWX.h"
 
 //----------------------------------------------------------------------
@@ -158,9 +172,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent,
                               long style,
                               const wxString& name)
 {
-#ifdef __WXMAC__
     style |= wxVSCROLL | wxHSCROLL;
-#endif
     if (!wxControl::Create(parent, id, pos, size,
                            style | wxWANTS_CHARS | wxCLIP_CHILDREN,
                            wxDefaultValidator, name))
@@ -179,7 +191,7 @@ bool wxStyledTextCtrl::Create(wxWindow *parent,
     SetCodePage(wxSTC_CP_UTF8);
 #endif
 
-    SetBestFittingSize(size);
+    SetInitialSize(size);
 
     // Reduces flicker on GTK+/X11
     SetBackgroundStyle(wxBG_STYLE_CUSTOM);
@@ -2553,7 +2565,7 @@ void wxStyledTextCtrl::SetLexerLanguage(const wxString& language) {
 
 // Retrieve a 'property' value previously set with SetProperty.
 wxString wxStyledTextCtrl::GetProperty(const wxString& key) {
-         int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), (long)NULL);
+         int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), 0);
          if (!len) return wxEmptyString;
 
          wxMemoryBuffer mbuf(len+1);
@@ -2567,7 +2579,7 @@ wxString wxStyledTextCtrl::GetProperty(const wxString& key) {
 // Retrieve a 'property' value previously set with SetProperty,
 // with '$()' variable replacement on returned buffer.
 wxString wxStyledTextCtrl::GetPropertyExpanded(const wxString& key) {
-         int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), (long)NULL);
+         int len = SendMsg(SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2stc(key), 0);
          if (!len) return wxEmptyString;
 
          wxMemoryBuffer mbuf(len+1);
@@ -3118,6 +3130,13 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
 #endif
     bool skip = ((ctrl || alt) && ! (ctrl && alt));
 
+#if wxUSE_UNICODE
+    // apparently if we don't do this, Unicode keys pressed after non-char
+    // ASCII ones (e.g. Enter, Tab) are not taken into account (patch 1615989)
+    if (m_lastKeyDownConsumed && evt.GetUnicodeKey() > 255)
+        m_lastKeyDownConsumed = false;
+#endif
+
     if (!m_lastKeyDownConsumed && !skip) {
 #if wxUSE_UNICODE
         int key = evt.GetUnicodeKey();
@@ -3294,10 +3313,18 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
         evt.SetEventType(wxEVT_STC_PAINTED);
         break;
 
+    case SCN_AUTOCSELECTION:
+        evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION);
+        evt.SetListType(scn.listType);
+        SetEventText(evt, scn.text, strlen(scn.text));
+        evt.SetPosition(scn.lParam);
+        break;
+        
     case SCN_USERLISTSELECTION:
         evt.SetEventType(wxEVT_STC_USERLISTSELECTION);
         evt.SetListType(scn.listType);
         SetEventText(evt, scn.text, strlen(scn.text));
+        evt.SetPosition(scn.lParam);
         break;
 
     case SCN_URIDROPPED:
@@ -3332,11 +3359,7 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
     case SCN_CALLTIPCLICK:
         evt.SetEventType(wxEVT_STC_CALLTIP_CLICK);
         break;
-
-    case SCN_AUTOCSELECTION:
-        evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION);
-        break;
-        
+       
     default:
         return;
     }
@@ -3413,11 +3436,4 @@ wxStyledTextEvent::wxStyledTextEvent(const wxStyledTextEvent& event):
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
 
-
-
-
-
-
-
-
-
+#endif // wxUSE_STC