summaryrefslogtreecommitdiff
path: root/examples/apps
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-08-30 21:29:19 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-08-30 21:29:19 +0200
commit6af41b7b7bf5a1c8a112523c49a1cb962da8e732 (patch)
tree6889df69eabb53f3143d3a8e5012c43a7a802fac /examples/apps
parentd2f1ddfeecaa0a2c408371321a065676f169a565 (diff)
downloadfpGUI-6af41b7b7bf5a1c8a112523c49a1cb962da8e732.tar.xz
ide: hooked up the Find dialog to the menus to allow use to do searching.
Diffstat (limited to 'examples/apps')
-rw-r--r--examples/apps/ide/src/frm_main.pas16
1 files changed, 15 insertions, 1 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas
index b63745eb..0721431b 100644
--- a/examples/apps/ide/src/frm_main.pas
+++ b/examples/apps/ide/src/frm_main.pas
@@ -64,6 +64,7 @@ type
procedure btnOpenFileClicked(Sender: TObject);
procedure miFileSave(Sender: TObject);
procedure miFileSaveAs(Sender: TObject);
+ procedure miFindClicked(Sender: TObject);
procedure miSearchProcedureList(Sender: TObject);
procedure miAboutFPGuiClicked(Sender: TObject);
procedure miAboutIDE(Sender: TObject);
@@ -122,6 +123,7 @@ uses
,frm_projectoptions
,frm_debug
,frm_procedurelist
+ ,frm_find
,fpg_basegrid
,ideconst
,idemacros
@@ -197,6 +199,18 @@ begin
TfpgTextEdit(pcEditor.ActivePage.Components[0]).SaveToFile(s);
end;
+procedure TMainForm.miFindClicked(Sender: TObject);
+var
+ s: TfpgString;
+ edt: TfpgTextEdit;
+begin
+ DisplayFindForm(s);
+ if s = '' then
+ exit;
+ edt := TfpgTextEdit(pcEditor.ActivePage.Components[0]);
+ edt.FindText(s, [], False);
+end;
+
procedure TMainForm.miSearchProcedureList(Sender: TObject);
var
s: TfpgString;
@@ -1209,7 +1223,7 @@ begin
begin
Name := 'mnuSearch';
SetPosition(476, 98, 172, 20);
- AddMenuItem('Find...', 'Ctrl+F', nil).Enabled := False;
+ AddMenuItem('Find...', 'Ctrl+F', @miFindClicked);
AddMenuItem('Find Next', 'F3', nil).Enabled := False;
AddMenuItem('Find Previous', 'Shift+F3', nil).Enabled := False;
AddMenuItem('Find in Files...', 'Ctrl+Shift+F', nil).Enabled := False;