Set margins on creation correctly for wxTE_RICH[2] wxTextCtrl in wxMSW.
In spite of the MSDN documentation, EC_USEFONTINFO can't be used in lParam with rich edit controls, so pass it in wParam for them. Closes #14598. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -511,9 +511,23 @@ bool wxTextCtrl::MSWCreateText(const wxString& value,
|
|||||||
// classic mode, i.e. without themes. Also, the margin can be reset to
|
// classic mode, i.e. without themes. Also, the margin can be reset to
|
||||||
// 0 easily by calling SetMargins() explicitly but setting it to the
|
// 0 easily by calling SetMargins() explicitly but setting it to the
|
||||||
// default value is not currently supported.
|
// default value is not currently supported.
|
||||||
::SendMessage(GetHwnd(), EM_SETMARGINS,
|
//
|
||||||
EC_LEFTMARGIN | EC_RIGHTMARGIN,
|
// Finally, notice that EC_USEFONTINFO is used differently for plain
|
||||||
MAKELPARAM(EC_USEFONTINFO, EC_USEFONTINFO));
|
// 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__
|
#endif // !__WXWINCE__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user