mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 16:38:17 +02:00
lcl: bidi mode support for TColorBox, TColorListBox from Zeher Dirkey (issue #0015001)
git-svn-id: trunk@22449 -
This commit is contained in:
parent
2e2fcd58fc
commit
cf37ea98d1
@ -555,7 +555,7 @@ begin
|
||||
Brush.Color := NewColor;
|
||||
Pen.Color := clBlack;
|
||||
|
||||
Rectangle(r);
|
||||
Rectangle(BidiFlipRect(r, Rect, UseRightToLeftAlignment));
|
||||
|
||||
Brush.Color := BrushColor;
|
||||
Pen.Color := PenColor;
|
||||
@ -563,7 +563,7 @@ begin
|
||||
r := Rect;
|
||||
r.left := r.left + 20;
|
||||
|
||||
inherited DrawItem(Index, r, State);
|
||||
inherited DrawItem(Index, BidiFlipRect(r, Rect, UseRightToLeftAlignment), State);
|
||||
end;
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomColorBox.SetColorList
|
||||
@ -846,7 +846,7 @@ begin
|
||||
Brush.Color := NewColor;
|
||||
Pen.Color := clBlack;
|
||||
|
||||
Rectangle(r);
|
||||
Rectangle(BidiFlipRect(r, Rect, UseRightToLeftAlignment));
|
||||
|
||||
Brush.Color := BrushColor;
|
||||
Pen.Color := PenColor;
|
||||
@ -854,7 +854,7 @@ begin
|
||||
r := Rect;
|
||||
r.left := r.left + 20;
|
||||
|
||||
inherited DrawItem(Index, r, State);
|
||||
inherited DrawItem(Index, BidiFlipRect(r, Rect, UseRightToLeftAlignment), State);
|
||||
end;
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomColorListBox.SetColorList
|
||||
|
@ -2366,6 +2366,7 @@ procedure AdjustBorderSpace(var RemainingClientRect, CurBorderSpace: TRect;
|
||||
function IsColorDefault(AControl: TControl): Boolean;
|
||||
|
||||
function BidiFlipAlignment(Alignment: TAlignment; Flip: Boolean = True): TAlignment;
|
||||
function BidiFlipRect(const Rect: TRect; const ParentRect: TRect; const Flip: Boolean): TRect;
|
||||
|
||||
function DbgS(a: TAnchorKind): string; overload;
|
||||
function DbgS(Anchors: TAnchors): string; overload;
|
||||
@ -2488,6 +2489,19 @@ begin
|
||||
Result := BidiAlignment[Flip, Alignment];
|
||||
end;
|
||||
|
||||
function BidiFlipRect(const Rect: TRect; const ParentRect: TRect; const Flip: Boolean): TRect;
|
||||
var
|
||||
W: Integer;
|
||||
begin
|
||||
Result := Rect;
|
||||
if Flip then
|
||||
begin
|
||||
W := Result.Right - Result.Left;
|
||||
Result.Left := ParentRect.Right - (Result.Left - ParentRect.Left) - W;
|
||||
Result.Right := Result.Left + W;
|
||||
end;
|
||||
end;
|
||||
|
||||
function DbgS(a: TAnchorKind): string;
|
||||
begin
|
||||
Result:=AnchorNames[a];
|
||||
|
Loading…
Reference in New Issue
Block a user