From 44ff6adb20548f44c396c41237e5f1f075aa2d62 Mon Sep 17 00:00:00 2001 From: lazarus Date: Tue, 8 Aug 2000 18:52:14 +0000 Subject: [PATCH] Started a FIND dialog box. Shane git-svn-id: trunk@23 - --- .gitattributes | 1 + ide/find_dlg.pp | 166 ++++++++++++++++++++++++++++++++++++++++++++++++ ide/lazarus.pp | 11 +++- ide/main.pp | 14 +++- 4 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 ide/find_dlg.pp diff --git a/.gitattributes b/.gitattributes index d7916b6524..c43776c5f8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -28,6 +28,7 @@ examples/trackbar.pp svneol=native#text/pascal ide/compiler.pp svneol=native#text/pascal ide/compileroptions.pp svneol=native#text/pascal ide/dlgmessage.pp svneol=native#text/pascal +ide/find_dlg.pp svneol=native#text/pascal ide/global.inc svneol=native#text/pascal ide/global.pp svneol=native#text/pascal ide/idecomp.pp svneol=native#text/pascal diff --git a/ide/find_dlg.pp b/ide/find_dlg.pp new file mode 100644 index 0000000000..8e94efefc5 --- /dev/null +++ b/ide/find_dlg.pp @@ -0,0 +1,166 @@ + +{ + /*************************************************************************** + find_dlg.pp - Find dialog + ------------------- + + Initial Revision : Tue Aug 08 14:49 CST 2000 + + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +} +{$H+} +unit find_dlg; + +{$mode objfpc} + +interface + +uses + classes,LclLinux, stdctrls,forms,buttons,comctrls, + Controls,graphics,extctrls; + + +type + + TFind = class(TFORM) + lblTexttofind : TLabel; + edtTexttoFind: TEdit; + btnOK : TButton; + btnCancel : TButton; + btnHelp : TButton; + gbGroupBox : TGroupBox; + + cbCaseSensitive : TCheckbox; + cbWholeWords : TCheckBox; + cbRegularExpressions : TCheckBox; + + rgForwardBack : TRadioGroup; + +{ event handlers } + procedure btnOKClicked(Sender : TObject); + procedure btnCancelClicked(Sender : TObject); + procedure btnHelpClicked(Sender : TObject); +private +protected +public + constructor Create(AOwner: TComponent); override; +end; + +var +dlgFind1 : TFind; + +implementation + +constructor TFind.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + + Caption := 'Find'; + Left := 0; + Top := 0; + Width := 450; + height := 395; + Position:= poScreenCenter; + + lblTextToFind := TLabel.Create(self); + with lblTexttoFind do + Begin + parent := Self; + Left := 10; + Top := 5; + Caption := 'Text to find:'; + Visible := True; + end; + + edtTextToFind := TEdit.Create(self); + with edtTexttoFind do + Begin + parent := Self; + Left := lblTextToFind.LEft+lblTextToFind.Width+5; + Top := 5; + Visible := True; + end; + + + gbGroupBox := TGroupBox.Create(self); + with gbGroupBox do + begin + parent := Self; + Left := 10; + Top := 35; + Width :=(Self.Width div 2) - 10; + Height := (Self.Height div 3) -35; + Caption := 'Options'; + Visible := True; + end; + + cbCaseSensitive := TCheckbox.Create(self); + cbWholeWords := TCheckBox.Create(self); + cbRegularExpressions := TCheckBox.Create(Self); + + with cbCaseSensitive do + begin + parent := gbGroupBox; + left := 5; + top := 5; + Caption := 'Case Sensitive'; + visible := True; + end; + + with cbWholeWords do + begin + parent := gbGroupBox; + left := 5; + top := 25; + Caption := 'Whole Words'; + visible := True; + end; + + with cbRegularExpressions do + begin + parent := gbGroupBox; + left := 5; + top := 50; + Caption := 'Regular Expressions'; + visible := True; + end; + + rgForwardBack := TRadioGroup.Create(self); + with rgForwardBack do + begin + parent := self; + left := (Self.Width div 2) +5; + top := 35; + Height := (Self.Height div 3) -35; + width := (Self.Width div 2) -10; + Caption := 'Direction'; + Items.Add('Forward'); + Items.Add('Backward'); + visible := True; + end; + +end; + +procedure TFind.btnOKClicked(Sender : TObject); +Begin +end; + +procedure TFind.btnCancelClicked(Sender : TObject); +Begin +End; + +procedure TFInd.btnHelpClicked(Sender : TObject); +Begin +end; + +end. diff --git a/ide/lazarus.pp b/ide/lazarus.pp index f8ba64e9be..da2c284064 100644 --- a/ide/lazarus.pp +++ b/ide/lazarus.pp @@ -35,8 +35,8 @@ uses compileroptions, IdeEditor, viewunit_dlg, //dialog used to list the units in a project - viewform_dlg //dialog to display the forms in the project - ; + viewform_dlg, //dialog to display the forms in the project + Find_dlg; var SplashForm: TSplashForm; @@ -58,7 +58,8 @@ begin Application.CreateForm(TIDEEditor, IdeEditor1); Application.CreateForm(TViewUnits1, ViewUnits1); Application.CreateForm(TViewForms1, ViewForms1); - + Application.CreateForm(TFind, dlgFind1); + SplashForm.StartTimer; Application.Run; end. @@ -66,6 +67,10 @@ end. { $Log$ + Revision 1.2 2000/08/08 18:52:14 lazarus + Started a FIND dialog box. + Shane + Revision 1.1 2000/07/13 10:27:47 michael + Initial import diff --git a/ide/main.pp b/ide/main.pp index 06fdd0858d..59ba6cc3e1 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -133,6 +133,8 @@ type procedure mnuRunProjectClicked(Sender : TObject); procedure mnuViewCodeExplorerClick(Sender : TObject); procedure mnuViewMessagesClick(Sender : TObject); + procedure mnuSearchFindClicked(Sender : TObject); + procedure ControlClick(Sender : TObject); procedure MessageViewDblClick(Sender : TObject); procedure DesignFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -181,7 +183,7 @@ Form1 : TForm1; Taginc : Integer; implementation uses - TestForm, IDEEditor,mwCustomEdit,gtk,ViewUnit_dlg,ViewForm_dlg; + TestForm, IDEEditor,mwCustomEdit,gtk,ViewUnit_dlg,ViewForm_dlg,Find_dlg; constructor TForm1.Create(AOwner: TComponent); var @@ -783,6 +785,7 @@ itmFileNew := TMenuItem.Create(Self); //-------------- itmSearchFind := TMenuItem.Create(nil); itmSearchFind.caption := 'Find'; + itmSearchFind.OnClick := @mnuSearchFindClicked; mnuSearch.add(itmSearchFind); //-------------- @@ -1775,6 +1778,11 @@ Begin Messagedlg.Show; End; +Procedure TForm1.mnuSearchFindClicked(Sender : TObject); +Begin + dlgFind1.Show; +End; + Procedure TForm1.mnuNewProjectClicked(Sender : TObject); var @@ -2180,6 +2188,10 @@ end. { ============================================================================= $Log$ + Revision 1.3 2000/08/08 18:52:14 lazarus + Started a FIND dialog box. + Shane + Revision 1.2 2000/08/07 19:15:05 lazarus Added the Search menu to the IDE. Shane