]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Upgrade bundled zlib to 1.2.8.
[wxWidgets.git] / src / msw / textctrl.cpp
index fcdb1ab1110f1daf3d2f83ada7bcaf5bb4aa62ee..d2e448cc058a74c9d27baab0198ebc8e0d70f055 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -511,9 +510,23 @@ bool wxTextCtrl::MSWCreateText(const wxString& value,
         // classic mode, i.e. without themes. Also, the margin can be reset to
         // 0 easily by calling SetMargins() explicitly but setting it to the
         // default value is not currently supported.
-        ::SendMessage(GetHwnd(), EM_SETMARGINS,
-                      EC_LEFTMARGIN | EC_RIGHTMARGIN,
-                      MAKELPARAM(EC_USEFONTINFO, EC_USEFONTINFO));
+        //
+        // Finally, notice that EC_USEFONTINFO is used differently for plain
+        // and rich text controls.
+        WPARAM wParam;
+        LPARAM lParam;
+        if ( IsRich() )
+        {
+            wParam = EC_USEFONTINFO;
+            lParam = 0;
+        }
+        else // plain EDIT, EC_USEFONTINFO is used in lParam with them.
+        {
+            wParam = EC_LEFTMARGIN | EC_RIGHTMARGIN;
+            lParam = MAKELPARAM(EC_USEFONTINFO, EC_USEFONTINFO);
+        }
+
+        ::SendMessage(GetHwnd(), EM_SETMARGINS, wParam, lParam);
     }
 #endif // !__WXWINCE__
 
@@ -1009,7 +1022,7 @@ wxTextCtrl::StreamOut(wxFontEncoding encoding, bool selectionOnly) const
 
     EDITSTREAM eds;
     wxZeroMemory(eds);
-    eds.dwCookie = (DWORD)&data;
+    eds.dwCookie = (DWORD_PTR)&data;
     eds.pfnCallback = wxRichEditStreamOut;
 
     ::SendMessage
@@ -1849,7 +1862,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
     {
         case WXK_RETURN:
             {
-                wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
+                wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId);
                 InitCommandEvent(event);
                 event.SetString(GetValue());
                 if ( HandleWindowEvent(event) )
@@ -2052,7 +2065,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
             // the text size limit has been hit -- try to increase it
             if ( !AdjustSpaceLimit() )
             {
-                wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, m_windowId);
+                wxCommandEvent event(wxEVT_TEXT_MAXLEN, m_windowId);
                 InitCommandEvent(event);
                 event.SetString(GetValue());
                 ProcessCommand(event);