MG: added form resizes

git-svn-id: trunk@1613 -
This commit is contained in:
lazarus 2002-04-16 15:22:50 +00:00
parent dd37880074
commit be0b610692
15 changed files with 1140 additions and 59 deletions

View File

@ -61,6 +61,7 @@ type
BuildExamplesRadioGroup: TRadioGroup; BuildExamplesRadioGroup: TRadioGroup;
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure ConfigureBuildLazarusDlgResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
private private
@ -199,8 +200,11 @@ var MakeMode: TMakeMode;
begin begin
inherited Create(AnOwner); inherited Create(AnOwner);
if LazarusResources.Find(Classname)=nil then begin if LazarusResources.Find(Classname)=nil then begin
SetBounds((Screen.Width-350) div 2,(Screen.Height-320) div 2,350,320); Width:=350;
Height:=320;
Position:=poScreenCenter;
Caption:='Configure "Build Lazarus"'; Caption:='Configure "Build Lazarus"';
OnResize:=@ConfigureBuildLazarusDlgResize;
CleanAllCheckBox:=TCheckBox.Create(Self); CleanAllCheckBox:=TCheckBox.Create(Self);
with CleanAllCheckBox do begin with CleanAllCheckBox do begin
@ -297,6 +301,31 @@ begin
end; end;
end; end;
ConfigureBuildLazarusDlgResize(nil);
end;
procedure TConfigureBuildLazarusDlg.ConfigureBuildLazarusDlgResize(
Sender: TObject);
begin
CleanAllCheckBox.SetBounds(10,10,Self.ClientWidth-24,20);
BuildLCLRadioGroup.SetBounds(10,
CleanAllCheckBox.Top+CleanAllCheckBox.Height+5,
CleanAllCheckBox.Width,40);
BuildSynEditRadioGroup.SetBounds(10,
BuildLCLRadioGroup.Top+BuildLCLRadioGroup.Height+5,
BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height);
BuildCodeToolsRadioGroup.SetBounds(10,
BuildSynEditRadioGroup.Top+BuildSynEditRadioGroup.Height+5,
BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height);
BuildIDERadioGroup.SetBounds(10,
BuildCodeToolsRadioGroup.Top+BuildCodeToolsRadioGroup.Height+5,
BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height);
BuildExamplesRadioGroup.SetBounds(10,
BuildIDERadioGroup.Top+BuildIDERadioGroup.Height+5,
BuildLCLRadioGroup.Width,BuildLCLRadioGroup.Height);
OkButton.SetBounds(Self.ClientWidth-180,Self.ClientHeight-38,80,25);
CancelButton.SetBounds(Self.ClientWidth-90,OkButton.Top,
OkButton.Width,OkButton.Height);
end; end;
procedure TConfigureBuildLazarusDlg.OkButtonClick(Sender: TObject); procedure TConfigureBuildLazarusDlg.OkButtonClick(Sender: TObject);

View File

@ -25,6 +25,7 @@ type
CommentEdit:TEdit; CommentEdit:TEdit;
OkButton:TButton; OkButton:TButton;
CancelButton:TButton; CancelButton:TButton;
procedure CodeTemplateEditFormResize(Sender: TObject);
procedure OkButtonClick(Sender:TObject); procedure OkButtonClick(Sender:TObject);
public public
constructor Create(AOwner:TComponent); override; constructor Create(AOwner:TComponent); override;
@ -100,6 +101,7 @@ begin
Width:=300; Width:=300;
Height:=150; Height:=150;
Position:=poScreenCenter; Position:=poScreenCenter;
OnResize:=@CodeTemplateEditFormResize;
TokenLabel:=TLabel.Create(Self); TokenLabel:=TLabel.Create(Self);
with TokenLabel do begin with TokenLabel do begin
@ -169,6 +171,46 @@ begin
Show; Show;
end; end;
end; end;
CodeTemplateEditFormResize(nil);
end;
procedure TCodeTemplateEditForm.CodeTemplateEditFormResize(Sender: TObject);
begin
with TokenLabel do begin
Left:=12;
Top:=6;
Width:=Self.ClientWidth-Left-Left;
end;
with TokenEdit do begin
Left:=10;
Top:=TokenLabel.Top+TokenLabel.Height+2;
Width:=Self.ClientWidth-Left-Left-4;
end;
with CommentLabel do begin
Left:=12;
Top:=TokenEdit.Top+TokenEdit.Height+10;
Width:=Self.ClientWidth-Left-Left;
end;
with CommentEdit do begin
Left:=10;
Top:=CommentLabel.Top+CommentLabel.Height+2;
Width:=Self.ClientWidth-Left-Left-4;
end;
with OkButton do begin
Left:=50;
Top:=Self.ClientHeight-Height-12;
Width:=80;
end;
with CancelButton do begin
Width:=80;
Left:=Self.ClientWidth-50-Width;
Top:=Self.ClientHeight-Height-12;
end;
end; end;
procedure TCodeTemplateEditForm.OkButtonClick(Sender:TObject); procedure TCodeTemplateEditForm.OkButtonClick(Sender:TObject);

View File

@ -161,7 +161,7 @@ type
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure FormResize(Sender: TObject); procedure CodeToolsOptsDlgResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure UpdateExamples(Sender: TObject); procedure UpdateExamples(Sender: TObject);
@ -172,6 +172,10 @@ type
procedure SetupCodeCreationPage; procedure SetupCodeCreationPage;
procedure SetupLineSplittingPage; procedure SetupLineSplittingPage;
procedure SetupSpacePage; procedure SetupSpacePage;
procedure ResizeGeneralPage;
procedure ResizeCodeCreationPage;
procedure ResizeLineSplittingPage;
procedure ResizeSpacePage;
procedure CreateAtomCheckBoxes(ParentGroupBox: TGroupBox; procedure CreateAtomCheckBoxes(ParentGroupBox: TGroupBox;
AtomTypes: TAtomTypes; Columns: integer); AtomTypes: TAtomTypes; Columns: integer);
procedure SetAtomCheckBoxes(AtomTypes: TAtomTypes; procedure SetAtomCheckBoxes(AtomTypes: TAtomTypes;
@ -566,8 +570,11 @@ constructor TCodeToolsOptsDlg.Create(AnOwner: TComponent);
begin begin
inherited Create(AnOwner); inherited Create(AnOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
SetBounds((Screen.Width-480) div 2,(Screen.Height-430) div 2, 485, 435); Width:=485;
Height:=435;
Position:=poScreenCenter;
Caption:='CodeTools Options'; Caption:='CodeTools Options';
OnResize:=@CodeToolsOptsDlgResize;
NoteBook:=TNoteBook.Create(Self); NoteBook:=TNoteBook.Create(Self);
with NoteBook do begin with NoteBook do begin
@ -614,6 +621,7 @@ begin
end; end;
end; end;
BeautifyCodeOptions:=TBeautifyCodeOptions.Create; BeautifyCodeOptions:=TBeautifyCodeOptions.Create;
CodeToolsOptsDlgResize(nil);
UpdateExamples(Self); UpdateExamples(Self);
end; end;
@ -1004,9 +1012,220 @@ begin
end; end;
end; end;
procedure TCodeToolsOptsDlg.FormResize(Sender: TObject); procedure TCodeToolsOptsDlg.ResizeGeneralPage;
begin begin
// ToDo with SrcPathGroupBox do begin
SetBounds(8,7,Self.ClientWidth-20,51);
end;
with SrcPathEdit do begin
SetBounds(5,6,Parent.ClientWidth-14,Height);
end;
with JumpingGroupBox do begin
SetBounds(8,SrcPathGroupBox.Top+SrcPathGroupBox.Height+7,
SrcPathGroupBox.Width,95);
end;
with AdjustTopLineDueToCommentCheckBox do begin
SetBounds(5,6,Parent.ClientWidth-10,Height);
end;
with JumpCenteredCheckBox do begin
SetBounds(AdjustTopLineDueToCommentCheckBox.Left,
AdjustTopLineDueToCommentCheckBox.Top+2
+AdjustTopLineDueToCommentCheckBox.Height,
AdjustTopLineDueToCommentCheckBox.Width,Height);
end;
with CursorBeyondEOLCheckBox do begin
SetBounds(JumpCenteredCheckBox.Left,
JumpCenteredCheckBox.Top+JumpCenteredCheckBox.Height+2,
JumpCenteredCheckBox.Width,Height);
end;
end;
procedure TCodeToolsOptsDlg.ResizeCodeCreationPage;
begin
with ClassPartInsertPolicyRadioGroup do begin
SetBounds(8,6,
(Self.ClientWidth div 2)-12,80);
end;
with MethodInsertPolicyRadioGroup do begin
SetBounds(ClassPartInsertPolicyRadioGroup.Left
+ClassPartInsertPolicyRadioGroup.Width+8,
ClassPartInsertPolicyRadioGroup.Top,
ClassPartInsertPolicyRadioGroup.Width,
ClassPartInsertPolicyRadioGroup.Height);
end;
with KeyWordPolicyRadioGroup do begin
SetBounds(ClassPartInsertPolicyRadioGroup.Left,
ClassPartInsertPolicyRadioGroup.Top
+ClassPartInsertPolicyRadioGroup.Height+7,
(Self.ClientWidth div 2)-12,100);
end;
with IdentifierPolicyRadioGroup do begin
SetBounds(KeyWordPolicyRadioGroup.Left+KeyWordPolicyRadioGroup.Width+8,
KeyWordPolicyRadioGroup.Top,
KeyWordPolicyRadioGroup.Width,KeyWordPolicyRadioGroup.Height);
end;
with PropertyCompletionGroupBox do begin
SetBounds(KeyWordPolicyRadioGroup.Left,
KeyWordPolicyRadioGroup.Top+KeyWordPolicyRadioGroup.Height+7,
Self.ClientWidth-20,125);
end;
with PropertyCompletionCheckBox do begin
SetBounds(6,5,200,Height);
end;
with PropertyReadIdentPrefixLabel do begin
SetBounds(PropertyCompletionCheckBox.Left,
PropertyCompletionCheckBox.Top+PropertyCompletionCheckBox.Height+5,
100,Height);
end;
with PropertyReadIdentPrefixEdit do begin
SetBounds(110,PropertyReadIdentPrefixLabel.Top,80,Height);
end;
with PropertyWriteIdentPrefixLabel do begin
SetBounds(6,PropertyReadIdentPrefixLabel.Top
+PropertyReadIdentPrefixLabel.Height+5,
PropertyReadIdentPrefixLabel.Width,Height);
end;
with PropertyWriteIdentPrefixEdit do begin
SetBounds(PropertyReadIdentPrefixEdit.Left,
PropertyWriteIdentPrefixLabel.Top,80,Height);
end;
with PropertyStoredIdentPostfixLabel do begin
SetBounds(6,PropertyWriteIdentPrefixLabel.Top
+PropertyWriteIdentPrefixLabel.Height+5,
PropertyReadIdentPrefixLabel.Width,Height);
end;
with PropertyStoredIdentPostfixEdit do begin
SetBounds(PropertyReadIdentPrefixEdit.Left,
PropertyStoredIdentPostfixLabel.Top,80,Height);
end;
with PrivatVariablePrefixLabel do begin
SetBounds((PropertyCompletionGroupBox.ClientWidth-20) div 2,
PropertyReadIdentPrefixLabel.Top,120,Height);
end;
with PrivatVariablePrefixEdit do begin
SetBounds(PrivatVariablePrefixLabel.Left+150,PrivatVariablePrefixLabel.Top,
80,Height);
end;
with SetPropertyVariablenameLabel do begin
SetBounds(PrivatVariablePrefixLabel.Left,
PrivatVariablePrefixLabel.Top+PrivatVariablePrefixLabel.Height+5,
120,Height);
end;
with SetPropertyVariablenameEdit do begin
SetBounds(PrivatVariablePrefixEdit.Left,
PrivatVariablePrefixLabel.Top+PrivatVariablePrefixLabel.Height+5,
80,Height);
end;
end;
procedure TCodeToolsOptsDlg.ResizeLineSplittingPage;
begin
with LineLengthLabel do begin
SetBounds(8,7,Canvas.TextWidth('Max line length: '),Height);
end;
with LineLengthEdit do begin
Left:=LineLengthLabel.Left+LineLengthLabel.Width+5;
Top:=LineLengthLabel.Top-2;
Width:=50;
end;
with DoNotSplitLineInFrontGroupBox do begin
SetBounds(6,LineLengthLabel.Top+LineLengthLabel.Height+7,
(Self.ClientWidth-24) div 2,150);
end;
with DoNotSplitLineAfterGroupBox do begin
SetBounds(DoNotSplitLineInFrontGroupBox.Left,
DoNotSplitLineInFrontGroupBox.Top+DoNotSplitLineInFrontGroupBox.Height+7,
DoNotSplitLineInFrontGroupBox.Width,
DoNotSplitLineInFrontGroupBox.Height);
end;
with SplitPreviewGroupBox do begin
Left:=DoNotSplitLineInFrontGroupBox.Left
+DoNotSplitLineInFrontGroupBox.Width+8;
Top:=LineLengthLabel.Top;
Width:=Self.ClientWidth-10-Left;
Height:=Self.ClientHeight-92-Top;
end;
with SplitPreviewSynEdit do begin
SetBounds(2,2,Parent.ClientWidth-8,Parent.ClientHeight-25);
end;
end;
procedure TCodeToolsOptsDlg.ResizeSpacePage;
begin
with DoInsertSpaceInFrontGroupBox do begin
SetBounds(6,6,
(Self.ClientWidth-24) div 2,150);
end;
with DoInsertSpaceAfterGroupBox do begin
SetBounds(DoInsertSpaceInFrontGroupBox.Left
+DoInsertSpaceInFrontGroupBox.Width+8,
DoInsertSpaceInFrontGroupBox.Top,
DoInsertSpaceInFrontGroupBox.Width,
DoInsertSpaceInFrontGroupBox.Height);
end;
with SpacePreviewGroupBox do begin
Left:=DoInsertSpaceInFrontGroupBox.Left;
Top:=DoInsertSpaceInFrontGroupBox.Top+DoInsertSpaceInFrontGroupBox.Height+7;
Width:=Self.ClientWidth-10-Left;
Height:=Self.ClientHeight-92-Top;
end;
with SpacePreviewSynEdit do begin
SetBounds(2,2,Parent.ClientWidth-8,Parent.ClientHeight-25);
end;
end;
procedure TCodeToolsOptsDlg.CodeToolsOptsDlgResize(Sender: TObject);
begin
with NoteBook do begin
SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50);
end;
ResizeGeneralPage;
ResizeCodeCreationPage;
ResizeLineSplittingPage;
ResizeSpacePage;
with CancelButton do begin
Width:=70;
Height:=23;
Left:=Self.ClientWidth-Width-15;
Top:=Self.ClientHeight-Height-15;
end;
with OkButton do begin
Width:=CancelButton.Width;
Height:=CancelButton.Height;
Left:=CancelButton.Left-15-Width;
Top:=CancelButton.Top;
end;
end; end;
procedure TCodeToolsOptsDlg.CreateAtomCheckBoxes(ParentGroupBox: TGroupBox; procedure TCodeToolsOptsDlg.CreateAtomCheckBoxes(ParentGroupBox: TGroupBox;

View File

@ -90,6 +90,7 @@ type
MoveDownButton: TButton; MoveDownButton: TButton;
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure ExternalToolDialogResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure AddButtonClick(Sender: TObject); procedure AddButtonClick(Sender: TObject);
@ -394,9 +395,11 @@ constructor TExternalToolDialog.Create(AnOwner: TComponent);
begin begin
inherited Create(AnOwner); inherited Create(AnOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
Width:=400;
Height:=400;
Position:=poScreenCenter;
Caption:='External Tools'; Caption:='External Tools';
SetBounds((Screen.Width-400) div 2,(Screen.Height-400) div 2,400,400); OnResize:=@ExternalToolDialogResize;
Listbox:=TListbox.Create(Self); Listbox:=TListbox.Create(Self);
with Listbox do begin with Listbox do begin
@ -481,6 +484,7 @@ begin
end; end;
end; end;
fExtToolList:=TExternalToolList.Create; fExtToolList:=TExternalToolList.Create;
ExternalToolDialogResize(nil);
end; end;
destructor TExternalToolDialog.Destroy; destructor TExternalToolDialog.Destroy;
@ -489,6 +493,44 @@ begin
inherited Destroy; inherited Destroy;
end; end;
procedure TExternalToolDialog.ExternalToolDialogResize(Sender: TObject);
begin
with Listbox do begin
SetBounds(5,5,Self.ClientWidth-120,Self.Clientheight-60);
end;
with AddButton do begin
SetBounds(Self.ClientWidth-100,5,80,25);
end;
with RemoveButton do begin
SetBounds(Self.ClientWidth-100,AddButton.Top+AddButton.Height+10,80,25);
end;
with EditButton do begin
SetBounds(Self.ClientWidth-100,RemoveButton.Top+RemoveButton.Height+10,
80,25);
end;
with MoveUpButton do begin
SetBounds(Self.ClientWidth-100,EditButton.Top+EditButton.Height+50,
80,25);
end;
with MoveDownButton do begin
SetBounds(Self.ClientWidth-100,MoveUpButton.Top+MoveUpButton.Height+10,
80,25);
end;
with OkButton do begin
SetBounds(Self.ClientWidth-200, Self.ClientHeight-40,80,25);
end;
with CancelButton do begin
SetBounds(Self.ClientWidth-100, Self.ClientHeight-40,80,25);
end;
end;
procedure TExternalToolDialog.OkButtonClick(Sender: TObject); procedure TExternalToolDialog.OkButtonClick(Sender: TObject);
begin begin
ModalResult:=mrOk; ModalResult:=mrOk;

View File

@ -105,6 +105,7 @@ type
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure ExternalToolOptionDlgResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure FormKeyUp(Sender: TObject; var Key: Word; Shift:TShiftState); procedure FormKeyUp(Sender: TObject; var Key: Word; Shift:TShiftState);
procedure KeyGrabButtonClick(Sender: TObject); procedure KeyGrabButtonClick(Sender: TObject);
@ -251,9 +252,11 @@ begin
inherited Create(AnOwner); inherited Create(AnOwner);
GrabbingKey:=0; GrabbingKey:=0;
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
Width:=560;
Height:=450;
Caption:='Edit Tool'; Caption:='Edit Tool';
SetBounds((Screen.Width-560) div 2,(Screen.Height-450) div 2,560,450); Position:=poScreenCenter;
OnResize:=@ExternalToolOptionDlgResize;
OnKeyUp:=@FormKeyUp; OnKeyUp:=@FormKeyUp;
TitleLabel:=TLabel.Create(Self); TitleLabel:=TLabel.Create(Self);
@ -499,6 +502,7 @@ begin
end; end;
end; end;
fOptions:=TExternalToolOptions.Create; fOptions:=TExternalToolOptions.Create;
ExternalToolOptionDlgResize(nil);
end; end;
destructor TExternalToolOptionDlg.Destroy; destructor TExternalToolOptionDlg.Destroy;
@ -559,6 +563,132 @@ begin
ModalResult:=mrCancel; ModalResult:=mrCancel;
end; end;
procedure TExternalToolOptionDlg.ExternalToolOptionDlgResize(Sender: TObject);
begin
with TitleLabel do begin
SetBounds(5,5,110,22);
end;
with TitleEdit do begin
Left:=TitleLabel.Left+TitleLabel.Width+5;
Top:=TitleLabel.Top+2;
Width:=Self.ClientWidth-Left-10;
Height:=25;
end;
with FilenameLabel do begin
SetBounds(TitleLabel.Left,TitleLabel.Top+TitleLabel.Height+10,
TitleLabel.Width,TitleLabel.Height);
end;
with FilenameEdit do begin
SetBounds(TitleEdit.Left,FilenameLabel.Top+2,TitleEdit.Width,
TitleEdit.Height);
end;
with ParametersLabel do begin
SetBounds(FilenameLabel.Left,FilenameLabel.Top+FilenameLabel.Height+10,
FilenameLabel.Width,FilenameLabel.Height);
end;
with ParametersEdit do begin
SetBounds(FilenameEdit.Left,ParametersLabel.Top+2,FilenameEdit.Width,
FilenameEdit.Height);
end;
with WorkingDirLabel do begin
SetBounds(ParametersLabel.Left,
ParametersLabel.Top+ParametersLabel.Height+10,ParametersLabel.Width,
ParametersLabel.Height);
end;
with WorkingDirEdit do begin
SetBounds(ParametersEdit.Left,WorkingDirLabel.Top+2,ParametersEdit.Width,
ParametersEdit.Height);
end;
with OptionsGroupBox do begin
Left:=5;
Top:=WorkingDirLabel.Top+WorkingDirLabel.Height+12;
Width:=Self.ClientWidth-Left-Left;
Height:=66;
end;
with OptionScanOutputForFPCMessagesCheckBox do begin
SetBounds(5,2,400,20);
end;
with OptionScanOutputForMakeMessagesCheckBox do begin
SetBounds(5,OptionScanOutputForFPCMessagesCheckBox.Top
+OptionScanOutputForFPCMessagesCheckBox.Height+4,400,20);
end;
with KeyGroupBox do begin
Left:=5;
Top:=OptionsGroupBox.Top+OptionsGroupBox.Height+12;
Width:=Self.ClientWidth-Left-Left;
Height:=50;
end;
with KeyCtrlCheckBox do begin
Left:=5;
Top:=2;
Width:=45;
Height:=20;
end;
with KeyAltCheckBox do begin
Left:=KeyCtrlCheckBox.Left+KeyCtrlCheckBox.Width+5;
Top:=KeyCtrlCheckBox.Top;
Height:=20;
Width:=KeyCtrlCheckBox.Width;
end;
with KeyShiftCheckBox do begin
Left:=KeyAltCheckBox.Left+KeyAltCheckBox.Width+5;
Top:=KeyCtrlCheckBox.Top;
Height:=20;
Width:=KeyCtrlCheckBox.Width;
end;
with KeyComboBox do begin
Left:=KeyShiftCheckBox.Left+KeyShiftCheckBox.Width+5;
Top:=KeyCtrlCheckBox.Top;
Width:=190;
end;
with KeyGrabButton do begin
Left:=KeyComboBox.Left+KeyComboBox.Width+5;
Top:=KeyCtrlCheckBox.Top;
Width:=100;
Height:=25;
end;
with MacrosGroupbox do begin
Left:=KeyGroupBox.Left;
Top:=KeyGroupBox.Top+KeyGroupBox.Height+10;
Width:=KeyGroupBox.Width;
Height:=Self.ClientHeight-50-Top;
end;
with MacrosListbox do begin
SetBounds(5,5,MacrosGroupbox.ClientWidth-120,
MacrosGroupbox.ClientHeight-30);
end;
with MacrosInsertButton do begin
SetBounds(MacrosGroupbox.ClientWidth-90,5,70,25);
end;
with OkButton do begin
SetBounds(270,Self.ClientHeight-40,100,25);
end;
with CancelButton do begin
SetBounds(390,OkButton.Top,100,25);
end;
end;
procedure TExternalToolOptionDlg.KeyGrabButtonClick(Sender: TObject); procedure TExternalToolOptionDlg.KeyGrabButtonClick(Sender: TObject);
begin begin
ActivateGrabbing(1); ActivateGrabbing(1);

View File

@ -12,16 +12,6 @@
Abstract: Abstract:
Find in files dialog form. Find in files dialog form.
Usage:
Add to program
"Application.CreateForm(TLazFindInFilesDialog, FindInFilesDlg);"
Set the FindInFilesDlg.Options poperty
then do MResult:=FindInFilesDlg.ShowModal
ShowModal can have three possible results:
- mrOk for Find in files.
- mrCancel for Cancel
ToDo:
} }
unit FindInFilesDlg; unit FindInFilesDlg;
@ -36,8 +26,6 @@ uses
type type
TLazFindInFilesDialog = class(TForm) TLazFindInFilesDialog = class(TForm)
private
published
TextToFindLabel: TLabel; TextToFindLabel: TLabel;
TextToFindEdit: TEdit; TextToFindEdit: TEdit;
OptionsGroupBox: TGroupBox; OptionsGroupBox: TGroupBox;
@ -54,6 +42,7 @@ type
IncludeSubDirsCheckBox: TCheckBox; IncludeSubDirsCheckBox: TCheckBox;
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure LazFindInFilesDialogResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
public public
@ -73,7 +62,10 @@ begin
inherited Create(AOwner); inherited Create(AOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
Caption:='Find in files'; Caption:='Find in files';
SetBounds((Screen.Width-320) div 2,(Screen.Height-430) div 2,320,430); Width:=320;
Height:=430;
Position:=poScreenCenter;
OnResize:=@LazFindInFilesDialogResize;
TextToFindLabel:=TLabel.Create(Self); TextToFindLabel:=TLabel.Create(Self);
with TextToFindLabel do begin with TextToFindLabel do begin
@ -239,6 +231,89 @@ begin
Visible:=true; Visible:=true;
end; end;
end; end;
LazFindInFilesDialogResize(nil);
end;
procedure TLazFindInFilesDialog.LazFindInFilesDialogResize(Sender: TObject);
begin
with TextToFindLabel do begin
SetBounds(8,8,80,Height);
end;
with TextToFindEdit do begin
SetBounds(TextToFindLabel.Left+TextToFindLabel.Width+5,
TextToFindLabel.Top-2,
Self.ClientWidth-TextToFindLabel.Left-TextToFindLabel.Width-13,
Height);
end;
with OptionsGroupBox do begin
SetBounds(8,TextToFindLabel.Top+TextToFindLabel.Height+10,
Self.ClientWidth-20,95);
end;
with CaseSensitiveCheckBox do begin
SetBounds(8,2,OptionsGroupBox.ClientWidth-20,20);
end;
with WholeWordsOnlyCheckBox do begin
SetBounds(CaseSensitiveCheckBox.Left,
CaseSensitiveCheckBox.Top+CaseSensitiveCheckBox.Height+5,
CaseSensitiveCheckBox.Width,20);
end;
with RegularExpressionsCheckBox do begin
SetBounds(CaseSensitiveCheckBox.Left,
WholeWordsOnlyCheckBox.Top+WholeWordsOnlyCheckBox.Height+5,
CaseSensitiveCheckBox.Width,20);
end;
with WhereRadioGroup do begin
SetBounds(8,OptionsGroupBox.Top+OptionsGroupBox.Height+10,
Self.ClientWidth-20,90);
end;
with DirectoryOptionsGroupBox do begin
SetBounds(8,WhereRadioGroup.Top+WhereRadioGroup.Height+10,
Self.ClientWidth-20,135);
end;
with DirectoryLabel do begin
SetBounds(8,5,80,Height);
end;
with DirectoryComboBox do begin
Left:=DirectoryLabel.Left+DirectoryLabel.Width+5;
Top:=DirectoryLabel.Top-2;
Width:=Parent.ClientWidth-Left-8-25-5;
end;
with DirectoryBrowse do begin
SetBounds(DirectoryComboBox.Left+DirectoryComboBox.Width+5,
DirectoryComboBox.Top,25,25);
end;
with FileMaskLabel do begin
SetBounds(8,DirectoryComboBox.Top+DirectoryComboBox.Height+5,200,Height);
end;
with FileMaskComboBox do begin
SetBounds(FileMaskLabel.Left, FileMaskLabel.Top+FileMaskLabel.Height+3,
Self.ClientWidth-20-5-25,Height);
end;
with IncludeSubDirsCheckBox do begin
SetBounds(8,FileMaskComboBox.Top+FileMaskComboBox.Height+10,
150,Height);
end;
with OkButton do begin
SetBounds(Self.ClientWidth-200,Self.ClientHeight-40,80,Height);
end;
with CancelButton do begin
SetBounds(Self.ClientWidth-100,Self.ClientHeight-40,80,Height);
end;
end; end;
procedure TLazFindInFilesDialog.OkButtonClick(Sender: TObject); procedure TLazFindInFilesDialog.OkButtonClick(Sender: TObject);

View File

@ -37,6 +37,7 @@ type
DataEdit: TEdit; DataEdit: TEdit;
OkButton: TButton; OkButton: TButton;
CancelButton: TButton; CancelButton: TButton;
procedure MacroPrompDialogResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure DataEditKeyDown(Sender: TObject; var Key:Word; Shift:TShiftState); procedure DataEditKeyDown(Sender: TObject; var Key:Word; Shift:TShiftState);
@ -72,9 +73,11 @@ constructor TMacroPrompDialog.Create(AnOwner: TComponent);
begin begin
inherited Create(AnOwner); inherited Create(AnOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
Width:=300;
Height:=150;
Position:=poScreenCenter;
Caption:='Enter data'; Caption:='Enter data';
SetBounds((Screen.Width-300) div 2,(Screen.Height-150) div 2,300,150); OnResize:=@MacroPrompDialogResize;
NoteLabel:=TLabel.Create(Self); NoteLabel:=TLabel.Create(Self);
with NoteLabel do begin with NoteLabel do begin
@ -115,9 +118,29 @@ begin
end; end;
end; end;
MacroPrompDialogResize(nil);
DataEdit.SetFocus; DataEdit.SetFocus;
end; end;
procedure TMacroPrompDialog.MacroPrompDialogResize(Sender: TObject);
begin
with NoteLabel do begin
SetBounds(8,8,200,25);
end;
with DataEdit do begin
SetBounds(8,NoteLabel.Top+NoteLabel.Height+5,Self.ClientWidth-20,25);
end;
with OkButton do begin
SetBounds(Self.ClientWidth-200,Self.ClientHeight-40,80,25);
end;
with CancelButton do begin
SetBounds(Self.ClientWidth-100,Self.ClientHeight-40,80,25);
end;
end;
procedure TMacroPrompDialog.OkButtonClick(Sender: TObject); procedure TMacroPrompDialog.OkButtonClick(Sender: TObject);
begin begin
ModalResult:=mrOk; ModalResult:=mrOk;

View File

@ -25,6 +25,7 @@ type
procedure CancelButtonClick(Sender:TObject); procedure CancelButtonClick(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;
public public
@ -64,8 +65,11 @@ var pt:TProjectType;
begin begin
inherited Create(AOwner); inherited Create(AOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
SetBounds((Screen.Width-300) div 2,(Screen.Height-250) div 2,390,240); Width:=390;
Height:=240;
Position:=poScreenCenter;
Caption:='Create a new project'; Caption:='Create a new project';
OnResize:=@NewProjectDialogResize;
MaxX:=386; MaxX:=386;
MaxY:=238; MaxY:=238;
@ -128,6 +132,7 @@ begin
end; end;
end; end;
NewProjectDialogResize(nil);
FillHelpLabel; FillHelpLabel;
end; end;
@ -161,4 +166,40 @@ 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.

View File

@ -67,12 +67,16 @@ type
procedure FormsRemoveFromAutoCreatedFormsBtnClick(Sender: TObject); procedure FormsRemoveFromAutoCreatedFormsBtnClick(Sender: TObject);
procedure FormsMoveAutoCreatedFormUpBtnClick(Sender: TObject); procedure FormsMoveAutoCreatedFormUpBtnClick(Sender: TObject);
procedure FormsMoveAutoCreatedFormDownBtnClick(Sender: TObject); procedure FormsMoveAutoCreatedFormDownBtnClick(Sender: TObject);
procedure ProjectOptionsDialogResize(Sender: TObject);
private private
FProject: TProject; FProject: TProject;
procedure SetProject(AProject: TProject); procedure SetProject(AProject: TProject);
procedure SetupApplicationPage; procedure SetupApplicationPage;
procedure SetupFormsPage; procedure SetupFormsPage;
procedure SetupInfoPage; procedure SetupInfoPage;
procedure ResizeApplicationPage;
procedure ResizeFormsPage;
procedure ResizeInfoPage;
procedure FillAutoCreateFormsListbox; procedure FillAutoCreateFormsListbox;
procedure FillAvailFormsListBox; procedure FillAvailFormsListBox;
function IndexOfAutoCreateForm(FormName: string): integer; function IndexOfAutoCreateForm(FormName: string): integer;
@ -113,7 +117,10 @@ constructor TProjectOptionsDialog.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
SetBounds((Screen.Width-440) div 2,(Screen.Height-385) div 2,430,375); Width:=430;
Height:=375;
Position:=poScreenCenter;
OnResize:=@ProjectOptionsDialogResize;
Caption:='Project Options'; Caption:='Project Options';
NoteBook:=TNoteBook.Create(Self); NoteBook:=TNoteBook.Create(Self);
@ -157,6 +164,7 @@ begin
Show; Show;
end; end;
end; end;
ProjectOptionsDialogResize(nil);
end; end;
procedure TProjectOptionsDialog.SetupApplicationPage; procedure TProjectOptionsDialog.SetupApplicationPage;
@ -380,6 +388,140 @@ begin
end; end;
end; end;
procedure TProjectOptionsDialog.ResizeApplicationPage;
var MaxX:integer;
begin
MaxX:=ClientWidth-5;
with AppSettingsGroupBox do begin
Left:=5;
Top:=5;
Width:=MaxX-2*Left;
Height:=60;
end;
with TitleLabel do begin
Left:=5;
Top:=1;
Width:=50;
Height:=23;
end;
with TitleEdit do begin
Left:=TitleLabel.Left+TitleLabel.Width+2;
Top:=TitleLabel.Top+4;
Width:=AppSettingsGroupBox.ClientWidth-Left-10;
end;
with OutputSettingsGroupBox do begin
Left:=AppSettingsGroupBox.Left;
Top:=AppSettingsGroupBox.Top+AppSettingsGroupBox.Height+5;
Width:=AppSettingsGroupBox.Width;
Height:=60;
end;
with TargetFileLabel do begin
Left:=5;
Top:=1;
Width:=100;
Height:=23;
end;
with TargetFileEdit do begin
Left:=TargetFileLabel.Left+TargetFileLabel.Width+5;
Top:=TargetFileLabel.Top+4;
Width:=OutputSettingsGroupBox.Width-Left-10;
end;
end;
procedure TProjectOptionsDialog.ResizeFormsPage;
var MaxX, MaxY, ListBoxWidth, ListBoxHeight: integer;
begin
MaxX:=ClientWidth-8;
MaxY:=ClientHeight-75;
ListBoxWidth:=(MaxX-95) div 2;
ListBoxHeight:=MaxY-70;
with FormsAutoCreatedLabel do begin
Left:=40;
Top:=1;
Width:=190;
end;
with FormsAutoCreatedListBox do begin
Left:=FormsAutoCreatedLabel.Left;
Top:=FormsAutoCreatedLabel.Top+FormsAutoCreatedLabel.Height+3;
Width:=ListBoxWidth;
Height:=ListBoxHeight;
end;
with FormsAvailFormsLabel do begin
Left:=FormsAutoCreatedListBox.Left+FormsAutoCreatedListBox.Width+45;
Top:=FormsAutoCreatedLabel.Top;
Width:=FormsAutoCreatedLabel.Width;
Height:=FormsAutoCreatedLabel.Height;
end;
with FormsAvailFormsListBox do begin
Left:=FormsAvailFormsLabel.Left;
Top:=FormsAutoCreatedListBox.Top;
Width:=FormsAutoCreatedListBox.Width;
Height:=FormsAutoCreatedListBox.Height;
end;
with FormsAddToAutoCreatedFormsBtn do begin
Left:=FormsAutoCreatedListBox.Left+FormsAutoCreatedListBox.Width+10;
Top:=FormsAutoCreatedListBox.Top+80;
Width:=25;
Height:=25;
end;
with FormsRemoveFromAutoCreatedFormsBtn do begin
Left:=FormsAddToAutoCreatedFormsBtn.Left;
Top:=FormsAddToAutoCreatedFormsBtn.Top
+FormsAddToAutoCreatedFormsBtn.Height+10;
Width:=25;
Height:=25;
end;
with FormsMoveAutoCreatedFormUpBtn do begin
Left:=FormsAutoCreatedListBox.Left-35;
Top:=FormsAutoCreatedListBox.Top+80;
Width:=25;
Height:=25;
end;
with FormsMoveAutoCreatedFormDownBtn do begin
Left:=FormsMoveAutoCreatedFormUpBtn.Left;
Top:=FormsMoveAutoCreatedFormUpBtn.Top
+FormsMoveAutoCreatedFormUpBtn.Height+10;
Width:=25;
Height:=25;
end;
with FormsAutoCreateNewFormsCheckBox do begin
Left:=FormsMoveAutoCreatedFormUpBtn.Left;
Top:=FormsAutoCreatedListBox.Top+FormsAutoCreatedListBox.Height+5;
Width:=200;
Height:=25;
end;
end;
procedure TProjectOptionsDialog.ResizeInfoPage;
begin
with SaveClosedUnitInfoCheckBox do begin
Left:=10;
Top:=10;
Width:=250;
end;
with SaveOnlyProjectUnitInfoCheckBox do begin
Left:=SaveClosedUnitInfoCheckBox.Left;
Top:=SaveClosedUnitInfoCheckBox.Top+SaveClosedUnitInfoCheckBox.Height+10;
Width:=SaveClosedUnitInfoCheckBox.Width;
end;
end;
procedure TProjectOptionsDialog.SetProject(AProject: TProject); procedure TProjectOptionsDialog.SetProject(AProject: TProject);
begin begin
FProject:=AProject; FProject:=AProject;
@ -600,6 +742,31 @@ begin
SelectOnlyThisAutoCreateForm(i+1); SelectOnlyThisAutoCreateForm(i+1);
end; end;
procedure TProjectOptionsDialog.ProjectOptionsDialogResize(Sender: TObject);
begin
with NoteBook do begin
SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50);
end;
ResizeFormsPage;
ResizeApplicationPage;
ResizeInfoPage;
with CancelButton do begin
Width:=70;
Height:=23;
Left:=Self.ClientWidth-Width-15;
Top:=Self.ClientHeight-Height-15;
end;
with OkButton do begin
Width:=CancelButton.Width;
Height:=CancelButton.Height;
Left:=CancelButton.Left-15-Width;
Top:=CancelButton.Top;
end;
end;
procedure TProjectOptionsDialog.SelectOnlyThisAutoCreateForm( procedure TProjectOptionsDialog.SelectOnlyThisAutoCreateForm(
Index: integer); Index: integer);
var i: integer; var i: integer;

View File

@ -120,6 +120,7 @@ type
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure HostApplicationBrowseBtnClick(Sender: TObject); procedure HostApplicationBrowseBtnClick(Sender: TObject);
procedure RunParamsOptsDlgResize(Sender: TObject);
procedure WorkingDirectoryBtnClick(Sender: TObject); procedure WorkingDirectoryBtnClick(Sender: TObject);
procedure UserOverridesAddButtonClick(Sender: TObject); procedure UserOverridesAddButtonClick(Sender: TObject);
procedure UserOverridesEditButtonClick(Sender: TObject); procedure UserOverridesEditButtonClick(Sender: TObject);
@ -129,6 +130,9 @@ type
procedure SetupNotebook; procedure SetupNotebook;
procedure SetupLocalPage; procedure SetupLocalPage;
procedure SetupEnvironmentPage; procedure SetupEnvironmentPage;
procedure ResizeNotebook;
procedure ResizeLocalPage;
procedure ResizeEnvironmentPage;
procedure SetOptions(NewOptions: TRunParamsOptions); procedure SetOptions(NewOptions: TRunParamsOptions);
procedure FillSystemVariablesListView; procedure FillSystemVariablesListView;
procedure FillUserOverridesListView; procedure FillUserOverridesListView;
@ -293,9 +297,11 @@ constructor TRunParamsOptsDlg.Create(AnOwner: TComponent);
begin begin
inherited Create(AnOwner); inherited Create(AnOwner);
if LazarusResources.Find(ClassName)=nil then begin if LazarusResources.Find(ClassName)=nil then begin
Width:=500;
Height:=450;
Position:=poScreenCenter;
Caption:='Run parameters'; Caption:='Run parameters';
SetBounds((Screen.Width-500) div 2,(Screen.Height-450) div 2,500,450); OnResize:=@RunParamsOptsDlgResize;
SetupNotebook; SetupNotebook;
@ -319,6 +325,7 @@ begin
Visible:=true; Visible:=true;
end; end;
end; end;
RunParamsOptsDlgResize(nil);
end; end;
procedure TRunParamsOptsDlg.SetupNotebook; procedure TRunParamsOptsDlg.SetupNotebook;
@ -582,6 +589,132 @@ begin
end; end;
end; end;
procedure TRunParamsOptsDlg.ResizeNotebook;
begin
with Notebook do begin
SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50);
end;
ResizeLocalPage;
ResizeEnvironmentPage;
end;
procedure TRunParamsOptsDlg.ResizeLocalPage;
var w: integer;
begin
w:=Self.ClientWidth-15;
with HostApplicationGroupBox do begin
SetBounds(5,5,w,60);
end;
with HostApplicationEdit do begin
SetBounds(5,5,w-10-35,25);
end;
with HostApplicationBrowseBtn do begin
SetBounds(HostApplicationEdit.Left+HostApplicationEdit.Width+2,5,25,25);
end;
with CmdLineParametersGroupBox do begin
SetBounds(5,HostApplicationGroupBox.Top+HostApplicationGroupBox.Height+5,
w,60);
end;
with CmdLineParametersEdit do begin
SetBounds(5,5,w-15,25);
end;
with UseLaunchingApplicationBevel do begin
SetBounds(
5,CmdLineParametersGroupBox.Top+CmdLineParametersGroupBox.Height+10,w,60);
end;
with UseLaunchingApplicationCheckBox do begin
SetBounds(15,
CmdLineParametersGroupBox.Top+CmdLineParametersGroupBox.Height+10,250,25);
end;
with UseLaunchingApplicationEdit do begin
SetBounds(UseLaunchingApplicationCheckBox.Left,
UseLaunchingApplicationCheckBox.Top
+UseLaunchingApplicationCheckBox.Height+2,w-15,25);
end;
with WorkingDirectoryGroupBox do begin
SetBounds(5,UseLaunchingApplicationEdit.Top
+UseLaunchingApplicationEdit.Height+15,w,60);
end;
with WorkingDirectoryEdit do begin
SetBounds(5,5,w-10-35,25);
end;
with WorkingDirectoryBtn do begin
SetBounds(WorkingDirectoryEdit.Left+WorkingDirectoryEdit.Width+2,5,25,25);
end;
with DisplayGroupBox do begin
SetBounds(5,WorkingDirectoryGroupBox.Top+WorkingDirectoryGroupBox.Height+10,
w,60);
end;
with DisplayEdit do begin
SetBounds(5,5,w-15,25);
end;
end;
procedure TRunParamsOptsDlg.ResizeEnvironmentPage;
var w: integer;
begin
w:=Self.ClientWidth-15;
with SystemVariablesGroupBox do begin
SetBounds(5,5,w,150);
end;
with SystemVariablesListView do begin
Left:=5;
Top:=5;
Width:=Parent.ClientWidth-17;
Height:=Parent.ClientHeight-28;
end;
with UserOverridesGroupBox do begin
SetBounds(5,SystemVariablesGroupBox.Top+SystemVariablesGroupBox.Height+10,
w,150);
end;
with UserOverridesListView do begin
Left:=5;
Top:=5;
Width:=Parent.ClientWidth-17;
Height:=Parent.ClientHeight-68;
end;
with UserOverridesAddButton do begin
Left:=5;
Top:=Parent.ClientHeight-Height-28;
Width:=100;
end;
with UserOverridesEditButton do begin
Left:=UserOverridesAddButton.Left+UserOverridesAddButton.Width+10;
Top:=UserOverridesAddButton.Top;
Width:=100;
end;
with UserOverridesDeleteButton do begin
Left:=UserOverridesEditButton.Left+UserOverridesEditButton.Width+10;
Top:=UserOverridesEditButton.Top;
Width:=100;
end;
with IncludeSystemVariablesCheckBox do begin
SetBounds(5,UserOverridesGroupBox.Top+UserOverridesGroupBox.Height+10,w,25);
end;
end;
procedure TRunParamsOptsDlg.OkButtonClick(Sender: TObject); procedure TRunParamsOptsDlg.OkButtonClick(Sender: TObject);
begin begin
SaveToOptions; SaveToOptions;
@ -613,6 +746,19 @@ begin
end; end;
end; end;
procedure TRunParamsOptsDlg.RunParamsOptsDlgResize(Sender: TObject);
begin
ResizeNotebook;
with OkButton do begin
SetBounds(270,Self.ClientHeight-40,100,25);
end;
with CancelButton do begin
SetBounds(390,OkButton.Top,100,25);
end;
end;
procedure TRunParamsOptsDlg.WorkingDirectoryBtnClick(Sender: TObject); procedure TRunParamsOptsDlg.WorkingDirectoryBtnClick(Sender: TObject);
var OpenDialog: TOpenDialog; var OpenDialog: TOpenDialog;
begin begin

View File

@ -39,6 +39,7 @@ type
CancelButton: TButton; CancelButton: TButton;
procedure OkButtonClick(Sender: TObject); procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject);
procedure SysVarUserOverrideDialogResize(Sender: TObject);
private private
public public
constructor Create(TheOwner: TComponent); override; constructor Create(TheOwner: TComponent); override;
@ -86,6 +87,37 @@ begin
ModalResult:=mrCancel; ModalResult:=mrCancel;
end; end;
procedure TSysVarUserOverrideDialog.SysVarUserOverrideDialogResize(
Sender: TObject);
begin
with VariableLabel do begin
SetBounds(10,10,150,Height);
end;
with VariableEdit do begin
SetBounds(VariableLabel.Left,VariableLabel.Top+VariableLabel.Height+2,
Self.ClientWidth-2*VariableLabel.Left,Height);
end;
with ValueLabel do begin
SetBounds(VariableEdit.Left,VariableEdit.Top+VariableEdit.Height+10,
150,Height);
end;
with ValueEdit do begin
SetBounds(ValueLabel.Left,ValueLabel.Top+ValueLabel.Height+2,
Self.ClientWidth-2*ValueLabel.Left,Height);
end;
with OkButton do begin
SetBounds(Self.ClientWidth-220,Self.ClientHeight-40,100,25);
end;
with CancelButton do begin
SetBounds(OkButton.Left+OkButton.Width+10,OkButton.Top,100,25);
end;
end;
constructor TSysVarUserOverrideDialog.Create(TheOwner: TComponent); constructor TSysVarUserOverrideDialog.Create(TheOwner: TComponent);
begin begin
inherited Create(TheOwner); inherited Create(TheOwner);
@ -95,6 +127,7 @@ begin
Width:=400; Width:=400;
Height:=170; Height:=170;
Position:=poScreenCenter; Position:=poScreenCenter;
OnResize:=@SysVarUserOverrideDialogResize;
VariableLabel:=TLabel.Create(Self); VariableLabel:=TLabel.Create(Self);
with VariableLabel do begin with VariableLabel do begin
@ -153,6 +186,7 @@ begin
Visible:=true; Visible:=true;
end; end;
end; end;
SysVarUserOverrideDialogResize(nil);
end; end;
end. end.

View File

@ -15,8 +15,6 @@ uses
type type
TUnitInfoDlg = class(TFORM) TUnitInfoDlg = class(TFORM)
private
published
OkButton:TButton; OkButton:TButton;
uname: TLabel; uname: TLabel;
utype: TLabel; utype: TLabel;
@ -30,7 +28,9 @@ type
outsize: TLabel; outsize: TLabel;
outlines: TLabel; outlines: TLabel;
outpath: TLabel; outpath: TLabel;
procedure UnitInfoDlgResize(Sender: TObject);
procedure OkButtonClick(Sender:TObject); procedure OkButtonClick(Sender:TObject);
private
procedure setShortName(const str:string); procedure setShortName(const str:string);
procedure setType(const str:string); procedure setType(const str:string);
procedure setInProject(const str:string); procedure setInProject(const str:string);
@ -48,6 +48,7 @@ function ShowUnitInfoDlg(const AnUnitName, AType: string;
implementation implementation
uses LResources;
function ShowUnitInfoDlg(const AnUnitName, AType: string; function ShowUnitInfoDlg(const AnUnitName, AType: string;
IsPartOfProject: boolean; SizeInBytes, LineCount: integer; IsPartOfProject: boolean; SizeInBytes, LineCount: integer;
@ -79,11 +80,13 @@ end;
constructor TUnitInfoDlg.Create(AOwner:TComponent); constructor TUnitInfoDlg.Create(AOwner:TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
if LazarusResources.Find(ClassName)=nil then begin
Caption:='Unit Info for unit ???'; Caption:='Unit Info for unit ???';
Width:=400; Width:=400;
Height:=164; Height:=164;
position:=poScreenCenter; position:=poScreenCenter;
OnResize:=@UnitInfoDlgResize;
OkButton:=TButton.Create(Self); OkButton:=TButton.Create(Self);
with OkButton do begin with OkButton do begin
@ -226,6 +229,8 @@ begin
Show; Show;
end; end;
end; end;
UnitInfoDlgResize(nil);
end;
procedure TUnitInfoDlg.setShortName(const str:string); procedure TUnitInfoDlg.setShortName(const str:string);
begin begin
@ -257,6 +262,82 @@ begin
outpath.caption:=str; outpath.caption:=str;
end; end;
procedure TUnitInfoDlg.UnitInfoDlgResize(Sender: TObject);
begin
with OkButton do begin
Top:=132;
Width:=75;
Height:=25;
Left:=(Self.ClientWidth-Width) div 2;
end;
with uname do begin
Left:=4;
Top:=4;
end;
with utype do begin
Left:=4;
Top:=24;
end;
with uinproject do begin
Left:=4;
Top:=44;
end;
with usize do begin
Left:=4;
top:=64;
end;
with ulines do begin
Left:=4;
top:=84;
end;
with upath do begin
Left:=4;
top:=104;
end;
with outname do begin
Left:=68;
top:=4;
Width:=Self.ClientWidth-Left-5;
end;
with outtype do begin
Left:=68;
top:=24;
Width:=Self.ClientWidth-Left-5;
end;
with outinproject do begin
Left:=68;
top:=44;
Width:=Self.ClientWidth-Left-5;
end;
with outsize do begin
Left:=68;
top:=64;
Width:=Self.ClientWidth-Left-5;
end;
with outlines do begin
Left:=68;
top:=84;
Width:=Self.ClientWidth-Left-5;
end;
with outpath do begin
Left:=68;
top:=104;
Width:=Self.ClientWidth-Left-5;
end;
end;
procedure TUnitInfoDlg.OkButtonClick(Sender:TObject); procedure TUnitInfoDlg.OkButtonClick(Sender:TObject);
begin begin
ModalResult:=mrOk; ModalResult:=mrOk;

View File

@ -4,10 +4,13 @@ object ViewUnits1: TVIEWUNITS1
CLIENTHEIGHT = 200 CLIENTHEIGHT = 200
CLIENTWIDTH = 325 CLIENTWIDTH = 325
POSITION = poscreencenter POSITION = poscreencenter
LEFT = 477
HEIGHT = 200 HEIGHT = 200
TOP = 412
WIDTH = 325 WIDTH = 325
object btnOK: TBUTTON object btnOK: TBUTTON
CAPTION = 'OK' CAPTION = 'OK'
FONT.COLOR = -2147483640
ONCLICK = BTNOKCLICK ONCLICK = BTNOKCLICK
LEFT = 235 LEFT = 235
HEIGHT = 25 HEIGHT = 25
@ -16,6 +19,7 @@ object ViewUnits1: TVIEWUNITS1
end end
object btnCancel: TBUTTON object btnCancel: TBUTTON
CAPTION = 'Cancel' CAPTION = 'Cancel'
FONT.COLOR = -2147483640
ONCLICK = BTNCANCELCLICK ONCLICK = BTNCANCELCLICK
LEFT = 235 LEFT = 235
HEIGHT = 25 HEIGHT = 25
@ -30,6 +34,7 @@ object ViewUnits1: TVIEWUNITS1
WIDTH = 215 WIDTH = 215
end end
object Listbox1: TLISTBOX object Listbox1: TLISTBOX
BORDERSTYLE = bssingle
ONCLICK = LISTBOX1CLICK ONCLICK = LISTBOX1CLICK
LEFT = 10 LEFT = 10
HEIGHT = 145 HEIGHT = 145

View File

@ -35,7 +35,7 @@ type
Name: string; Name: string;
ID: integer; ID: integer;
Selected: boolean; Selected: boolean;
constructor Create(AName: string; AnID: integer; ASelected: boolean); constructor Create(const AName: string; AnID: integer; ASelected: boolean);
end; end;
TViewUnits = class(TForm) TViewUnits = class(TForm)
@ -43,6 +43,7 @@ type
btnOK : TButton; btnOK : TButton;
btnCancel : TButton; btnCancel : TButton;
MultiselectCheckBox: TCheckBox; MultiselectCheckBox: TCheckBox;
procedure ViewUnitsResize(Sender: TObject);
Procedure btnOKClick(Sender :TObject); Procedure btnOKClick(Sender :TObject);
Procedure btnCancelClick(Sender :TObject); Procedure btnCancelClick(Sender :TObject);
procedure MultiselectCheckBoxClick(Sender :TObject); procedure MultiselectCheckBoxClick(Sender :TObject);
@ -92,7 +93,7 @@ end;
{ TViewUnitsEntry } { TViewUnitsEntry }
constructor TViewUnitsEntry.Create(AName: string; AnID: integer; constructor TViewUnitsEntry.Create(const AName: string; AnID: integer;
ASelected: boolean); ASelected: boolean);
begin begin
inherited Create; inherited Create;
@ -110,9 +111,11 @@ begin
if LazarusResources.Find(Classname)=nil then begin if LazarusResources.Find(Classname)=nil then begin
Caption := 'View Project Units'; Caption := 'View Project Units';
SetBounds((Screen.Width-345) div 2, (Screen.Height-220) div 2, 325, 200); Width:=325;
Pad := 10; Height:=200;
Position:=poScreenCenter; Position:=poScreenCenter;
Pad := 10;
OnResize:=@ViewUnitsResize;
btnOK := TButton.Create(Self); btnOK := TButton.Create(Self);
with btnOk do begin with btnOk do begin
@ -166,8 +169,42 @@ begin
Visible:=true; Visible:=true;
end; end;
end; end;
ViewUnitsResize(nil);
end; end;
procedure TViewUnits.ViewUnitsResize(Sender: TObject);
var Pad: integer;
begin
Pad:=10;
with btnOk do begin
Left := Self.Width - 90;
Top := pad;
Width := 75;
Height := 25;
end;
with btnCancel do begin
Left := Self.Width - 90;
Top := btnOK.Top + btnOK.Height + pad;
Width := 75;
Height := 25;
end;
with Listbox do begin
Top:= Pad;
Left:= Pad;
Width:= Self.Width - (Self.Width - btnOK.Left) - (2*pad);
Height:= Self.Height - Top - Pad;
end;
with MultiselectCheckBox do begin
Left:=btnOK.Left;
Top:=btnCancel.Top+btnCancel.Height+2*pad;
Width:=btnOk.Width;
Height:=25;
end;
end;
Procedure TViewUnits.btnOKClick(Sender : TOBject); Procedure TViewUnits.btnOKClick(Sender : TOBject);
Begin Begin
@ -193,6 +230,9 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.10 2002/04/16 15:22:50 lazarus
MG: added form resizes
Revision 1.9 2002/02/17 19:34:45 lazarus Revision 1.9 2002/02/17 19:34:45 lazarus
MG: fixed view units/forms MG: fixed view units/forms

View File

@ -12,6 +12,7 @@ type
TWatchAddedEvent = procedure (sender : TObject; Expression : String) of Object; TWatchAddedEvent = procedure (sender : TObject; Expression : String) of Object;
TWatchesdlg = class(TForm) TWatchesdlg = class(TForm)
Listbox1: TLISTBOX; Listbox1: TLISTBOX;
procedure WatchesdlgResize(Sender: TObject);
private private
{ private declarations } { private declarations }
FOnWatchAddedEvent : TWatchAddedEvent; FOnWatchAddedEvent : TWatchAddedEvent;
@ -55,8 +56,17 @@ implementation
constructor TWatchesdlg.Create(AOwner : TComponent); constructor TWatchesdlg.Create(AOwner : TComponent);
Begin Begin
inherited; inherited;
if LazarusResources.Find(Classname)=nil then if LazarusResources.Find(Classname)=nil then begin
begin Caption := 'Watches';
Name := 'WatchesDlg';
Width := 250;
Height := 100;
//TListBox currently does NOT fire keypress, keyDown, KeyUp events. This is a fix for now.
OnKeyDown := @ListBox1KeyDown;
Position := poScreenCenter;
OnResize:=@WatchesdlgResize;
Listbox1 := TListbox.Create(self); Listbox1 := TListbox.Create(self);
with Listbox1 do with Listbox1 do
Begin Begin
@ -67,14 +77,6 @@ Begin
OnKeyDown := @Listbox1KeyDown; OnKeyDown := @Listbox1KeyDown;
end; end;
Caption := 'Watches';
Name := 'WatchesDlg';
Width := 250;
Height := 100;
//TListBox currently does NOT fire keypress, keyDown, KeyUp events. This is a fix for now.
OnKeyDown := @ListBox1KeyDown;
Position := poScreenCenter;
end; end;
//unitl events are saved in the lfm //unitl events are saved in the lfm
@ -82,6 +84,7 @@ Begin
//until the listbox events actually fire... //until the listbox events actually fire...
OnKeyDown := @ListBox1KeyDown; OnKeyDown := @ListBox1KeyDown;
WatchesdlgResize(nil);
InsertWatch := TInsertWatch.Create(nil); InsertWatch := TInsertWatch.Create(nil);
End; End;
@ -91,6 +94,10 @@ Begin
inherited; inherited;
end; end;
procedure TWatchesdlg.WatchesdlgResize(Sender: TObject);
begin
end;
Procedure TWatchesDlg.Listbox1KeyDown(Sender : TObject; var Key : Word; Shift : TShiftState); Procedure TWatchesDlg.Listbox1KeyDown(Sender : TObject; var Key : Word; Shift : TShiftState);
var var