mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 17:18:25 +02:00
cleaned up New Project Dialog Resizing from Pawel
git-svn-id: trunk@6897 -
This commit is contained in:
parent
41ace17a4c
commit
3520db0335
@ -48,7 +48,6 @@ TNewProjectDialog = class(TForm)
|
|||||||
procedure ListBoxDblClick(Sender: TObject);
|
procedure ListBoxDblClick(Sender: TObject);
|
||||||
procedure ListBoxMouseUp(Sender:TObject;
|
procedure ListBoxMouseUp(Sender:TObject;
|
||||||
Button:TMouseButton; Shift:TShiftState; X,Y:integer);
|
Button:TMouseButton; Shift:TShiftState; X,Y:integer);
|
||||||
procedure NewProjectDialogResize(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
procedure FillHelpLabel;
|
procedure FillHelpLabel;
|
||||||
procedure SetupComponents;
|
procedure SetupComponents;
|
||||||
@ -85,9 +84,7 @@ begin
|
|||||||
Height:=240;
|
Height:=240;
|
||||||
Position:=poScreenCenter;
|
Position:=poScreenCenter;
|
||||||
Caption:=lisNPCreateANewProject;
|
Caption:=lisNPCreateANewProject;
|
||||||
OnResize:=@NewProjectDialogResize;
|
|
||||||
SetupComponents;
|
SetupComponents;
|
||||||
NewProjectDialogResize(nil);
|
|
||||||
FillHelpLabel;
|
FillHelpLabel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -122,8 +119,9 @@ begin
|
|||||||
Name:='ListBox';
|
Name:='ListBox';
|
||||||
Left:=5;
|
Left:=5;
|
||||||
Top:=5;
|
Top:=5;
|
||||||
Width:=150;
|
Width:=MaxX-200;
|
||||||
Height:=MaxY-50;
|
Height:=MaxY-50;
|
||||||
|
Anchors := [akTop,akLeft,akRight,akBottom];
|
||||||
with Items do begin
|
with Items do begin
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
for i:=0 to ProjectDescriptors.Count-1 do
|
for i:=0 to ProjectDescriptors.Count-1 do
|
||||||
@ -143,6 +141,7 @@ begin
|
|||||||
Top:=ListBox.Top+2;
|
Top:=ListBox.Top+2;
|
||||||
Width:=MaxX-5-Left;
|
Width:=MaxX-5-Left;
|
||||||
Height:=ListBox.Height-2;
|
Height:=ListBox.Height-2;
|
||||||
|
Anchors := [akTop,akRight,akBottom];
|
||||||
WordWrap:=true;
|
WordWrap:=true;
|
||||||
Caption:=lisNPSelectAProjectType;
|
Caption:=lisNPSelectAProjectType;
|
||||||
end;
|
end;
|
||||||
@ -155,6 +154,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Left:=Self.ClientWidth-Width*2-2*15;
|
Left:=Self.ClientWidth-Width*2-2*15;
|
||||||
Top:=Self.ClientHeight-40;
|
Top:=Self.ClientHeight-40;
|
||||||
|
Anchors := [akRight,akBottom];
|
||||||
OnClick:=@CreateButtonClick;
|
OnClick:=@CreateButtonClick;
|
||||||
Caption:=lisNPCreate;
|
Caption:=lisNPCreate;
|
||||||
end;
|
end;
|
||||||
@ -167,6 +167,7 @@ begin
|
|||||||
Height:=23;
|
Height:=23;
|
||||||
Left:=Self.ClientWidth-Width-15;
|
Left:=Self.ClientWidth-Width-15;
|
||||||
Top:=CreateButton.Top;
|
Top:=CreateButton.Top;
|
||||||
|
Anchors := [akRight,akBottom];
|
||||||
OnClick:=@CancelButtonClick;
|
OnClick:=@CancelButtonClick;
|
||||||
Caption:=dlgCancel;
|
Caption:=dlgCancel;
|
||||||
end;
|
end;
|
||||||
@ -184,7 +185,8 @@ end;
|
|||||||
|
|
||||||
procedure TNewProjectDialog.ListBoxDblClick(Sender: TObject);
|
procedure TNewProjectDialog.ListBoxDblClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CreateButtonClick(Self);
|
if ListBox.GetIndexAtY(ListBox.ScreenToClient(Mouse.CursorPos).Y) >= 0
|
||||||
|
then CreateButtonClick(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TNewProjectDialog.ListBoxMouseUp(Sender:TObject;
|
procedure TNewProjectDialog.ListBoxMouseUp(Sender:TObject;
|
||||||
@ -193,40 +195,4 @@ begin
|
|||||||
FillHelpLabel;
|
FillHelpLabel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TNewProjectDialog.NewProjectDialogResize(Sender: TObject);
|
|
||||||
var
|
|
||||||
MaxX, MaxY:integer;
|
|
||||||
begin
|
|
||||||
MaxX:=ClientWidth;
|
|
||||||
MaxY:=ClientHeight;
|
|
||||||
|
|
||||||
with ListBox do begin
|
|
||||||
Left:=5;
|
|
||||||
Top:=5;
|
|
||||||
Width:=MaxX-200;
|
|
||||||
Height:=MaxY-50;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with HelpLabel do begin
|
|
||||||
Left:=ListBox.Left+ListBox.Width+10;
|
|
||||||
Top:=ListBox.Top+2;
|
|
||||||
Width:=MaxX-5-Left;
|
|
||||||
Height:=ListBox.Height-2;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with CreateButton do begin
|
|
||||||
Width:=80;
|
|
||||||
Height:=23;
|
|
||||||
Left:=Self.ClientWidth-Width*2-2*15;
|
|
||||||
Top:=Self.ClientHeight-40;
|
|
||||||
end;
|
|
||||||
|
|
||||||
with CancelButton do begin
|
|
||||||
Width:=80;
|
|
||||||
Height:=23;
|
|
||||||
Left:=Self.ClientWidth-Width-15;
|
|
||||||
Top:=CreateButton.Top;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user