forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 238b774
Showing
275 changed files
with
91,272 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
c.bat | ||
compilesettings.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.dcu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
unit BidiCtrls; | ||
|
||
{ | ||
Inno Setup | ||
Copyright (C) 1997-2007 Jordan Russell | ||
Portions by Martijn Laan | ||
For conditions of distribution and use, see LICENSE.TXT. | ||
RTL-capable versions of standard controls | ||
$jrsoftware: issrc/Components/BidiCtrls.pas,v 1.2 2007/11/27 04:52:53 jr Exp $ | ||
} | ||
|
||
interface | ||
|
||
uses | ||
Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, | ||
StdCtrls; | ||
|
||
type | ||
TNewEdit = class(TEdit) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewMemo = class(TMemo) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewComboBox = class(TComboBox) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewListBox = class(TListBox) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewButton = class(TButton) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewCheckBox = class(TCheckBox) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
TNewRadioButton = class(TRadioButton) | ||
protected | ||
procedure CreateParams(var Params: TCreateParams); override; | ||
end; | ||
|
||
procedure Register; | ||
|
||
implementation | ||
|
||
uses | ||
BidiUtils; | ||
|
||
procedure Register; | ||
begin | ||
RegisterComponents('JR', [TNewEdit, TNewMemo, TNewComboBox, TNewListBox, | ||
TNewButton, TNewCheckBox, TNewRadioButton]); | ||
end; | ||
|
||
{ TNewEdit } | ||
|
||
procedure TNewEdit.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
{ TNewMemo } | ||
|
||
procedure TNewMemo.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
{ TNewComboBox } | ||
|
||
procedure TNewComboBox.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
{ TNewListBox } | ||
|
||
procedure TNewListBox.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
{ TNewButton } | ||
|
||
procedure TNewButton.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
Params.ExStyle := Params.ExStyle and not WS_EX_RIGHT; | ||
end; | ||
|
||
{ TNewCheckBox } | ||
|
||
procedure TNewCheckBox.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
{ TNewRadioButton } | ||
|
||
procedure TNewRadioButton.CreateParams(var Params: TCreateParams); | ||
begin | ||
inherited; | ||
SetBiDiStyles(Self, Params); | ||
end; | ||
|
||
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
unit BidiUtils; | ||
|
||
{ | ||
Inno Setup | ||
Copyright (C) 1997-2007 Jordan Russell | ||
Portions by Martijn Laan | ||
For conditions of distribution and use, see LICENSE.TXT. | ||
Bidi utility functions | ||
$jrsoftware: issrc/Components/BidiUtils.pas,v 1.2 2007/11/27 04:52:53 jr Exp $ | ||
} | ||
|
||
interface | ||
|
||
uses | ||
Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; | ||
|
||
procedure FlipControls(const AParentCtl: TWinControl); | ||
procedure FlipRect(var Rect: TRect; const ParentRect: TRect; const UseRightToLeft: Boolean); | ||
function IsParentFlipped(const AControl: TControl): Boolean; | ||
function IsParentRightToLeft(const AControl: TControl): Boolean; | ||
function SetBiDiStyles(const AControl: TControl; var AParams: TCreateParams): Boolean; | ||
|
||
var | ||
{ These are set by the SetupForm unit: } | ||
IsParentFlippedFunc: function(AControl: TControl): Boolean; | ||
IsParentRightToLeftFunc: function(AControl: TControl): Boolean; | ||
|
||
implementation | ||
|
||
procedure FlipRect(var Rect: TRect; const ParentRect: TRect; const UseRightToLeft: Boolean); | ||
var | ||
W: Integer; | ||
begin | ||
if UseRightToLeft then begin | ||
W := Rect.Right - Rect.Left; | ||
Rect.Left := ParentRect.Right - (Rect.Left - ParentRect.Left) - W; | ||
Rect.Right := Rect.Left + W; | ||
end; | ||
end; | ||
|
||
function IsParentFlipped(const AControl: TControl): Boolean; | ||
begin | ||
if Assigned(IsParentFlippedFunc) then | ||
Result := IsParentFlippedFunc(AControl) | ||
else | ||
Result := False; | ||
end; | ||
|
||
function IsParentRightToLeft(const AControl: TControl): Boolean; | ||
begin | ||
if Assigned(IsParentRightToLeftFunc) then | ||
Result := IsParentRightToLeftFunc(AControl) | ||
else | ||
Result := False; | ||
end; | ||
|
||
function SetBiDiStyles(const AControl: TControl; var AParams: TCreateParams): Boolean; | ||
begin | ||
Result := IsParentRightToLeft(AControl); | ||
if Result then | ||
AParams.ExStyle := AParams.ExStyle or (WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT); | ||
end; | ||
|
||
procedure FlipControls(const AParentCtl: TWinControl); | ||
var | ||
ParentWidth, I: Integer; | ||
Ctl: TControl; | ||
begin | ||
if AParentCtl.ControlCount = 0 then | ||
Exit; | ||
AParentCtl.DisableAlign; | ||
try | ||
ParentWidth := AParentCtl.ClientWidth; | ||
for I := 0 to AParentCtl.ControlCount-1 do begin | ||
Ctl := AParentCtl.Controls[I]; | ||
Ctl.Left := ParentWidth - Ctl.Width - Ctl.Left; | ||
end; | ||
finally | ||
AParentCtl.EnableAlign; | ||
end; | ||
for I := 0 to AParentCtl.ControlCount-1 do | ||
if AParentCtl.Controls[I] is TWinControl then | ||
FlipControls(TWinControl(AParentCtl.Controls[I])); | ||
end; | ||
|
||
end. |
Oops, something went wrong.