如何解决将Inno Setup许可证备忘录切换到RTL模式
我正在创建具有多种语言的安装程序, 有些语言需要RTL指导才能自然显示。 这是我用于许可证页面的代码:
LicenseMemo := TNewMemo.Create(WizardForm);
with LicenseMemo do
begin
Parent := WizardForm.LicensePage;
Left := ScaleX(0);
Top := ScaleY(50);
Width := ScaleX(520);
Height := ScaleY(210);
Color := TColor($d3d3d3);
Font.Color := clBlack;
ScrollBars := ssVertical;
Text := WizardForm.LicenseMemo.Text;
LicenseMemo.Font.Size := 12
ReadOnly := True;
end;
我知道我可以通过向RightToLeft=yes
添加[LangOptions]
使程序完全RTL。但这使程序看起来很糟糕– Ii仅需要RTL才能访问许可证页面。有人可以帮忙吗?我将RTF文件用于许可证页面。
解决方法
使用TRichEditViewer
并将WS_EX_LAYOUTRTL
添加到其GWL_EXSTYLE
:
const
GWL_EXSTYLE = -20;
WS_EX_LAYOUTRTL = $400000;
function GetWindowLong(hWnd: THandle; Index: Integer): LongInt;
external 'GetWindowLongW@User32.dll stdcall';
function SetWindowLong(hWnd: THandle; Index: Integer; NewLong: LongInt): LongInt;
external 'SetWindowLongW@user32.dll stdcall';
SetWindowLong(
RichEditViewer.Handle,GWL_EXSTYLE,GetWindowLong(RichEditViewer.Handle,GWL_EXSTYLE) or WS_EX_LAYOUTRTL);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。