Update of /cvsroot/jvcl/dev/JVCL3/examples/JvFindReplace
In directory sc8-pr-cvs1:/tmp/cvs-serv4702/JVCL3/examples/JvFindReplace
Added Files:
FindReplaceDemo.dof FindReplaceDemo.dpr FindReplaceDemo.res
FindReplaceMainFormU.dfm FindReplaceMainFormU.pas
Log Message:
- Copied jvcl/devtools and jvcl/examples dev/JVCL3
- Copied JVCLConvert *.dat files to dev/JVCL3/converter
--- NEW FILE: FindReplaceDemo.dof ---
[Directories]
OutputDir=..\..\Bin
UnitOutputDir=..\..\Dcu
SearchPath=..\..\Source;..\..\Common
--- NEW FILE: FindReplaceDemo.dpr ---
program FindReplaceDemo;
uses
Forms, FindReplaceMainFormU;
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TFindReplaceMainForm, FindReplaceMainForm);
Application.Run;
end.
--- NEW FILE: FindReplaceDemo.res ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: FindReplaceMainFormU.dfm ---
object FindReplaceMainForm: TFindReplaceMainForm
Left = 374
Top = 141
Width = 473
Height = 363
Caption = 'FindReplace test/demo program'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = True
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Memo1: TMemo
Left = 0
Top = 81
Width = 465
Height = 238
Align = alClient
Lines.Strings = (
'LICENSE AGREEMENT'
''
'This product is provided to you free of charge. Should you accep' +
't the terms of this '
'agreement, [Company XXX] will grant you the personal and non-exc' +
'lusive right to '
'install and use the software. [Software XXX] or any other materi' +
'als provided in this '
'package may not be modified in any way. This evaluation version ' +
'of [Software XXX] '
'may be freely redistributed with all supplied files in its origi' +
'nal executable archive '
'format.'
''
''
'COPYRIGHT NOTICE'
''
'[Software XXX] and all other materials distributed with this pac' +
'kage are Copyright (c) '
'1997 by [Company XXX].'
''
'No parts of [Software XXX] or other files provided in this packa' +
'ge may be reproduced '
'in part or in whole, except as provided in the License Agreement' +
'. You may not remove '
'any copyright or other proprietary notice from the software. You' +
' may not reverse '
'engineer, decompile, or disassemble the software.'
''
''
'DISCLAIMER'
''
'This software is provided "AS IS". You agree that by accepting t' +
'his license, you are '
'expressly acknowledging that the use of this software is AT YOUR' +
' OWN RISK.'
''
'[Company XXX] MAKES NO WARRANTY OF ANY KIND, EITHER EXPRESS OR '
'IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF '
'MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH '
'RESPECT TO THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION.'
''
'IN NO EVENT SHALL [Company XXX] BE LIABLE FOR ANY DAMAGES '
'(INCLUDING DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS '
'INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY '
'LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS PROGRAM' +
', '
'EVEN IF [Company XXX] HAS BEEN ADVISED OF THE POSSIBILITY OF SUC' +
'H '
'DAMAGES.'
''
''
'TRADEMARKS'
''
'Any product or brand names mentioned in this software and associ' +
'ated manuals and '
'files are trademarks or registered trademarks of their respectiv' +
'e owners.'
''
''
'YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, '
'UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS AND '
'CONDITIONS. YOU FURTHER AGREE THAT IT IS THE COMPLETE AND '
'EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN US THAT '
'SUPERSEDES ANY PROPOSAL OR PRIOR AGREEMENT, ORAL OR WRITTEN, '
'AND ANY OTHER COMMUNICATIONS BETWEEN US RELATING TO THE '
'SUBJECT MATTER OF THIS AGREEMENT.')
ScrollBars = ssBoth
TabOrder = 0
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 465
Height = 81
Align = alTop
BevelOuter = bvNone
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
object Label1: TLabel
Left = 24
Top = 8
Width = 388
Height = 64
Caption =
'Test program for the FindReplace unit.'#13#10'Has two different Find s' +
'ystems: one using the built in dialogs;'#13#10'one using InputQuery to' +
' handle user selection.'#13#10'See FindReplace.pas / readme.txt for mo' +
're details'
end
end
object FindReplace1: TJvFindReplace
Fast = True
Options = [frDown, frShowHelp]
EditControl = Memo1
KeepText = True
OnFind = FindReplace1Find
OnReplace = FindReplace1Replace
OnNotFound = FindReplace1NotFound
Left = 48
Top = 104
end
object MainMenu1: TMainMenu
Left = 128
Top = 104
object Search1: TMenuItem
Caption = 'Find (&Dialogs)'
object Find1: TMenuItem
Caption = 'Find...'
ShortCut = 16450
OnClick = Find1Click
end
object Replace1: TMenuItem
Caption = 'Replace...'
ShortCut = 16466
OnClick = Replace1Click
end
object FindAgain1: TMenuItem
Caption = 'Find Again'
ShortCut = 114
OnClick = FindAgain1Click
end
end
object Serachown1: TMenuItem
Caption = 'Find (&Own dialogs)'
object Find2: TMenuItem
Caption = 'Find...'
ShortCut = 16454
OnClick = Find2Click
end
object Replace2: TMenuItem
Caption = 'Replace...'
ShortCut = 16464
OnClick = Replace2Click
end
object FindAgain2: TMenuItem
Caption = 'Find Again'
ShortCut = 115
OnClick = FindAgain2Click
end
end
object Options1: TMenuItem
Caption = 'O&ptions'
object Rememberlastsearch1: TMenuItem
Caption = 'Remember last search'
Checked = True
OnClick = Rememberlastsearch1Click
end
end
end
end
--- NEW FILE: FindReplaceMainFormU.pas ---
unit FindReplaceMainFormU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls, JvFindReplace, JvComponent, ExtCtrls;
type
TFindReplaceMainForm = class(TForm)
FindReplace1: TJvFindReplace;
Memo1: TMemo;
MainMenu1: TMainMenu;
Search1: TMenuItem;
Find1: TMenuItem;
Replace1: TMenuItem;
FindAgain1: TMenuItem;
Serachown1: TMenuItem;
Find2: TMenuItem;
Replace2: TMenuItem;
FindAgain2: TMenuItem;
Options1: TMenuItem;
Rememberlastsearch1: TMenuItem;
Panel1: TPanel;
Label1: TLabel;
procedure Find1Click(Sender: TObject);
procedure Replace1Click(Sender: TObject);
procedure FindAgain1Click(Sender: TObject);
procedure FindReplace1NotFound(Sender: TObject);
procedure FindReplace1Find(Sender: TObject);
procedure FindReplace1Replace(Sender: TObject);
procedure Find2Click(Sender: TObject);
procedure Replace2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FindAgain2Click(Sender: TObject);
procedure FindReplace1Show(Sender: TObject);
procedure FindReplace1Close(Sender: TObject);
procedure Rememberlastsearch1Click(Sender: TObject);
private
{ Private declarations }
FOptions:TFindOptions;
FCount:integer;
end;
var
FindReplaceMainForm: TFindReplaceMainForm;
implementation
{$R *.DFM}
procedure TFindReplaceMainForm.Find1Click(Sender: TObject);
begin
FindReplace1.ShowDialogs := True;
FindReplace1.Find;
end;
procedure TFindReplaceMainForm.Replace1Click(Sender: TObject);
begin
FindReplace1.ShowDialogs := True;
FindReplace1.Replace;
end;
procedure TFindReplaceMainForm.FindAgain1Click(Sender: TObject);
begin
{ reset to saved options }
FindReplace1.Options := FOptions;
FindReplace1.FindAgain;
end;
procedure TFindReplaceMainForm.FindReplace1NotFound(Sender: TObject);
begin
if not FindReplace1.ShowDialogs then
ShowMessage('Text not found!');
Caption := 'Not found! ' + IntToStr(FCount);
Inc(FCount);
end;
procedure TFindReplaceMainForm.FindReplace1Find(Sender: TObject);
begin
FOptions := FindReplace1.Options;
Caption := 'Find next clicked! ' + IntToStr(FCount);
Inc(FCount);
end;
procedure TFindReplaceMainForm.FindReplace1Replace(Sender: TObject);
begin
Caption := 'Replace clicked! ' + IntToStr(FCount);
Inc(FCount);
end;
procedure TFindReplaceMainForm.Find2Click(Sender: TObject);
var S:string;
begin
S := FindReplace1.FindText;
if InputQuery('Find','Search for:',S) then
begin
FindReplace1.ShowDialogs := False;
FindReplace1.FindText := S;
FindReplace1.Find;
end;
end;
procedure TFindReplaceMainForm.Replace2Click(Sender: TObject);
var S,R:string;
begin
S := FindReplace1.FindText;
R := FindReplace1.ReplaceText;
if InputQuery('Find','Find text:',S) then
if InputQuery('Replace','Replace with:',R) then
begin
FindReplace1.ShowDialogs := False;
FindReplace1.FindText := S;
FindReplace1.ReplaceText := R;
FindReplace1.Replace;
end;
end;
procedure TFindReplaceMainForm.FormCreate(Sender: TObject);
begin
Fcount := 0;
end;
procedure TFindReplaceMainForm.FindAgain2Click(Sender: TObject);
begin
FindReplace1.FindAgain;
end;
procedure TFindReplaceMainForm.FindReplace1Show(Sender: TObject);
begin
Caption := 'Showing';
end;
procedure TFindReplaceMainForm.FindReplace1Close(Sender: TObject);
begin
Caption := 'Closing';
end;
procedure TFindReplaceMainForm.Rememberlastsearch1Click(Sender: TObject);
begin
Rememberlastsearch1.Checked := not Rememberlastsearch1.Checked;
FindReplace1.Keeptext := Rememberlastsearch1.Checked;
end;
end.
|