diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-31 12:27:58 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-31 12:27:58 +0200 |
commit | 7c3d83224f85aefe71dd8de9ae7393cd0efea27a (patch) | |
tree | 2bf702cb2bdfc833a36045f0aaaa3c06f0636729 /examples/apps | |
parent | 87e9099e2ec148b83da98592ecb3a342c223702c (diff) | |
download | fpGUI-7c3d83224f85aefe71dd8de9ae7393cd0efea27a.tar.xz |
ide: Find functionality now takes into account FindOptions and Backward searching.
Diffstat (limited to 'examples/apps')
-rw-r--r-- | examples/apps/ide/src/frm_find.pas | 22 | ||||
-rw-r--r-- | examples/apps/ide/src/frm_main.pas | 8 |
2 files changed, 25 insertions, 5 deletions
diff --git a/examples/apps/ide/src/frm_find.pas b/examples/apps/ide/src/frm_find.pas index 20919e53..3ed5c30a 100644 --- a/examples/apps/ide/src/frm_find.pas +++ b/examples/apps/ide/src/frm_find.pas @@ -12,7 +12,8 @@ uses fpg_label, fpg_edit, fpg_button, - fpg_checkbox; + fpg_checkbox, + fpg_textedit; type @@ -36,22 +37,37 @@ type procedure AfterCreate; override; end; -procedure DisplayFindForm(var AFindText: TfpgString); +procedure DisplayFindForm(var AFindText: TfpgString; var AOptions: TfpgFindOptions; var ABackward: Boolean); {@VFD_NEWFORM_DECL} implementation -procedure DisplayFindForm(var AFindText: TfpgString); +procedure DisplayFindForm(var AFindText: TfpgString; var AOptions: TfpgFindOptions; var ABackward: Boolean); var frm: TFindForm; begin frm := TFindForm.Create(nil); try + frm.chkCaseSensitive.Checked := foMatchCase in AOptions; + frm.chkWholeWord.Checked := foWholeWords in AOptions; + frm.chkGlobalScope.Checked := foEntireScope in AOptions; + frm.chkSearchBackwards.Checked := ABackward; + if frm.ShowModal = mrCancel then AFindText := '' else + begin AFindText := frm.edtFindText.Text; + AOptions := []; + if frm.chkCaseSensitive.Checked then + include(AOptions, foMatchCase); + if frm.chkWholeWord.Checked then + include(AOptions, foWholeWords); + if frm.chkGlobalScope.Checked then + include(AOptions, foEntireScope); + ABackward := frm.chkSearchBackwards.Checked; + end; finally frm.Free; end; diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index 0721431b..f8c73ea5 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -203,12 +203,16 @@ procedure TMainForm.miFindClicked(Sender: TObject); var s: TfpgString; edt: TfpgTextEdit; + lFindOptions: TfpgFindOptions; + lBackward: Boolean; begin - DisplayFindForm(s); + lBackward := False; + lFindOptions := []; + DisplayFindForm(s, lFindOptions, lBackward); if s = '' then exit; edt := TfpgTextEdit(pcEditor.ActivePage.Components[0]); - edt.FindText(s, [], False); + edt.FindText(s, lFindOptions, lBackward); end; procedure TMainForm.miSearchProcedureList(Sender: TObject); |