improved autosizing of environment files options

git-svn-id: trunk@7349 -
This commit is contained in:
mattias 2005-07-14 17:19:14 +00:00
parent e3bf68d83f
commit 93adb0af21

View File

@ -2084,30 +2084,15 @@ begin
end; end;
procedure TEnvironmentOptionsDialog.SetupFilesPage(Page: integer); procedure TEnvironmentOptionsDialog.SetupFilesPage(Page: integer);
var MaxX:integer;
begin begin
NoteBook.Page[Page].OnResize:=@OnFilesPageResize; NoteBook.Page[Page].OnResize:=@OnFilesPageResize;
MaxX:=ClientWidth-5;
MaxRecentOpenFilesLabel:=TLabel.Create(Self);
with MaxRecentOpenFilesLabel do begin
Name:='MaxRecentOpenFilesLabel';
Left:=4;
Top:=4;
Width:=170;
Height:=23;
Parent:=NoteBook.Page[Page];
Caption:=dlgMaxRecentFiles;
end;
MaxRecentOpenFilesComboBox:=TComboBox.Create(Self); MaxRecentOpenFilesComboBox:=TComboBox.Create(Self);
with MaxRecentOpenFilesComboBox do begin with MaxRecentOpenFilesComboBox do begin
Name:='MaxRecentOpenFilesComboBox'; Name:='MaxRecentOpenFilesComboBox';
Left:=MaxRecentOpenFilesLabel.Left+MaxRecentOpenFilesLabel.Width+2; Left:=4;
Top:=MaxRecentOpenFilesLabel.Top; Top:=4;
Width:=60; Width:=60;
Parent:=NoteBook.Page[Page];
with Items do begin with Items do begin
BeginUpdate; BeginUpdate;
Add('5'); Add('5');
@ -2118,26 +2103,25 @@ begin
Add('30'); Add('30');
EndUpdate; EndUpdate;
end; end;
AutoSize:=true;
Parent:=NoteBook.Page[Page];
end; end;
MaxRecentProjectFilesLabel:=TLabel.Create(Self); MaxRecentOpenFilesLabel:=TLabel.Create(Self);
with MaxRecentProjectFilesLabel do begin with MaxRecentOpenFilesLabel do begin
Name:='MaxRecentProjectFilesLabel'; Name:='MaxRecentOpenFilesLabel';
Left:=MaxRecentOpenFilesLabel.Left; AutoSize:=true;
Top:=MaxRecentOpenFilesComboBox.Top+MaxRecentOpenFilesComboBox.Height+3; Caption:=dlgMaxRecentFiles;
Width:=MaxRecentOpenFilesLabel.Width;
Height:=MaxRecentOpenFilesLabel.Height;
Parent:=NoteBook.Page[Page]; Parent:=NoteBook.Page[Page];
Caption:=dlgMaxRecentProjs; AnchorVerticalCenterTo(MaxRecentOpenFilesComboBox);
AnchorToNeighbour(akLeft,5,MaxRecentOpenFilesComboBox);
end; end;
MaxRecentProjectFilesComboBox:=TComboBox.Create(Self); MaxRecentProjectFilesComboBox:=TComboBox.Create(Self);
with MaxRecentProjectFilesComboBox do begin with MaxRecentProjectFilesComboBox do begin
Name:='MaxRecentProjectFilesComboBox'; Name:='MaxRecentProjectFilesComboBox';
Left:=MaxRecentProjectFilesLabel.Left+MaxRecentProjectFilesLabel.Width+2; Left:=4;
Top:=MaxRecentProjectFilesLabel.Top;
Width:=60; Width:=60;
Parent:=NoteBook.Page[Page];
with Items do begin with Items do begin
BeginUpdate; BeginUpdate;
Add('5'); Add('5');
@ -2148,25 +2132,36 @@ begin
Add('30'); Add('30');
EndUpdate; EndUpdate;
end; end;
AutoSize:=true;
Parent:=NoteBook.Page[Page];
AnchorToNeighbour(akTop,2,MaxRecentOpenFilesComboBox);
end; end;
MaxRecentProjectFilesLabel:=TLabel.Create(Self);
with MaxRecentProjectFilesLabel do begin
Name:='MaxRecentProjectFilesLabel';
AutoSize:=true;
Caption:=dlgMaxRecentProjs;
Parent:=NoteBook.Page[Page];
AnchorVerticalCenterTo(MaxRecentProjectFilesComboBox);
AnchorToNeighbour(akLeft,5,MaxRecentProjectFilesComboBox);
end;
OpenLastProjectAtStartCheckBox:=TCheckBox.Create(Self); OpenLastProjectAtStartCheckBox:=TCheckBox.Create(Self);
with OpenLastProjectAtStartCheckBox do begin with OpenLastProjectAtStartCheckBox do begin
Name:='OpenLastProjectAtStartCheckBox'; Name:='OpenLastProjectAtStartCheckBox';
Left:=4; AutoSize:=true;
Top:=MaxRecentProjectFilesLabel.Top+MaxRecentProjectFilesLabel.Height+5;
Width:=MaxX-10;
Height:=23;
Parent:=NoteBook.Page[Page];
Caption:=dlgQOpenLastPrj; Caption:=dlgQOpenLastPrj;
Parent:=NoteBook.Page[Page];
AnchorToNeighbour(akTop,5,MaxRecentProjectFilesComboBox);
end; end;
LazarusDirGroupBox:=TGroupBox.Create(Self); LazarusDirGroupBox:=TGroupBox.Create(Self);
with LazarusDirGroupBox do begin with LazarusDirGroupBox do begin
Name:='LazarusDirGroupBox'; Name:='LazarusDirGroupBox';
Parent:=NoteBook.Page[Page];
Caption:=dlgLazarusDir; Caption:=dlgLazarusDir;
OnResize:=@LazarusDirGroupBoxResize; OnResize:=@LazarusDirGroupBoxResize;
Parent:=NoteBook.Page[Page];
end; end;
LazarusDirComboBox:=TComboBox.Create(Self); LazarusDirComboBox:=TComboBox.Create(Self);
@ -2938,45 +2933,12 @@ end;
procedure TEnvironmentOptionsDialog.ResizeFilesPage; procedure TEnvironmentOptionsDialog.ResizeFilesPage;
var var
MaxX:integer;
y: Integer; y: Integer;
SpaceH: Integer; SpaceH: Integer;
x: Integer; x: Integer;
w: Integer; w: Integer;
h: Integer; h: Integer;
begin begin
MaxX:=MaxRecentOpenFilesLabel.Parent.ClientWidth;
with MaxRecentOpenFilesLabel do begin
Left:=4;
Top:=4;
Width:=170;
end;
with MaxRecentOpenFilesComboBox do begin
Left:=MaxRecentOpenFilesLabel.Left+MaxRecentOpenFilesLabel.Width+2;
Top:=MaxRecentOpenFilesLabel.Top;
Width:=60;
end;
with MaxRecentProjectFilesLabel do begin
Left:=MaxRecentOpenFilesLabel.Left;
Top:=MaxRecentOpenFilesComboBox.Top+MaxRecentOpenFilesComboBox.Height+3;
Width:=MaxRecentOpenFilesLabel.Width;
end;
with MaxRecentProjectFilesComboBox do begin
Left:=MaxRecentProjectFilesLabel.Left+MaxRecentProjectFilesLabel.Width+2;
Top:=MaxRecentProjectFilesLabel.Top;
Width:=60;
end;
with OpenLastProjectAtStartCheckBox do begin
Left:=4;
Top:=MaxRecentProjectFilesLabel.Top+MaxRecentProjectFilesLabel.Height+5;
Width:=MaxX-2*Left;
end;
y:=OpenLastProjectAtStartCheckBox.Top y:=OpenLastProjectAtStartCheckBox.Top
+OpenLastProjectAtStartCheckBox.Height+8; +OpenLastProjectAtStartCheckBox.Height+8;
SpaceH:=10; SpaceH:=10;