mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 21:42:51 +02:00
TRadioGroup and TCheckGroup are now using ChildSizing properties
git-svn-id: trunk@8619 -
This commit is contained in:
parent
6c6535d395
commit
4572967898
@ -640,13 +640,13 @@ type
|
|||||||
procedure Clicked(Sender: TObject);
|
procedure Clicked(Sender: TObject);
|
||||||
procedure Changed(Sender: TObject);
|
procedure Changed(Sender: TObject);
|
||||||
procedure ItemEnter(Sender: TObject);
|
procedure ItemEnter(Sender: TObject);
|
||||||
procedure PositionButtons;
|
|
||||||
procedure UpdateTabStops;
|
procedure UpdateTabStops;
|
||||||
procedure SetAutoFill(const AValue: Boolean);
|
procedure SetAutoFill(const AValue: Boolean);
|
||||||
procedure SetColumnLayout(const AValue: TColumnLayout);
|
procedure SetColumnLayout(const AValue: TColumnLayout);
|
||||||
procedure ItemExit(Sender: TObject);
|
procedure ItemExit(Sender: TObject);
|
||||||
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ItemKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure ItemResize(Sender: TObject);
|
procedure ItemResize(Sender: TObject);
|
||||||
|
procedure UpdateControlsPerLine;
|
||||||
protected
|
protected
|
||||||
procedure InitializeWnd; override;
|
procedure InitializeWnd; override;
|
||||||
procedure UpdateRadioButtonStates; virtual;
|
procedure UpdateRadioButtonStates; virtual;
|
||||||
@ -719,6 +719,7 @@ type
|
|||||||
|
|
||||||
TCustomCheckGroup = class(TCustomGroupBox)
|
TCustomCheckGroup = class(TCustomGroupBox)
|
||||||
private
|
private
|
||||||
|
FAutoFill: boolean;
|
||||||
FButtonList: TList; // list of TCheckBox
|
FButtonList: TList; // list of TCheckBox
|
||||||
FColumnLayout: TColumnLayout;
|
FColumnLayout: TColumnLayout;
|
||||||
FCreatingWnd: boolean;
|
FCreatingWnd: boolean;
|
||||||
@ -729,12 +730,13 @@ type
|
|||||||
function GetCheckEnabled(Index: integer): boolean;
|
function GetCheckEnabled(Index: integer): boolean;
|
||||||
procedure Clicked(Sender: TObject);
|
procedure Clicked(Sender: TObject);
|
||||||
procedure DoClick(Index: integer);
|
procedure DoClick(Index: integer);
|
||||||
procedure DoPositionButtons;
|
|
||||||
procedure ItemsChanged (Sender : TObject);
|
procedure ItemsChanged (Sender : TObject);
|
||||||
|
procedure SetAutoFill(const AValue: boolean);
|
||||||
procedure SetChecked(Index: integer; const AValue: boolean);
|
procedure SetChecked(Index: integer; const AValue: boolean);
|
||||||
procedure SetCheckEnabled(Index: integer; const AValue: boolean);
|
procedure SetCheckEnabled(Index: integer; const AValue: boolean);
|
||||||
procedure SetColumnLayout(const AValue: TColumnLayout);
|
procedure SetColumnLayout(const AValue: TColumnLayout);
|
||||||
procedure UpdateItems;
|
procedure UpdateItems;
|
||||||
|
procedure UpdateControlsPerLine;
|
||||||
protected
|
protected
|
||||||
procedure SetItems(Value: TStrings);
|
procedure SetItems(Value: TStrings);
|
||||||
procedure SetColumns(Value: integer);
|
procedure SetColumns(Value: integer);
|
||||||
@ -748,6 +750,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Rows: integer;
|
function Rows: integer;
|
||||||
public
|
public
|
||||||
|
property AutoFill: boolean read FAutoFill write SetAutoFill;
|
||||||
property Items: TStrings read FItems write SetItems;
|
property Items: TStrings read FItems write SetItems;
|
||||||
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
|
property Checked[Index: integer]: boolean read GetChecked write SetChecked;
|
||||||
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
|
property CheckEnabled[Index: integer]: boolean read GetCheckEnabled write SetCheckEnabled;
|
||||||
|
@ -32,6 +32,8 @@ begin
|
|||||||
FButtonList := TList.Create;
|
FButtonList := TList.Create;
|
||||||
FColumnLayout := clHorizontalThenVertical;
|
FColumnLayout := clHorizontalThenVertical;
|
||||||
FColumns := 1;
|
FColumns := 1;
|
||||||
|
ChildSizing.Layout:=cclLeftToRightThenTopToBottom;
|
||||||
|
ChildSizing.ControlsPerLine:=FColumns;
|
||||||
SetInitialBounds(0,0,250,200);
|
SetInitialBounds(0,0,250,200);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -45,11 +47,30 @@ end;
|
|||||||
procedure TCustomCheckGroup.ItemsChanged(Sender: TObject);
|
procedure TCustomCheckGroup.ItemsChanged(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
UpdateItems;
|
UpdateItems;
|
||||||
|
UpdateControlsPerLine;
|
||||||
// TODO: Remove RecreateWnd
|
// TODO: Remove RecreateWnd
|
||||||
if HandleAllocated then RecreateWnd(Self);
|
if HandleAllocated then RecreateWnd(Self);
|
||||||
OwnerFormDesignerModified(Self);
|
OwnerFormDesignerModified(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCheckGroup.SetAutoFill(const AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FAutoFill=AValue then exit;
|
||||||
|
FAutoFill:=AValue;
|
||||||
|
DisableAlign;
|
||||||
|
try
|
||||||
|
if FAutoFill then begin
|
||||||
|
ChildSizing.EnlargeHorizontal:=crsHomogenousSpaceResize;
|
||||||
|
ChildSizing.EnlargeVertical:=crsHomogenousSpaceResize;
|
||||||
|
end else begin
|
||||||
|
ChildSizing.EnlargeHorizontal:=crsAnchorAligning;
|
||||||
|
ChildSizing.EnlargeVertical:=crsAnchorAligning;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
EnableAlign;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCheckGroup.Clicked(Sender: TObject);
|
procedure TCustomCheckGroup.Clicked(Sender: TObject);
|
||||||
var
|
var
|
||||||
Index: Integer;
|
Index: Integer;
|
||||||
@ -93,8 +114,18 @@ begin
|
|||||||
CheckBox:=TCheckBox(FButtonList[i]);
|
CheckBox:=TCheckBox(FButtonList[i]);
|
||||||
CheckBox.Caption:=FItems[i];
|
CheckBox.Caption:=FItems[i];
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
DoPositionButtons;
|
procedure TCustomCheckGroup.UpdateControlsPerLine;
|
||||||
|
var
|
||||||
|
NewControlsPerLine: LongInt;
|
||||||
|
begin
|
||||||
|
if ChildSizing.Layout=cclLeftToRightThenTopToBottom then
|
||||||
|
NewControlsPerLine:=Max(1,FColumns)
|
||||||
|
else
|
||||||
|
NewControlsPerLine:=((FItems.Count-1) div Max(1,FColumns))+1;
|
||||||
|
ChildSizing.ControlsPerLine:=NewControlsPerLine;
|
||||||
|
//DebugLn('TCustomCheckGroup.UpdateControlsPerLine ',dbgs(ChildSizing.Layout=cclLeftToRightThenTopToBottom),' ',dbgs(ChildSizing.ControlsPerLine));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomCheckGroup.GetCheckEnabled(Index: integer): boolean;
|
function TCustomCheckGroup.GetCheckEnabled(Index: integer): boolean;
|
||||||
@ -116,7 +147,11 @@ procedure TCustomCheckGroup.SetColumnLayout(const AValue: TColumnLayout);
|
|||||||
begin
|
begin
|
||||||
if FColumnLayout=AValue then exit;
|
if FColumnLayout=AValue then exit;
|
||||||
FColumnLayout:=AValue;
|
FColumnLayout:=AValue;
|
||||||
DoPositionButtons;
|
if FColumnLayout=clHorizontalThenVertical then
|
||||||
|
ChildSizing.Layout:=cclLeftToRightThenTopToBottom
|
||||||
|
else
|
||||||
|
ChildSizing.Layout:=cclTopToBottomThenLeftToRight;
|
||||||
|
UpdateControlsPerLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomCheckGroup.GetChecked(Index: integer): boolean;
|
function TCustomCheckGroup.GetChecked(Index: integer): boolean;
|
||||||
@ -126,50 +161,6 @@ begin
|
|||||||
Result:=TCheckBox(FButtonList[Index]).Checked;
|
Result:=TCheckBox(FButtonList[Index]).Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomCheckGroup.DoPositionButtons;
|
|
||||||
var
|
|
||||||
i : integer;
|
|
||||||
CheckBox: TCheckBox;
|
|
||||||
nextTop : integer;
|
|
||||||
nextLeft: integer;
|
|
||||||
vertDist: integer;
|
|
||||||
horzDist: integer;
|
|
||||||
rbWidth : integer;
|
|
||||||
MaxRows: Integer;
|
|
||||||
begin
|
|
||||||
if (FItems<>nil) and (FItems.Count>0) and (FColumns>0) then begin
|
|
||||||
// position in rows and columns
|
|
||||||
vertDist := (Height - 20) DIV (((FItems.Count-1) DIV FColumns)+1);
|
|
||||||
horzDist := (Width - 20) DIV FColumns;
|
|
||||||
nextTop := 0;
|
|
||||||
nextLeft := 10;
|
|
||||||
rbWidth := horzDist;
|
|
||||||
MaxRows := (FItems.Count+FColumns-1) div FColumns;
|
|
||||||
i := 0;
|
|
||||||
while i < FItems.Count do begin
|
|
||||||
CheckBox := TCheckBox(FButtonList[i]);
|
|
||||||
CheckBox.SetBounds(nextLeft,nextTop,rbWidth,vertDist);
|
|
||||||
|
|
||||||
inc (i);
|
|
||||||
if FColumnLayout=clHorizontalThenVertical then begin
|
|
||||||
if (i mod FColumns) = 0 then begin
|
|
||||||
inc(nextTop, vertDist);
|
|
||||||
nextLeft := 10;
|
|
||||||
end else begin
|
|
||||||
inc(nextLeft, horzDist);
|
|
||||||
end;
|
|
||||||
end else begin
|
|
||||||
if (i mod MaxRows) = 0 then begin
|
|
||||||
inc(nextLeft, horzDist);
|
|
||||||
nextTop := 0;
|
|
||||||
end else begin
|
|
||||||
inc(nextTop, vertDist);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomCheckGroup.SetChecked(Index: integer; const AValue: boolean);
|
procedure TCustomCheckGroup.SetChecked(Index: integer; const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if (Index < -1) or (Index >= FItems.Count) then
|
if (Index < -1) or (Index >= FItems.Count) then
|
||||||
@ -200,9 +191,7 @@ begin
|
|||||||
if (Value < 1)
|
if (Value < 1)
|
||||||
then raise Exception.Create('TCustomCheckGroup: Columns must be >= 1');
|
then raise Exception.Create('TCustomCheckGroup: Columns must be >= 1');
|
||||||
FColumns := Value;
|
FColumns := Value;
|
||||||
DoPositionButtons;
|
UpdateControlsPerLine;
|
||||||
// TODO: Remove RecreateWnd
|
|
||||||
if HandleAllocated then RecreateWnd(self);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -260,7 +249,6 @@ end;
|
|||||||
|
|
||||||
procedure TCustomCheckGroup.DoOnResize;
|
procedure TCustomCheckGroup.DoOnResize;
|
||||||
begin
|
begin
|
||||||
DoPositionButtons;
|
|
||||||
inherited DoOnResize;
|
inherited DoOnResize;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -71,6 +71,8 @@ begin
|
|||||||
FButtonList := TList.Create;
|
FButtonList := TList.Create;
|
||||||
FColumns := 1;
|
FColumns := 1;
|
||||||
FColumnLayout := clHorizontalThenVertical;
|
FColumnLayout := clHorizontalThenVertical;
|
||||||
|
ChildSizing.Layout:=cclLeftToRightThenTopToBottom;
|
||||||
|
ChildSizing.ControlsPerLine:=FColumns;
|
||||||
SetInitialBounds(0,0,250,200);
|
SetInitialBounds(0,0,250,200);
|
||||||
TabStop := True;
|
TabStop := True;
|
||||||
end;
|
end;
|
||||||
@ -147,7 +149,6 @@ begin
|
|||||||
Temp := TRadioButton(FButtonList[i]);
|
Temp := TRadioButton(FButtonList[i]);
|
||||||
Temp.Caption := FItems[i];
|
Temp.Caption := FItems[i];
|
||||||
Temp.Parent:=Self;
|
Temp.Parent:=Self;
|
||||||
Temp.SetZOrder(false);
|
|
||||||
end;
|
end;
|
||||||
with FHiddenButton do begin
|
with FHiddenButton do begin
|
||||||
FHiddenButton.Visible:=false;
|
FHiddenButton.Visible:=false;
|
||||||
@ -155,8 +156,6 @@ begin
|
|||||||
FHiddenButton.HandleNeeded;
|
FHiddenButton.HandleNeeded;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PositionButtons;
|
|
||||||
|
|
||||||
for i:=0 to FItems.Count-1 do begin
|
for i:=0 to FItems.Count-1 do begin
|
||||||
Temp := TRadioButton(FButtonList[i]);
|
Temp := TRadioButton(FButtonList[i]);
|
||||||
Temp.Checked := (i = FItemIndex);
|
Temp.Checked := (i = FItemIndex);
|
||||||
@ -190,7 +189,19 @@ end;
|
|||||||
|
|
||||||
procedure TCustomRadioGroup.ItemResize(Sender: TObject);
|
procedure TCustomRadioGroup.ItemResize(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
PositionButtons;
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomRadioGroup.UpdateControlsPerLine;
|
||||||
|
var
|
||||||
|
NewControlsPerLine: LongInt;
|
||||||
|
begin
|
||||||
|
if ChildSizing.Layout=cclLeftToRightThenTopToBottom then
|
||||||
|
NewControlsPerLine:=Max(1,FColumns)
|
||||||
|
else
|
||||||
|
NewControlsPerLine:=((FItems.Count-1) div Max(1,FColumns))+1;
|
||||||
|
ChildSizing.ControlsPerLine:=NewControlsPerLine;
|
||||||
|
//DebugLn('TCustomRadioGroup.UpdateControlsPerLine ',dbgs(ChildSizing.ControlsPerLine),' ',dbgs(NewControlsPerLine),' FColumns=',dbgs(FColumns),' FItems.Count=',dbgs(FItems.Count),' ',dbgs(ChildSizing.Layout=cclLeftToRightThenTopToBottom));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
||||||
@ -207,13 +218,13 @@ procedure TCustomRadioGroup.ItemKeyDown(Sender: TObject; var Key: Word;
|
|||||||
Count := FButtonList.Count;
|
Count := FButtonList.Count;
|
||||||
if FColumnLayout=clHorizontalThenVertical then begin
|
if FColumnLayout=clHorizontalThenVertical then begin
|
||||||
//add a row for ease wrapping
|
//add a row for ease wrapping
|
||||||
BlockSize := FColumns * (Rows+1);
|
BlockSize := Columns * (Rows+1);
|
||||||
StepSize := HorzDiff + VertDiff * FColumns;
|
StepSize := HorzDiff + VertDiff * Columns;
|
||||||
WrapOffSet := VertDiff;
|
WrapOffSet := VertDiff;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
//add a column for ease wrapping
|
//add a column for ease wrapping
|
||||||
BlockSize := (FColumns+1) * Rows;
|
BlockSize := (Columns+1) * Rows;
|
||||||
StepSize := HorzDiff * Rows + VertDiff;
|
StepSize := HorzDiff * Rows + VertDiff;
|
||||||
WrapOffSet := HorzDiff;
|
WrapOffSet := HorzDiff;
|
||||||
end;
|
end;
|
||||||
@ -248,6 +259,7 @@ end;
|
|||||||
procedure TCustomRadioGroup.ItemsChanged (Sender : TObject);
|
procedure TCustomRadioGroup.ItemsChanged (Sender : TObject);
|
||||||
begin
|
begin
|
||||||
// TODO: Remove RecreateWnd
|
// TODO: Remove RecreateWnd
|
||||||
|
UpdateControlsPerLine;
|
||||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
if HandleAllocated and (not (csLoading in ComponentState)) then
|
||||||
RecreateWnd(Self);
|
RecreateWnd(Self);
|
||||||
OwnerFormDesignerModified(Self);
|
OwnerFormDesignerModified(Self);
|
||||||
@ -268,8 +280,7 @@ begin
|
|||||||
if (Value < 1)
|
if (Value < 1)
|
||||||
then raise Exception.Create('TCustomRadioGroup: Columns must be >= 1');
|
then raise Exception.Create('TCustomRadioGroup: Columns must be >= 1');
|
||||||
FColumns := Value;
|
FColumns := Value;
|
||||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
UpdateControlsPerLine;
|
||||||
PositionButtons;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -285,6 +296,7 @@ begin
|
|||||||
if (Value <> FItems) then
|
if (Value <> FItems) then
|
||||||
begin
|
begin
|
||||||
FItems.Assign(Value);
|
FItems.Assign(Value);
|
||||||
|
UpdateControlsPerLine;
|
||||||
// TODO: Remove RecreateWnd
|
// TODO: Remove RecreateWnd
|
||||||
if HandleAllocated and (not (csLoading in ComponentState)) then
|
if HandleAllocated and (not (csLoading in ComponentState)) then
|
||||||
RecreateWnd(Self);
|
RecreateWnd(Self);
|
||||||
@ -365,7 +377,6 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomRadioGroup.Resize;
|
procedure TCustomRadioGroup.Resize;
|
||||||
begin
|
begin
|
||||||
if HandleAllocated then PositionButtons;
|
|
||||||
inherited Resize;
|
inherited Resize;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -435,69 +446,6 @@ Begin
|
|||||||
CheckItemIndexChanged;
|
CheckItemIndexChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
|
||||||
Method: TCustomRadioGroup.PositionButtons
|
|
||||||
Params: none
|
|
||||||
|
|
||||||
Set bounds of radio buttons
|
|
||||||
------------------------------------------------------------------------------}
|
|
||||||
procedure TCustomRadioGroup.PositionButtons;
|
|
||||||
var
|
|
||||||
i: integer;
|
|
||||||
CurButton: TRadioButton;
|
|
||||||
nextTop: integer;
|
|
||||||
nextLeft: integer;
|
|
||||||
vertDist: integer;
|
|
||||||
horzDist: integer;
|
|
||||||
MaxRows: Integer;
|
|
||||||
UsedColumnCount: integer;
|
|
||||||
UsedRowCount: integer;
|
|
||||||
begin
|
|
||||||
if FButtonList.Count=0 then exit;
|
|
||||||
|
|
||||||
if TRadioButton(FButtonList[0]).AutoSizeDelayed then exit;
|
|
||||||
DisableAutoSizing;
|
|
||||||
try
|
|
||||||
UsedColumnCount:=FColumns;
|
|
||||||
if UsedColumnCount<1 then UsedColumnCount:=1;
|
|
||||||
if AutoFill and (UsedColumnCount>FButtonList.Count) then
|
|
||||||
UsedColumnCount:=FButtonList.Count;
|
|
||||||
|
|
||||||
UsedRowCount:=((FButtonList.Count-1) div UsedColumnCount)+1;
|
|
||||||
|
|
||||||
// position in rows and columns
|
|
||||||
vertDist := (Height - 20) DIV UsedRowCount;
|
|
||||||
horzDist := (Width - 20) DIV UsedColumnCount;
|
|
||||||
nextTop := 0;
|
|
||||||
nextLeft := 10;
|
|
||||||
MaxRows := (FButtonList.Count+FColumns-1) div FColumns;
|
|
||||||
i := 0;
|
|
||||||
while i < FButtonList.Count do begin
|
|
||||||
CurButton := TRadioButton(FButtonList[i]);
|
|
||||||
CurButton.SetBounds(nextLeft,nextTop,CurButton.Width,CurButton.Height);
|
|
||||||
|
|
||||||
inc (i);
|
|
||||||
if FColumnLayout=clHorizontalThenVertical then begin
|
|
||||||
if (i mod FColumns) = 0 then begin
|
|
||||||
inc(nextTop, vertDist);
|
|
||||||
nextLeft := 10;
|
|
||||||
end else begin
|
|
||||||
inc(nextLeft, horzDist);
|
|
||||||
end;
|
|
||||||
end else begin
|
|
||||||
if (i mod MaxRows) = 0 then begin
|
|
||||||
inc(nextLeft, horzDist);
|
|
||||||
nextTop := 0;
|
|
||||||
end else begin
|
|
||||||
inc(nextTop, vertDist);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
EnableAutoSizing;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCustomRadioGroup.UpdateTabStops;
|
procedure TCustomRadioGroup.UpdateTabStops;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -515,14 +463,29 @@ procedure TCustomRadioGroup.SetAutoFill(const AValue: Boolean);
|
|||||||
begin
|
begin
|
||||||
if FAutoFill=AValue then exit;
|
if FAutoFill=AValue then exit;
|
||||||
FAutoFill:=AValue;
|
FAutoFill:=AValue;
|
||||||
PositionButtons;
|
DisableAlign;
|
||||||
|
try
|
||||||
|
if FAutoFill then begin
|
||||||
|
ChildSizing.EnlargeHorizontal:=crsHomogenousSpaceResize;
|
||||||
|
ChildSizing.EnlargeVertical:=crsHomogenousSpaceResize;
|
||||||
|
end else begin
|
||||||
|
ChildSizing.EnlargeHorizontal:=crsAnchorAligning;
|
||||||
|
ChildSizing.EnlargeVertical:=crsAnchorAligning;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
EnableAlign;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomRadioGroup.SetColumnLayout(const AValue: TColumnLayout);
|
procedure TCustomRadioGroup.SetColumnLayout(const AValue: TColumnLayout);
|
||||||
begin
|
begin
|
||||||
if FColumnLayout=AValue then exit;
|
if FColumnLayout=AValue then exit;
|
||||||
FColumnLayout:=AValue;
|
FColumnLayout:=AValue;
|
||||||
PositionButtons;
|
if FColumnLayout=clHorizontalThenVertical then
|
||||||
|
ChildSizing.Layout:=cclLeftToRightThenTopToBottom
|
||||||
|
else
|
||||||
|
ChildSizing.Layout:=cclTopToBottomThenLeftToRight;
|
||||||
|
UpdateControlsPerLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -496,8 +496,8 @@ var
|
|||||||
|
|
||||||
crsHomogenousSpaceResize:
|
crsHomogenousSpaceResize:
|
||||||
if ChildCount[Orientation]>0 then begin
|
if ChildCount[Orientation]>0 then begin
|
||||||
CurScale:=double(TargetSize);
|
Factor.Scale:=double(TargetSize);
|
||||||
CurOffset:=TargetSize;
|
Factor.Offset:=TargetSize;
|
||||||
ResizeableCount:=ChildCount[Orientation]+1;
|
ResizeableCount:=ChildCount[Orientation]+1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user