{"action":"opened","issue":{"url":"https://api.github.com/repos/jrsoftware/issrc/issues/201","labels_url":"https://api.github.com/repos/jrsoftware/issrc/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/jrsoftware/issrc/issues/201/comments","events_url":"https://api.github.com/repos/jrsoftware/issrc/issues/201/events","html_url":"https://github.com/jrsoftware/issrc/issues/201","id":128512200,"number":201,"title":"[Feature Request] Right To Left Layout for Arabic Language","user":{"login":"Motaz-Alnuweiri","id":4532392,"avatar_url":"https://avatars.githubusercontent.com/u/4532392?v=3","gravatar_id":"","url":"https://api.github.com/users/Motaz-Alnuweiri","html_url":"https://github.com/Motaz-Alnuweiri","followers_url":"https://api.github.com/users/Motaz-Alnuweiri/followers","following_url":"https://api.github.com/users/Motaz-Alnuweiri/following{/other_user}","gists_url":"https://api.github.com/users/Motaz-Alnuweiri/gists{/gist_id}","starred_url":"https://api.github.com/users/Motaz-Alnuweiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Motaz-Alnuweiri/subscriptions","organizations_url":"https://api.github.com/users/Motaz-Alnuweiri/orgs","repos_url":"https://api.github.com/users/Motaz-Alnuweiri/repos","events_url":"https://api.github.com/users/Motaz-Alnuweiri/events{/privacy}","received_events_url":"https://api.github.com/users/Motaz-Alnuweiri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-25T11:03:41Z","updated_at":"2016-01-25T11:03:41Z","closed_at":null,"body":"### Hello :)\r\n\r\nI would like to request this feature to make Setup windows right to left as in Arabic version of the Windows itself, I did it via Windows APIs but I can't access all windows and I think it's best to add it to Setup by default.\r\n\r\n#### Problem\r\nIn Arabic translations file I added `RightToLeft = Yes`:\r\n```\r\n[LangOptions]\r\n...\r\nRightToLeft=yes\r\n```\r\nand the Setup windows will look like this:\r\n![Old Right To Left Layout Image](http://i1297.photobucket.com/albums/ag34/MotazNew/Inno%20Setup/1_zpsj2xg5lho.jpg)\r\n\r\n#### Solution\r\nI wrote a code to make the windows as it should be in Arabic:\r\n```pascal\r\n[Code]\r\n// Author: Motaz Alnuweiri\r\n// Copyright (C) 2016 for Motaz Alnuweiri.\r\n\r\n#ifdef UNICODE\r\n  #define AW \"W\"\r\n#else\r\n  #define AW \"A\"\r\n#endif\r\n\r\n// Windows APIs to Set ExStyle Layout\r\nfunction SetWindowLong(HWND: HWND; nIndex: Integer; dwNewLong: longint): HWND;\r\n  external 'SetWindowLong{#AW}@user32.dll stdcall';\r\nfunction GetWindowLong(HWND: HWND; nIndex: Integer): longint;\r\n  external 'GetWindowLong{#AW}@user32.dll stdcall';\r\n\r\nconst\r\n  // Windows ExStyle (nIndex)\r\n  // URL: https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396\r\n  GWL_EXSTYLE = -20;\r\n  WS_EX_LAYOUTRTL = $00400000;\r\n  WS_EX_NOINHERITLAYOUT = $00100000;\r\n  WS_EX_RIGHT = $00001000;\r\n  WS_EX_RTLREADING = $00002000;\r\n\r\n// On Setup Initialize\r\nprocedure InitializeWizard();\r\nvar\r\n  ExStyle: Longint;\r\n\r\nbegin\r\n  // Right To Left Layout for Arabic\r\n  If Not WizardForm.RightToLeft Then\r\n  begin\r\n    ExStyle := GetWindowLong(WizardForm.Handle, GWL_EXSTYLE);\r\n    SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, ExStyle Or WS_EX_LAYOUTRTL \r\n                  Or WS_EX_NOINHERITLAYOUT xOr WS_EX_RIGHT xOr WS_EX_RTLREADING);\r\n  \r\n    WizardForm.CancelButton.Left := WizardForm.Width - WizardForm.CancelButton.Left - WizardForm.CancelButton.Width;\r\n    WizardForm.NextButton.Left := WizardForm.Width - WizardForm.NextButton.Left - WizardForm.NextButton.Width;\r\n    WizardForm.BackButton.Left := WizardForm.Width - WizardForm.BackButton.Left - WizardForm.BackButton.Width;\r\n  end;\r\nend;\r\n\r\nprocedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);\r\nvar\r\n  ExStyle: Longint;\r\n\r\nbegin\r\n  If CurUninstallStep = usUninstall Then\r\n  begin\r\n    // Right To Left Layout for Arabic\r\n    If UninstallProgressForm.RightToLeft Then\r\n    begin\r\n      ExStyle := GetWindowLong(UninstallProgressForm.Handle, GWL_EXSTYLE);\r\n      SetWindowLong(UninstallProgressForm.Handle, GWL_EXSTYLE, ExStyle Or WS_EX_LAYOUTRTL \r\n\t\t\t\t\t          Or WS_EX_NOINHERITLAYOUT xOr WS_EX_RIGHT xOr WS_EX_RTLREADING);\r\n\r\n      UninstallProgressForm.CancelButton.Left := UninstallProgressForm.Width \r\n                                               - UninstallProgressForm.CancelButton.Left \r\n                                               - UninstallProgressForm.CancelButton.Width;\r\n    end;\r\n  end;\r\nend;\r\n```\r\nand here is the result:\r\n![Fixed Right To Left Layout  Image](http://i1297.photobucket.com/albums/ag34/MotazNew/Inno%20Setup/2_zpstfvduku2.jpg)\r\n\r\n**Thank you**"}}