]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Updated to Scintilla from 1.45 to 1.47
[wxWidgets.git] / src / msw / textctrl.cpp
index 8d172ea35f24bcfe4b6c5e18af705aed0307064f..882a6f60e9fad54fe7799e3f7a48b7673f302c31 100644 (file)
@@ -362,6 +362,10 @@ void wxTextCtrl::AdoptAttributesFromHWND()
         m_windowStyle |= wxTE_READONLY;
     if (style & ES_WANTRETURN)
         m_windowStyle |= wxTE_PROCESS_ENTER;
+    if (style & ES_CENTER)
+        m_windowStyle |= wxTE_CENTRE;
+    if (style & ES_RIGHT)
+        m_windowStyle |= wxTE_RIGHT;
 }
 
 WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
@@ -410,6 +414,12 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
     if ( style & wxTE_NOHIDESEL )
         msStyle |= ES_NOHIDESEL;
 
+    if ( style & wxTE_CENTRE )
+        msStyle |= ES_CENTER;
+
+    if ( style & wxTE_RIGHT )
+        msStyle |= ES_RIGHT;
+
     return msStyle;
 }
 
@@ -1189,24 +1199,42 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* pMsg)
         }
         else // no Alt
         {
-            if ( wxIsCtrlDown() )
-            {
-                switch ( vkey )
-                {
-                    case 'C':
-                    case 'V':
-                    case 'X':
-                    case VK_INSERT:
-                    case VK_DELETE:
-                    case VK_HOME:
-                    case VK_END:
-                        return FALSE;
-                }
-            }
-            else if ( wxIsShiftDown() )
+            // we want to process some Ctrl-foo and Shift-bar but no key
+            // combinations without either Ctrl or Shift nor with both of them
+            // pressed
+            const int ctrl = wxIsCtrlDown(),
+                      shift = wxIsShiftDown();
+            switch ( ctrl + shift )
             {
-                if ( vkey == VK_INSERT || vkey == VK_DELETE )
-                    return FALSE;
+                default:
+                    wxFAIL_MSG( _T("how many modifiers have we got?") );
+                    // fall through
+
+                case 0:
+                case 2:
+                    break;
+
+                case 1:
+                    // either Ctrl or Shift pressed
+                    if ( ctrl )
+                    {
+                        switch ( vkey )
+                        {
+                            case 'C':
+                            case 'V':
+                            case 'X':
+                            case VK_INSERT:
+                            case VK_DELETE:
+                            case VK_HOME:
+                            case VK_END:
+                                return FALSE;
+                        }
+                    }
+                    else // Shift is pressed
+                    {
+                        if ( vkey == VK_INSERT || vkey == VK_DELETE )
+                            return FALSE;
+                    }
             }
         }
     }