Set both left and right wxTextEntry margins in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jan 2013 02:08:55 +0000 (02:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jan 2013 02:08:55 +0000 (02:08 +0000)
Use the horizontal margin argument of SetMargins() to set both left and right
margins in wxMSW and not just the left one.

See #14958.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textentry.cpp

index 67e03be15387a4f39540cca44cf27c98fb0604dd..a91e8f33cab408726b95f3b007153c24424728a0 100644 (file)
@@ -956,9 +956,12 @@ bool wxTextEntry::DoSetMargins(const wxPoint& margins)
 
     if ( margins.x != -1 )
     {
-        // left margin
+        // Set both horizontal margins to the given value, we don't distinguish
+        // between left and right margin at wx API level and it seems to be
+        // better to change both of them than only left one.
         ::SendMessage(GetEditHwnd(), EM_SETMARGINS,
-                      EC_LEFTMARGIN, MAKELONG(margins.x, 0));
+                      EC_LEFTMARGIN | EC_RIGHTMARGIN,
+                      MAKELONG(margins.x, margins.x));
     }
 
     if ( margins.y != -1 )