Index: ../IS/Components/NewStaticText.pas =================================================================== --- ../IS/Components/NewStaticText.pas (revision 1) +++ ../IS/Components/NewStaticText.pas (working copy) @@ -10,7 +10,7 @@ interface uses - Windows, Messages, SysUtils, Classes, Controls, Forms; + Windows, Messages, SysUtils, Classes, Controls, Forms, BidiUtils{bidi}; type TNewStaticText = class(TWinControl) @@ -96,6 +96,8 @@ with Params do begin Style := Style or SS_NOTIFY; + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} if not FWordWrap then Style := Style or SS_LEFTNOWORDWRAP; if not FShowAccelChar then Style := Style or SS_NOPREFIX; end; Index: ../IS/Components/RichEditViewer.pas =================================================================== --- ../IS/Components/RichEditViewer.pas (revision 1) +++ ../IS/Components/RichEditViewer.pas (working copy) @@ -48,7 +48,7 @@ implementation uses - RichEdit, ShellApi; + RichEdit, ShellApi, BidiUtils{bidi}; const RICHEDIT_CLASS10A = 'RICHEDIT'; @@ -139,6 +139,11 @@ Must have a unique class name since it uses two different classes depending on the setting of the UseRichEdit property. } StrCat(Params.WinClassName, '/Text'); { don't localize! } + with Params do {bidi} + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end;{bidi} end; procedure TRichEditViewer.CreateWnd; Index: ../IS/Components/BidiCtrls.pas =================================================================== --- ../IS/Components/BidiCtrls.pas (revision 0) +++ ../IS/Components/BidiCtrls.pas (revision 0) @@ -0,0 +1,127 @@ +unit BidiCtrls;{bidi} + +{$IFDEF VER90} + {$DEFINE DELPHI2} +{$ENDIF} + +interface + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + BidiUtils; + +type + + TNewEdit = class (TEdit) + protected + procedure CreateParams(var Params: TCreateParams); override; + end; + + TNewMemo = class (TMemo) + public + procedure CreateParams(var Params: TCreateParams); override; + end; + + TNewComboBox = class (TComboBox) + public + procedure CreateParams(var Params: TCreateParams); override; + end; + + TNewButton = class (TButton) + public + procedure CreateParams(var Params: TCreateParams); override; + end; + + TNewCheckBox = class (TCheckBox) + public + procedure CreateParams(var Params: TCreateParams); override; + end; + + TNewRadioButton = class (TRadioButton) + public + procedure CreateParams(var Params: TCreateParams); override; + end; + + +procedure Register; + +implementation + +procedure Register; +begin + RegisterComponents('JR', [TNewEdit, TNewMemo, TNewComboBox, TNewButton, TNewCheckBox, TNewRadioButton]); +end; + +{ TNewEdit } + +procedure TNewEdit.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + +{ TNewMemo } + +procedure TNewMemo.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + +{ TNewComboBox } + +procedure TNewComboBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + +{ TButton } + +procedure TNewButton.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR ;{bidi} + end; +end; + +{ TCheckBox } + +procedure TNewCheckBox.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + +{ TCheckBox } + +procedure TNewRadioButton.CreateParams(var Params: TCreateParams); +begin + inherited CreateParams(Params); + with Params do + begin + if GetParentRightToLeft(Self) then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + +end. Index: ../IS/Components/BidiUtils.pas =================================================================== --- ../IS/Components/BidiUtils.pas (revision 0) +++ ../IS/Components/BidiUtils.pas (revision 0) @@ -0,0 +1,110 @@ +unit BidiUtils;{bidi} + +{$IFDEF VER90} + {$DEFINE DELPHI2} +{$ENDIF} + +interface + +uses + Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; + +procedure FlipRect(var Rect:TRect; ParentRect:TRect; UseRightToLeft:Boolean); +function FlipX(X:Integer; ParentRect:TRect; UseRightToLeft:Boolean):Integer; +function GetParentRightToLeft(Control:TControl): Boolean; +function DetectRightToLeft(LanguageID: Word):Boolean; +procedure FlipControls(AOwner:TComponent; Control:TWinControl); + +implementation + +procedure FlipRect(var Rect:TRect; ParentRect:TRect; UseRightToLeft:Boolean); +begin + if UseRightToLeft then + OffsetRect(Rect, ParentRect.Right - (Rect.Right - Rect.Left) - Rect.Left - Rect.Left, 0); +end; + +function FlipX(X:Integer; ParentRect:TRect; UseRightToLeft:Boolean):Integer; +begin + if UseRightToLeft then + Result := ParentRect.Right - X//easy :-) + else + Result := X; +end; + +function GetParentRightToLeft(Control:TControl): Boolean; +var + ParentForm: {$IFDEF DELPHI2} TForm {$ELSE} TCustomForm {$ENDIF}; +begin + ParentForm := GetParentForm(Control); + if ParentForm <> nil then + Result := (GetWindowLong(ParentForm.Handle, GWL_EXSTYLE) and WS_EX_RTLREADING) <> 0 + else + Result := False; +end; + +const + LOCALE_FONTSIGNATURE = $00000058; { font signature } //from delphi7 source + +function DetectRightToLeft(LanguageID: Word):Boolean; +const + MAXWCBUF = 80; +var + Buffer: array[0..MAXWCBUF - 1] of WChar; +begin + //http://www.microsoft.com/globaldev/DrIntl/columns/003/default.mspx +// LanguageID := $401; //for test + if GetLocaleInfo(LanguageID, LOCALE_FONTSIGNATURE, @Buffer, SizeOf(Buffer)) <> 0 then + Result := (Word(Buffer[7]) and $800) <> 0 + else + Result := False; +end; + +procedure FlipControls(AOwner:TComponent; Control:TWinControl); +var + i: Integer; + AlignList: TList; + ParentWidth: Integer; +begin + with Control do + if ControlCount > 0 then + begin + AlignList := TList.Create; + DisableAlign; + try + { Collect all the Right and Left alignments } + for i := 0 to ControlCount - 1 do + with Controls[i] do +// if Owner = AOwner then //only control Owned by the form + if Align in [alLeft, alRight] then + AlignList.Add(Controls[i]); + + ParentWidth := ClientWidth; + for i := 0 to ControlCount - 1 do + with Controls[i] do + begin + if Owner = AOwner then//AOwer mean the form, other create by the control, i think we must not touch it + begin + Left := ParentWidth - Width - Left; + end; + end; + finally + { Reverse the Right and Left alignments } + while AlignList.Count > 0 do + begin + with TControl(AlignList.Items[AlignList.Count - 1]) do + if Align = alLeft then + Align := alRight + else + Align := alLeft; + AlignList.Delete(AlignList.Count - 1); + end; + AlignList.Free; + EnableAlign; + end; + for i := 0 to ControlCount - 1 do + if Controls[i] is TWinControl then + FlipControls(AOwner, TWinControl(Controls[i])); + end; + end; + +end. Index: ../IS/Components/NewNotebook.pas =================================================================== --- ../IS/Components/NewNotebook.pas (revision 1) +++ ../IS/Components/NewNotebook.pas (working copy) @@ -37,6 +37,7 @@ procedure GetChildren(Proc: TGetChildProc {$IFNDEF DELPHI2} ; Root: TComponent {$ENDIF}); override; procedure ShowControl(AControl: TControl); override; + procedure Loaded; override;{bidi} public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -112,6 +113,9 @@ implementation +uses + BidiUtils;{bidi} + { TNewNotebookPage } constructor TNewNotebookPage.Create(AOwner: TComponent); @@ -122,6 +126,18 @@ Visible := False; end; +procedure TNewNotebook.Loaded;{bidi} +var + I: Integer; +begin + inherited; + //becuase NewNotebook not store Width, Height property so we need to correct bound for FlipControls function + for I := 0 to FPages.Count - 1 do + begin + TNewNotebookPage(FPages[I]).BoundsRect := BoundsRect; + end; +end; + destructor TNewNotebookPage.Destroy; begin if Assigned(FNotebook) then @@ -202,6 +218,8 @@ begin inherited; Params.Style := Params.Style or WS_CLIPCHILDREN; + if GetParentRightToLeft(Self) then{bidi} + Params.ExStyle := Params.ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} end; function TNewNotebook.FindNextPage(CurPage: TNewNotebookPage; Index: ../IS/Components/NewCheckListBox.pas =================================================================== --- ../IS/Components/NewCheckListBox.pas (revision 1) +++ ../IS/Components/NewCheckListBox.pas (working copy) @@ -130,6 +130,8 @@ procedure WMThemeChanged(var Message: TMessage); message WM_THEMECHANGED; procedure WMUpdateUIState(var Message: TMessage); message WM_UPDATEUISTATE; protected + FUseRightToLeft:Boolean;{bidi} + procedure CreateParams(var Params: TCreateParams); override; {bidi} procedure CreateWnd; override; procedure MeasureItem(Index: Integer; var Height: Integer); override; procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); @@ -157,6 +159,7 @@ procedure SetShowLines(Value: Boolean); procedure SetSubItem(Index: Integer; const ASubItem: String); property ItemStates[Index: Integer]: TItemState read GetItemState; + function UseRightToLeft:Boolean;{bidi} public constructor Create(AOwner: TComponent); override; procedure CreateWindowHandle(const Params: TCreateParams); override; @@ -225,7 +228,7 @@ implementation uses - TmSchemaISX, {$IFDEF DELPHI2} Ole2 {$ELSE} ActiveX {$ENDIF}; + TmSchemaISX, {$IFDEF DELPHI2} Ole2 {$ELSE} ActiveX {$ENDIF}, BidiUtils{bidi}; const sRadioCantHaveDisabledChildren = 'Radio item cannot have disabled child items'; @@ -486,6 +489,17 @@ FCaptureIndex := -1; end; +procedure TNewCheckListBox.CreateParams(var Params: TCreateParams); {bidi} +begin + inherited; + with Params do + begin + FUseRightToLeft := GetParentRightToLeft(Self); + if FUseRightToLeft then{bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; +end; + procedure TNewCheckListBox.CreateWnd; begin { TCustomListBox.CreateWnd causes a LB_RESETCONTENT message to be sent when @@ -725,7 +739,7 @@ end end; end; - + begin HintInfo := PHintInfo(Message.lParam); P := HintInfo.CursorPos; @@ -813,7 +827,10 @@ if Integer(itemID) >= 0 then begin L := ItemStates[itemID].Level; if ItemStates[itemID].ItemType <> itGroup then Inc(L); - rcItem.Left := rcItem.Left + (FCheckWidth + 2 * FOffset) * L; + if FUseRightToLeft then {bidi} + rcItem.Right := rcItem.Right - (FCheckWidth + 2 * FOffset) * L {bidi} + else {bidi} + rcItem.Left := rcItem.Left + (FCheckWidth + 2 * FOffset) * L; end; { Don't let TCustomListBox.CNDrawItem draw the focus } if FWantTabs or (CanQueryUIState and @@ -936,7 +953,9 @@ UIState: DWORD; SubItemWidth: Integer; PartId, StateId: Integer; + RowRect:TRect;{bidi} begin + RowRect := Rect; {bidi} if FShowLines and not FThreadsUpToDate then begin UpdateThreads; FThreadsUpToDate := True; @@ -972,16 +991,19 @@ if I = ThreadLevel - 1 then begin if ItemStates[Index].IsLastChild then ThreadBottom := ItemMiddle; - LineDDA(ThreadPosX, ItemMiddle, ThreadPosX + FCheckWidth div 2 + FOffset, - ItemMiddle, @LineDDAProc, Integer(Canvas)); + LineDDA(FlipX(ThreadPosX, ClientRect, UseRightToLeft), ItemMiddle, FlipX(ThreadPosX + FCheckWidth div 2 + FOffset, ClientRect, UseRightToLeft), + ItemMiddle, @LineDDAProc, Integer(Canvas));{bidi add FlipX} end; - LineDDA(ThreadPosX, Rect.Top, ThreadPosX, ThreadBottom, - @LineDDAProc, Integer(Canvas)); + LineDDA(FlipX(ThreadPosX, ClientRect, UseRightToLeft), Rect.Top, FlipX(ThreadPosX, ClientRect, UseRightToLeft), ThreadBottom, + @LineDDAProc, Integer(Canvas));{bidi add FlipX} end; end; { Draw checkmark} if ItemState.ItemType <> itGroup then begin - Dec(Rect.Left, FCheckWidth + 2 * FOffset); + if UseRightToLeft then {bidi} + Inc(Rect.Right, FCheckWidth + 2 * FOffset) {bidi} + else {bidi} + Dec(Rect.Left, FCheckWidth + 2 * FOffset); with CheckRect do begin Left := Rect.Left + FOffset; Top := Rect.Top + (Rect.Bottom - Rect.Top - FCheckHeight) div 2; @@ -1001,6 +1023,7 @@ uState := uState or DFCS_INACTIVE; if (FCaptureIndex = Index) and (FSpaceDown or (FLastMouseMoveIndex = Index)) then uState := uState or DFCS_PUSHED; + FlipRect(CheckRect, Rect, UseRightToLeft); {bidi} DrawFrameControl(Handle, CheckRect, DFC_BUTTON, uState) end else begin PartId := ButtonPartIds[ItemState.ItemType]; @@ -1017,9 +1040,13 @@ StateId := ButtonStateIds[ItemState.State][cb2Normal]; //if IsThemeBackgroundPartiallyTransparent(FThemeData, PartId, StateId) then // DrawThemeParentBackground(Self.Handle, Handle, @CheckRect); + FlipRect(CheckRect, Rect, UseRightToLeft); {bidi} DrawThemeBackGround(FThemeData, Handle, PartId, StateId, CheckRect, @CheckRect); end; - Rect.Left := CheckRect.Right + FOffset; + if UseRightToLeft then {bidi} + Rect.Right := CheckRect.Left - FOffset {bidi} + else {bidi} + Rect.Left := CheckRect.Right + FOffset; end; { Draw SubItem } FillRect(Rect); @@ -1030,6 +1057,7 @@ SubItemWidth := TextWidth(ItemState.SubItem) + 2 * FOffset; SubItemRect := Rect; SubItemRect.Left := SubItemRect.Right - SubItemWidth + FOffset; + FlipRect(SubItemRect, RowRect, UseRightToLeft);{bidi} InternalDrawText(ItemState.SubItem, SubItemRect, DT_NOCLIP or DT_NOPREFIX or DT_SINGLELINE or DT_VCENTER, FWantTabs and Disabled); Dec(Rect.Right, SubItemWidth); @@ -1045,6 +1073,8 @@ DrawTextFormat := DrawTextFormat or DT_NOPREFIX; if (UIState and UISF_HIDEACCEL) <> 0 then DrawTextFormat := DrawTextFormat or DT_HIDEPREFIX; + if UseRightToLeft then {bidi} + DrawTextFormat := DrawTextFormat or DT_RTLREADING;{bidi} { When you call DrawText with the DT_CALCRECT flag and there's a word wider than the rectangle width, it increases the rectangle width and wraps at the new Right point. On the other hand, when you call DrawText @@ -1055,6 +1085,7 @@ Wrapping at the same place is important because it can affect how many lines are drawn -- and we mustn't draw too many. } InternalDrawText(Items[Index], Rect, DrawTextFormat or DT_CALCRECT, False); + FlipRect(Rect, RowRect, UseRightToLeft);{bidi} InternalDrawText(Items[Index], Rect, DrawTextFormat, FWantTabs and Disabled); { Draw focus rectangle } if FWantTabs and not Disabled and (odSelected in State) and Focused and @@ -1191,7 +1222,7 @@ with ItemStates[Index] do Result := (ItemType = itRadio) and (State <> cbChecked) end; - + var Delta: Integer; begin @@ -1269,11 +1300,14 @@ procedure TNewCheckListBox.InvalidateCheck(Index: Integer); var + Rect:TRect;{bidi} IRect: TRect; begin - IRect := ItemRect(Index); + Rect := ItemRect(Index);{bidi IRect -> Rect} + IRect := Rect;{bidi} Inc(IRect.Left, (FCheckWidth + 2 * Offset) * (ItemLevel[Index])); IRect.Right := IRect.Left + (FCheckWidth + 2 * Offset); + FlipRect(IRect, Rect, UseRightToLeft);{bidi} InvalidateRect(Handle, @IRect, FThemeData <> 0); end; @@ -1660,7 +1694,7 @@ procedure TNewCheckListBox.SetShowLines(Value: Boolean); begin - if FShowLines <> Value then + if FShowLines <> Value then begin FShowLines := Value; Invalidate; @@ -1693,6 +1727,11 @@ end; end; +function TNewCheckListBox.UseRightToLeft:Boolean;{bidi} +begin + Result := FUseRightToLeft; +end; + procedure TNewCheckListBox.Toggle(Index: Integer); begin case ItemStates[Index].ItemType of @@ -1831,6 +1870,8 @@ Exit; end; end; + if Items.Count = 0 then + Exit; if GoForward then I := FindNextItem(-1, True, not Arrows) else Index: ../IS/Projects/SelLangForm.dfm.txt =================================================================== --- ../IS/Projects/SelLangForm.dfm.txt (revision 1) +++ ../IS/Projects/SelLangForm.dfm.txt (working copy) @@ -19,7 +19,7 @@ Width = 32 Height = 32 end - object CancelButton: TButton + object CancelButton: TNewButton Left = 214 Top = 93 Width = 75 @@ -29,7 +29,7 @@ ModalResult = 2 TabOrder = 3 end - object OKButton: TButton + object OKButton: TNewButton Left = 133 Top = 93 Width = 75 @@ -39,7 +39,7 @@ ModalResult = 1 TabOrder = 2 end - object LangCombo: TComboBox + object LangCombo: TNewComboBox Left = 56 Top = 56 Width = 233 Index: ../IS/Projects/UninstSharedFileForm.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/Main.pas =================================================================== --- ../IS/Projects/Main.pas (revision 1) +++ ../IS/Projects/Main.pas (working copy) @@ -18,7 +18,7 @@ uses Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, SetupForm, StdCtrls, Struct, DebugStruct, Int64Em, CmnFunc, CmnFunc2, - SetupTypes, ScriptRunner; + SetupTypes, ScriptRunner, BidiUtils{bidi}; type TMainForm = class(TSetupForm) @@ -116,6 +116,7 @@ { Variables read in from the SETUP.0 file } SetupHeader: TSetupHeader; LangOptions: TSetupLanguageEntry; + LanguageRightToLeft: Boolean;{bidi} Entries: array[TEntryType] of TList; WizardImage: TBitmap; WizardSmallImage: TBitmap; @@ -1883,7 +1884,13 @@ ActiveLanguage := I; Finalize(LangOptions); { prevent leak on D2 } LangOptions := LangEntry^; + LanguageRightToLeft := DetectRightToLeft(LangOptions.LanguageID);{bidi} + if LanguageRightToLeft then{bidi} + SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR) {bidi} + else {bidi} + SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) and not (WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR)); {bidi} + if LangEntry.LicenseText <> '' then ActiveLicenseText := LangEntry.LicenseText else Index: ../IS/Projects/CmnFunc.pas =================================================================== --- ../IS/Projects/CmnFunc.pas (revision 1) +++ ../IS/Projects/CmnFunc.pas (working copy) @@ -54,7 +54,7 @@ implementation uses - Consts, PathFunc, CmnFunc2; + Consts, PathFunc, CmnFunc2, BidiUtils{bidi}; var MessageBoxCaptions: array[TMsgBoxType] of PChar; @@ -217,7 +217,8 @@ DidMove := MoveAppWindowToActiveWindowMonitor(OldRect); try {$ENDIF} - Result := Application.MessageBox(Text, Caption, Flags); +// Result := Application.MessageBox(Text, Caption, Flags); + Result := MessageBox(Application.Handle, Text, Caption, Flags);{bidi: I dont know if that good way, but Delphi 2.0 remove MB_RTLREADING, BTW it is working} {$IFNDEF IS_D4} finally if DidMove then @@ -244,6 +245,7 @@ var C: PChar; NewCaption: String; + BidiFlags:Cardinal;{bidi} begin C := Caption; if (C = nil) or (C[0] = #0) then begin @@ -257,7 +259,11 @@ C := PChar(NewCaption); end; end; - Result := AppMessageBox(Text, C, Buttons or IconFlags[Typ]); + if (GetWindowLong(Application.Handle, GWL_EXSTYLE) and WS_EX_RTLREADING) <> 0 then {bidi} + BidiFlags := MB_RTLREADING or MB_RIGHT {bidi} + else {bidi} + BidiFlags := 0; {bidi} + Result := AppMessageBox(Text, C, Buttons or IconFlags[Typ] or BidiFlags); {bidi add BidiFlags} end; function MsgBox(const Text, Caption: String; const Typ: TMsgBoxType; Index: ../IS/Projects/SelLangForm.pas =================================================================== --- ../IS/Projects/SelLangForm.pas (revision 1) +++ ../IS/Projects/SelLangForm.pas (working copy) @@ -15,14 +15,14 @@ uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - SetupForm, StdCtrls, ExtCtrls, NewStaticText, BitmapImage; + SetupForm, StdCtrls, ExtCtrls, NewStaticText, BitmapImage, BidiCtrls; type TSelectLanguageForm = class(TSetupForm) SelectLabel: TNewStaticText; - LangCombo: TComboBox; - OKButton: TButton; - CancelButton: TButton; + LangCombo: TNewComboBox; + OKButton: TNewButton; + CancelButton: TNewButton; IconBitmapImage: TBitmapImage; private { Private declarations } Index: ../IS/Projects/UninstProgressForm.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/Wizard.dfm.txt =================================================================== --- ../IS/Projects/Wizard.dfm.txt (revision 1) +++ ../IS/Projects/Wizard.dfm.txt (working copy) @@ -21,7 +21,7 @@ Height = 2 Shape = bsTopLine end - object CancelButton: TButton + object CancelButton: TNewButton Left = 464 Top = 327 Width = 17 @@ -31,7 +31,7 @@ TabOrder = 4 OnClick = CancelButtonClick end - object NextButton: TButton + object NextButton: TNewButton Left = 440 Top = 327 Width = 17 @@ -41,7 +41,7 @@ TabOrder = 3 OnClick = NextButtonClick end - object BackButton: TButton + object BackButton: TNewButton Left = 424 Top = 327 Width = 16 @@ -107,7 +107,7 @@ ActivePage = LicensePage TabOrder = 1 object LicensePage: TNewNotebookPage - object LicenseNotAcceptedRadio: TRadioButton + object LicenseNotAcceptedRadio: TNewRadioButton Left = 0 Top = 216 Width = 417 @@ -118,7 +118,7 @@ TabStop = True OnClick = LicenseNotAcceptedRadioClick end - object LicenseAcceptedRadio: TRadioButton + object LicenseAcceptedRadio: TNewRadioButton Left = 0 Top = 196 Width = 417 @@ -206,7 +206,7 @@ end end object UserInfoPage: TNewNotebookPage - object UserInfoSerialEdit: TEdit + object UserInfoSerialEdit: TNewEdit Left = 0 Top = 120 Width = 417 @@ -226,7 +226,7 @@ TabOrder = 4 WordWrap = True end - object UserInfoOrgEdit: TEdit + object UserInfoOrgEdit: TNewEdit Left = 0 Top = 68 Width = 417 @@ -246,7 +246,7 @@ TabOrder = 2 WordWrap = True end - object UserInfoNameEdit: TEdit + object UserInfoNameEdit: TNewEdit Left = 0 Top = 16 Width = 417 @@ -285,7 +285,7 @@ TabOrder = 4 WordWrap = True end - object DirBrowseButton: TButton + object DirBrowseButton: TNewButton Left = 400 Top = 67 Width = 17 @@ -346,7 +346,7 @@ RequireRadioSelection = True TabOrder = 2 end - object TypesCombo: TComboBox + object TypesCombo: TNewComboBox Left = 0 Top = 24 Width = 417 @@ -375,7 +375,7 @@ Width = 32 Height = 32 end - object NoIconsCheck: TCheckBox + object NoIconsCheck: TNewCheckBox Left = 0 Top = 215 Width = 417 @@ -384,7 +384,7 @@ TabOrder = 4 OnClick = NoIconsCheckClick end - object GroupBrowseButton: TButton + object GroupBrowseButton: TNewButton Left = 400 Top = 67 Width = 17 @@ -393,7 +393,7 @@ TabOrder = 3 OnClick = GroupBrowseButtonClick end - object GroupEdit: TEdit + object GroupEdit: TNewEdit Left = 0 Top = 68 Width = 397 @@ -449,7 +449,7 @@ end end object ReadyPage: TNewNotebookPage - object ReadyMemo: TMemo + object ReadyMemo: TNewMemo Left = 0 Top = 24 Width = 417 @@ -594,7 +594,7 @@ Width = 164 Height = 314 end - object NoRadio: TRadioButton + object NoRadio: TNewRadioButton Left = 176 Top = 184 Width = 301 @@ -603,7 +603,7 @@ TabOrder = 4 Visible = False end - object YesRadio: TRadioButton + object YesRadio: TNewRadioButton Left = 176 Top = 156 Width = 301 Index: ../IS/Projects/NewDisk.pas =================================================================== --- ../IS/Projects/NewDisk.pas (revision 1) +++ ../IS/Projects/NewDisk.pas (working copy) @@ -17,7 +17,7 @@ uses Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, - SetupForm, StdCtrls, ExtCtrls, NewStaticText, BitmapImage; + SetupForm, StdCtrls, ExtCtrls, NewStaticText, BitmapImage, BidiCtrls; type TNewDiskForm = class(TSetupForm) @@ -25,9 +25,9 @@ SelectDiskLabel: TNewStaticText; PathLabel: TNewStaticText; PathEdit: TEdit; - BrowseButton: TButton; - OKButton: TButton; - CancelButton: TButton; + BrowseButton: TNewButton; + OKButton: TNewButton; + CancelButton: TNewButton; procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure BrowseButtonClick(Sender: TObject); private Index: ../IS/Projects/UninstSharedFileForm.dfm.txt =================================================================== --- ../IS/Projects/UninstSharedFileForm.dfm.txt (revision 1) +++ ../IS/Projects/UninstSharedFileForm.dfm.txt (working copy) @@ -13,7 +13,7 @@ Scaled = False PixelsPerInch = 96 TextHeight = 13 - object NoToAllButton: TButton + object NoToAllButton: TNewButton Left = 283 Top = 189 Width = 75 @@ -22,7 +22,7 @@ ModalResult = 9 TabOrder = 3 end - object NoButton: TButton + object NoButton: TNewButton Left = 202 Top = 189 Width = 75 @@ -31,7 +31,7 @@ ModalResult = 7 TabOrder = 2 end - object YesToAllButton: TButton + object YesToAllButton: TNewButton Left = 121 Top = 189 Width = 75 @@ -40,7 +40,7 @@ ModalResult = 10 TabOrder = 1 end - object YesButton: TButton + object YesButton: TNewButton Left = 40 Top = 189 Width = 75 @@ -50,7 +50,7 @@ ModalResult = 6 TabOrder = 0 end - object LocationEdit: TEdit + object LocationEdit: TNewEdit Left = 88 Top = 148 Width = 297 Index: ../IS/Projects/Wizard.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/SelFolderForm.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/UninstProgressForm.dfm.txt =================================================================== --- ../IS/Projects/UninstProgressForm.dfm.txt (revision 1) +++ ../IS/Projects/UninstProgressForm.dfm.txt (working copy) @@ -20,7 +20,7 @@ Height = 2 Shape = bsTopLine end - object CancelButton: TButton + object CancelButton: TNewButton Left = 410 Top = 327 Width = 75 Index: ../IS/Projects/UninstSharedFileForm.pas =================================================================== --- ../IS/Projects/UninstSharedFileForm.pas (revision 1) +++ ../IS/Projects/UninstSharedFileForm.pas (working copy) @@ -15,7 +15,7 @@ uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - SetupForm, StdCtrls, NewStaticText; + SetupForm, StdCtrls, NewStaticText, BidiCtrls; type TUninstSharedFileForm = class(TSetupForm) @@ -23,11 +23,11 @@ FilenameLabel: TNewStaticText; FilenameEdit: TEdit; LocationLabel: TNewStaticText; - LocationEdit: TEdit; - YesButton: TButton; - YesToAllButton: TButton; - NoButton: TButton; - NoToAllButton: TButton; + LocationEdit: TNewEdit; + YesButton: TNewButton; + YesToAllButton: TNewButton; + NoButton: TNewButton; + NoToAllButton: TNewButton; private { Private declarations } protected Index: ../IS/Projects/UninstProgressForm.pas =================================================================== --- ../IS/Projects/UninstProgressForm.pas (revision 1) +++ ../IS/Projects/UninstProgressForm.pas (working copy) @@ -16,7 +16,7 @@ uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SetupForm, StdCtrls, ExtCtrls, BitmapImage, NewProgressBar, NewStaticText, - NewNotebook; + NewNotebook, BidiCtrls; type TUninstProgressForm = class(TSetupForm) @@ -33,7 +33,7 @@ ProgressBar: TNewProgressBar; BeveledLabel: TNewStaticText; Bevel: TBevel; - CancelButton: TButton; + CancelButton: TNewButton; private { Private declarations } FTitle, FAppName: String; Index: ../IS/Projects/NewDisk.dfm.txt =================================================================== --- ../IS/Projects/NewDisk.dfm.txt (revision 1) +++ ../IS/Projects/NewDisk.dfm.txt (working copy) @@ -20,7 +20,7 @@ Width = 48 Height = 48 end - object CancelButton: TButton + object CancelButton: TNewButton Left = 296 Top = 137 Width = 73 @@ -30,7 +30,7 @@ ModalResult = 2 TabOrder = 5 end - object OKButton: TButton + object OKButton: TNewButton Left = 216 Top = 137 Width = 73 @@ -40,7 +40,7 @@ ModalResult = 1 TabOrder = 4 end - object BrowseButton: TButton + object BrowseButton: TNewButton Left = 296 Top = 95 Width = 73 Index: ../IS/Projects/SetupForm.pas =================================================================== --- ../IS/Projects/SetupForm.pas (revision 1) +++ ../IS/Projects/SetupForm.pas (working copy) @@ -23,9 +23,12 @@ FBaseUnitX, FBaseUnitY: Integer; procedure WMQueryEndSession(var Message: TWMQueryEndSession); message WM_QUERYENDSESSION; protected + procedure DoShow; override;{bidi} procedure WndProc(var Message: TMessage); override; + procedure CreateParams(var Params: TCreateParams); override;{bidi} public constructor Create(AOwner: TComponent); override; + procedure FlipChildren;{bidi} function CalculateButtonWidth(const ButtonCaptions: array of TSetupMessageID): Integer; procedure Center; procedure CenterInsideControl(const Ctl: TWinControl; @@ -51,7 +54,7 @@ implementation uses - CmnFunc2, Main, Msgs; + CmnFunc2, Main, Msgs, BidiUtils{bidi}; function GetRectOfPrimaryMonitor(const WorkArea: Boolean): TRect; begin @@ -321,6 +324,28 @@ inherited; end; +procedure TSetupForm.CreateParams(var Params: TCreateParams);{bidi} +begin + inherited; + if LanguageRightToLeft then {bidi} + with Params do {bidi} + begin {bidi} + ExStyle := ExStyle or WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT;{bidi} + end; {bidi} +end; + +procedure TSetupForm.FlipChildren;{bidi} +begin + if LanguageRightToLeft then{bidi} + FlipControls(Self, Self);{bidi} +end; + +procedure TSetupForm.DoShow;{bidi} +begin + inherited; + FlipChildren;{bidi} +end; + initialization WM_QueryCancelAutoPlay := RegisterWindowMessage('QueryCancelAutoPlay'); if WM_QueryCancelAutoPlay <> 0 then Index: ../IS/Projects/SelLangForm.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/SelFolderForm.dfm.txt =================================================================== --- ../IS/Projects/SelFolderForm.dfm.txt (revision 1) +++ ../IS/Projects/SelFolderForm.dfm.txt (working copy) @@ -13,7 +13,7 @@ Scaled = False PixelsPerInch = 96 TextHeight = 13 - object CancelButton: TButton + object CancelButton: TNewButton Left = 320 Top = 305 Width = 17 @@ -23,7 +23,7 @@ ModalResult = 2 TabOrder = 4 end - object OKButton: TButton + object OKButton: TNewButton Left = 304 Top = 305 Width = 16 @@ -34,7 +34,7 @@ ModalResult = 1 TabOrder = 3 end - object NewFolderButton: TButton + object NewFolderButton: TNewButton Left = 12 Top = 305 Width = 17 Index: ../IS/Projects/NewDisk.dfm =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: ../IS/Projects/Wizard.pas =================================================================== --- ../IS/Projects/Wizard.pas (revision 1) +++ ../IS/Projects/Wizard.pas (working copy) @@ -20,7 +20,7 @@ Forms, Dialogs, StdCtrls, ExtCtrls, SetupForm, Struct, Int64Em, NewCheckListBox, RichEditViewer, NewStaticText, SetupTypes, NewProgressBar, MsgIDs, PasswordEdit, FolderTreeView, BitmapImage, - NewNotebook; + NewNotebook, BidiCtrls{bidi}; type TWizardForm = class; @@ -78,9 +78,9 @@ end; TWizardForm = class(TSetupForm) - CancelButton: TButton; - NextButton: TButton; - BackButton: TButton; + CancelButton: TNewButton; + NextButton: TNewButton; + BackButton: TNewButton; OuterNotebook: TNewNotebook; InnerNotebook: TNewNotebook; WelcomePage: TNewNotebookPage; @@ -100,13 +100,13 @@ InfoAfterPage: TNewNotebookPage; DiskSpaceLabel: TNewStaticText; DirEdit: TEdit; - GroupEdit: TEdit; - NoIconsCheck: TCheckBox; + GroupEdit: TNewEdit; + NoIconsCheck: TNewCheckBox; PasswordLabel: TNewStaticText; PasswordEdit: TPasswordEdit; PasswordEditLabel: TNewStaticText; - ReadyMemo: TMemo; - TypesCombo: TComboBox; + ReadyMemo: TNewMemo; + TypesCombo: TNewComboBox; Bevel: TBevel; WizardBitmapImage: TBitmapImage; WelcomeLabel1: TNewStaticText; @@ -119,8 +119,8 @@ WizardSmallBitmapImage: TBitmapImage; ReadyLabel: TNewStaticText; FinishedLabel: TNewStaticText; - YesRadio: TRadioButton; - NoRadio: TRadioButton; + YesRadio: TNewRadioButton; + NoRadio: TNewRadioButton; WizardBitmapImage2: TBitmapImage; WelcomeLabel2: TNewStaticText; LicenseLabel1: TNewStaticText; @@ -137,21 +137,21 @@ SelectStartMenuFolderLabel: TNewStaticText; SelectComponentsLabel: TNewStaticText; SelectTasksLabel: TNewStaticText; - LicenseAcceptedRadio: TRadioButton; - LicenseNotAcceptedRadio: TRadioButton; + LicenseAcceptedRadio: TNewRadioButton; + LicenseNotAcceptedRadio: TNewRadioButton; UserInfoNameLabel: TNewStaticText; - UserInfoNameEdit: TEdit; + UserInfoNameEdit: TNewEdit; UserInfoOrgLabel: TNewStaticText; - UserInfoOrgEdit: TEdit; + UserInfoOrgEdit: TNewEdit; PreparingErrorBitmapImage: TBitmapImage; PreparingLabel: TNewStaticText; FinishedHeadingLabel: TNewStaticText; UserInfoSerialLabel: TNewStaticText; - UserInfoSerialEdit: TEdit; + UserInfoSerialEdit: TNewEdit; TasksList: TNewCheckListBox; RunList: TNewCheckListBox; - DirBrowseButton: TButton; - GroupBrowseButton: TButton; + DirBrowseButton: TNewButton; + GroupBrowseButton: TNewButton; SelectDirBitmapImage: TBitmapImage; SelectGroupBitmapImage: TBitmapImage; SelectDirBrowseLabel: TNewStaticText; Index: ../IS/Projects/SelFolderForm.pas =================================================================== --- ../IS/Projects/SelFolderForm.pas (revision 1) +++ ../IS/Projects/SelFolderForm.pas (working copy) @@ -15,15 +15,15 @@ uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - SetupForm, StdCtrls, FolderTreeView, NewStaticText; + SetupForm, StdCtrls, FolderTreeView, NewStaticText, BidiCtrls; type TSelectFolderForm = class(TSetupForm) BrowseLabel: TNewStaticText; PathEdit: TEdit; - NewFolderButton: TButton; - OKButton: TButton; - CancelButton: TButton; + NewFolderButton: TNewButton; + OKButton: TNewButton; + CancelButton: TNewButton; procedure PathEditChange(Sender: TObject); procedure NewFolderButtonClick(Sender: TObject); private