LazReport, Implemented search in preview the report, from Aleksey Lagunov, issue #22296

git-svn-id: trunk@37708 -
This commit is contained in:
jesus 2012-06-20 20:02:08 +00:00
parent 7e77802c42
commit 4df5e46efb
20 changed files with 395 additions and 195 deletions

View File

@ -649,6 +649,10 @@ msgstr "Aktuelle Seite"
msgid "&1st page"
msgstr "&1. Seite"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -637,6 +637,10 @@ msgstr "&Página Actual"
msgid "&1st page"
msgstr "&1ra página"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -648,6 +648,10 @@ msgstr "&Page courante"
msgid "&1st page"
msgstr "&1ère page"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -639,6 +639,10 @@ msgstr ""
msgid "&1st page"
msgstr "Halaman &1"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -640,6 +640,10 @@ msgstr "&Pagina corrente"
msgid "&1st page"
msgstr "&I° pagina"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -640,6 +640,10 @@ msgstr "Veikiamasis &lapas"
msgid "&1st page"
msgstr "Nuo &1-mo lapo"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -642,6 +642,10 @@ msgstr "Aktualna s&trona"
msgid "&1st page"
msgstr "&Pierwsza strona"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -632,6 +632,10 @@ msgstr ""
msgid "&1st page"
msgstr ""
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -639,6 +639,10 @@ msgstr "&Página atual"
msgid "&1st page"
msgstr "&1ª página"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -638,6 +638,10 @@ msgstr "&Página atual"
msgid "&1st page"
msgstr "&1ª página"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -638,6 +638,10 @@ msgstr "Текущая &страница"
msgid "&1st page"
msgstr "&1я страница"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -641,6 +641,10 @@ msgstr "Пото&чна сторінка"
msgid "&1st page"
msgstr "&1-ша сторінка"
#: lr_const.sfindtextnotfound
msgid "Search text not found."
msgstr ""
#: lr_const.sfindtextoptions
msgctxt "lr_const.sfindtextoptions"
msgid "Options"

View File

@ -875,11 +875,11 @@ type
function GetPages(Index: Integer): PfrPageInfo;
procedure ExportData(Index: Integer);
procedure PageToObjects(Index: Integer);
procedure ObjectsToPage(Index: Integer);
public
constructor Create(AParent: TfrReport);
destructor Destroy; override;
procedure Clear;
procedure ObjectsToPage(Index: Integer);
procedure Draw(Index: Integer; Canvas: TCanvas; DrawRect: TRect);
procedure Add(APage: TfrPage);
procedure Insert(Index: Integer; APage: TfrPage);
@ -7136,8 +7136,6 @@ begin
UseMargins:=Bool;
Read(fColCount, 4);
Read(fColGap, 4);
{ if frVersion>23 then
Read(ord(PageType), SizeOf(TfrPageType));}
if frVersion>23 then //todo: - remove this
Read(ord(APageType), SizeOf(TfrPageType)); //todo: - remove this
Read(fLayoutOrder, 4);
@ -7570,11 +7568,11 @@ begin
end;
end
end
else
{ else
begin
Page.Free;
Page := nil;
end;
end;}
end;
end;

View File

@ -287,6 +287,7 @@ resourcestring
sFrom = 'from';
sDefaultPrinter = 'Default printer';
sExportFilterIndexError = 'Export filter index out of range';
sFindTextNotFound = 'Search text not found.';
//--- PrintForm resources ---------------------------------------------------
sPrintFormPrint = 'Print';

View File

@ -32,10 +32,10 @@ inherited frEditorForm: TfrEditorForm
object Button1: TButton
AnchorSideTop.Control = Panel2
AnchorSideRight.Control = Button2
Left = 475
Left = 479
Height = 35
Top = 4
Width = 38
Width = 37
HelpContext = 40
Anchors = [akRight, akBottom]
AutoSize = True
@ -50,10 +50,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideTop.Control = Panel2
AnchorSideRight.Control = Panel2
AnchorSideRight.Side = asrBottom
Left = 519
Left = 522
Height = 35
Top = 4
Width = 64
Width = 61
HelpContext = 50
Anchors = [akRight, akBottom]
AutoSize = True
@ -70,7 +70,7 @@ inherited frEditorForm: TfrEditorForm
Left = 6
Height = 35
Top = 4
Width = 73
Width = 68
HelpContext = 60
Anchors = [akLeft, akBottom]
AutoSize = True
@ -84,10 +84,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button3
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2
Left = 85
Left = 80
Height = 35
Top = 4
Width = 71
Width = 67
HelpContext = 70
Anchors = [akLeft, akBottom]
AutoSize = True
@ -101,10 +101,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button6
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2
Left = 242
Left = 227
Height = 35
Top = 4
Width = 66
Width = 61
HelpContext = 110
Anchors = [akLeft, akBottom]
AutoSize = True
@ -118,10 +118,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = Button4
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel2
Left = 162
Left = 153
Height = 35
Top = 4
Width = 74
Width = 68
HelpContext = 70
Anchors = [akLeft, akBottom]
AutoSize = True
@ -147,7 +147,7 @@ inherited frEditorForm: TfrEditorForm
Left = 4
Height = 16
Top = 0
Width = 38
Width = 36
Caption = 'S&cript'
ParentColor = False
end
@ -165,6 +165,7 @@ inherited frEditorForm: TfrEditorForm
ParentColor = False
ParentFont = False
TabOrder = 0
OnEnter = M1Enter
BookMarkOptions.Xoffset = 2
Gutter.Color = 13605511
Gutter.Width = 55
@ -715,7 +716,7 @@ inherited frEditorForm: TfrEditorForm
Left = 6
Height = 16
Top = 6
Width = 41
Width = 38
BorderSpacing.Around = 6
Caption = '&Memo'
ParentColor = False
@ -754,7 +755,7 @@ inherited frEditorForm: TfrEditorForm
Left = 4
Height = 22
Top = 7
Width = 61
Width = 59
HelpContext = 80
BorderSpacing.Around = 6
Caption = '&Script'
@ -765,10 +766,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = CB1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel3
Left = 71
Left = 69
Height = 22
Top = 7
Width = 75
Width = 70
HelpContext = 90
BorderSpacing.Around = 6
Caption = '&Big font'
@ -779,10 +780,10 @@ inherited frEditorForm: TfrEditorForm
AnchorSideLeft.Control = CB2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel3
Left = 152
Left = 145
Height = 22
Top = 7
Width = 93
Width = 90
HelpContext = 100
BorderSpacing.Around = 6
Caption = '&Word wrap'

View File

@ -65,7 +65,7 @@ type
procedure FormResize(Sender: TObject);
private
{ Private declarations }
FActiveMemo: TMemo;
FActiveMemo: TWinControl;
//** procedure WMGetMinMaxInfo(var Msg: TLMGetMinMaxInfo); message LM_GETMINMAXINFO;
procedure InsertText(const S:string);
public
@ -194,7 +194,7 @@ end;
procedure TfrEditorForm.M1Enter(Sender: TObject);
begin
FActiveMemo := Sender as TMemo;
FActiveMemo := Sender as TWinControl;
end;
procedure TfrEditorForm.CB1Click(Sender: TObject);
@ -273,7 +273,13 @@ end;
procedure TfrEditorForm.InsertText(const S: string);
begin
if S<>'' then
FActiveMemo.SelText:='['+S+']';
begin
if FActiveMemo is TMemo then
TMemo(FActiveMemo).SelText:='['+S+']'
else
if FActiveMemo is TSynEdit then
TSynEdit(FActiveMemo).SelText:='['+S+']'
end;
end;
end.

View File

@ -1,109 +1,132 @@
object frPreviewSearchForm: TfrPreviewSearchForm
Left = 401
Height = 167
Top = 143
Width = 291
Left = 635
Height = 190
Top = 405
Width = 383
HorzScrollBar.Page = 290
VertScrollBar.Page = 166
ActiveControl = Edit1
BorderStyle = bsDialog
Caption = 'Find text'
ClientHeight = 167
ClientWidth = 291
ClientHeight = 190
ClientWidth = 383
OnActivate = FormActivate
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
LCLVersion = '1.1'
object Label1: TLabel
Left = 4
Height = 15
Top = 8
Width = 63
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 16
Top = 6
Width = 67
BorderSpacing.Around = 6
Caption = 'Text to &find'
FocusControl = Edit1
ParentColor = False
end
object Edit1: TEdit
Left = 4
Height = 20
Top = 24
Width = 285
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 12
Height = 25
Top = 28
Width = 365
HelpContext = 98
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
TabOrder = 0
end
object Button1: TButton
Left = 128
Height = 25
Top = 136
Width = 75
HelpContext = 40
Caption = 'Ok'
Default = True
ModalResult = 1
object ButtonPanel1: TButtonPanel
Left = 6
Height = 42
Top = 142
Width = 371
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbOK, pbCancel, pbHelp]
end
object Button2: TButton
Left = 208
Height = 25
Top = 136
Width = 75
HelpContext = 50
Cancel = True
Caption = 'Cancel'
ModalResult = 2
object Label2: TLabel
AnchorSideLeft.Control = Owner
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Owner
Left = 191
Height = 1
Top = 0
Width = 1
ParentColor = False
end
object GroupBox2: TRadioGroup
AnchorSideLeft.Control = Label2
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel1
Left = 197
Height = 77
Top = 59
Width = 180
Anchors = [akTop, akLeft, akRight, akBottom]
AutoFill = True
BorderSpacing.Around = 6
Caption = 'Origin'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 60
ClientWidth = 176
Items.Strings = (
'&1st page'
'Current &page'
)
TabOrder = 2
end
object GroupBox1: TGroupBox
Left = 4
Height = 81
Top = 52
Width = 141
object GroupBox1: TCheckGroup
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Label2
AnchorSideBottom.Control = ButtonPanel1
Left = 6
Height = 77
Top = 59
Width = 179
Anchors = [akTop, akLeft, akRight, akBottom]
AutoFill = True
BorderSpacing.Around = 6
Caption = 'Options'
ClientHeight = 66
ClientWidth = 139
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 60
ClientWidth = 175
Items.Strings = (
'&Case sensitive'
)
TabOrder = 3
object CB1: TCheckBox
Left = 8
Height = 22
Top = 20
Width = 108
HelpContext = 107
AllowGrayed = True
Caption = '&Case sensitive'
TabOrder = 0
end
end
object GroupBox2: TGroupBox
Left = 152
Height = 81
Top = 52
Width = 137
Caption = 'Origin'
ClientHeight = 66
ClientWidth = 135
TabOrder = 4
object RB1: TRadioButton
Left = 8
Height = 22
Top = 20
Width = 74
HelpContext = 116
AllowGrayed = True
Caption = '&1st page'
Checked = True
State = cbChecked
TabOrder = 0
end
object RB2: TRadioButton
Left = 8
Height = 22
Top = 40
Width = 99
HelpContext = 123
AllowGrayed = True
Caption = 'Current &page'
TabOrder = 1
TabStop = False
end
Data = {
0100000002
}
end
end

View File

@ -16,19 +16,19 @@ interface
uses
Classes, SysUtils, LResources,Forms, Controls, Graphics, Dialogs,
StdCtrls,Buttons, LR_Const;
StdCtrls,Buttons, ButtonPanel, ExtCtrls, LR_Const;
type
{ TfrPreviewSearchForm }
TfrPreviewSearchForm = class(TForm)
ButtonPanel1: TButtonPanel;
GroupBox1: TCheckGroup;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
GroupBox1: TGroupBox;
CB1: TCheckBox;
GroupBox2: TGroupBox;
RB1: TRadioButton;
RB2: TRadioButton;
Label2: TLabel;
GroupBox2: TRadioGroup;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
@ -54,13 +54,20 @@ procedure TfrPreviewSearchForm.FormCreate(Sender: TObject);
begin
Caption := sFindTextCaption;
Label1.Caption := sFindTextText;
GroupBox1.Caption := sFindTextOptions;
CB1.Caption := sFindTextCase;
GroupBox1.Items.Clear;
GroupBox1.Items.Add(sFindTextCase);
//CB1.Caption := sFindTextCase;
GroupBox2.Caption := sFindTextOrg;
RB1.Caption := sFindTextFirstPg;
RB2.Caption := sFindTextCurrentPg;
Button1.Caption := sOk;
Button2.Caption := sCancel;
GroupBox2.Items.Clear;
GroupBox2.Items.Add(sFindTextFirstPg);
GroupBox2.Items.Add(sFindTextCurrentPg);
//RB1.Caption := sFindTextFirstPg;
//RB2.Caption := sFindTextCurrentPg;
//Button1.Caption := sOk;
//Button2.Caption := sCancel;
end;
end.

View File

@ -2,7 +2,7 @@ object frPreviewForm: TfrPreviewForm
Left = 295
Height = 518
Top = 158
Width = 524
Width = 687
HorzScrollBar.Page = 411
HorzScrollBar.Range = 269
VertScrollBar.Page = 373
@ -10,7 +10,7 @@ object frPreviewForm: TfrPreviewForm
ActiveControl = PanTop
Caption = 'Preview'
ClientHeight = 518
ClientWidth = 524
ClientWidth = 687
Font.Color = clBlack
KeyPreview = True
OnActivate = FormActivate
@ -28,31 +28,31 @@ object frPreviewForm: TfrPreviewForm
Left = 0
Height = 28
Top = 0
Width = 524
Width = 687
Align = alTop
BevelOuter = bvNone
ClientHeight = 28
ClientWidth = 524
ClientWidth = 687
FullRepaint = False
TabOrder = 0
object Panel1: TPanel
Left = 0
Height = 30
Top = 0
Width = 524
Width = 687
Align = alTop
BevelInner = bvSpace
BevelOuter = bvNone
ClientHeight = 30
ClientWidth = 524
ClientWidth = 687
FullRepaint = False
TabOrder = 0
object ZoomBtn: TBitBtn
Tag = 200
Left = 165
Left = 171
Height = 28
Top = 1
Width = 72
Width = 71
Align = alLeft
AutoSize = True
BorderSpacing.InnerBorder = 2
@ -95,7 +95,6 @@ object frPreviewForm: TfrPreviewForm
}
GlyphShowMode = gsmAlways
Margin = 3
NumGlyphs = 0
OnClick = ZoomBtnClick
TabOrder = 4
end
@ -104,7 +103,7 @@ object frPreviewForm: TfrPreviewForm
Left = 1
Height = 28
Top = 1
Width = 30
Width = 32
Align = alLeft
AutoSize = True
BorderSpacing.InnerBorder = 2
@ -145,16 +144,15 @@ object frPreviewForm: TfrPreviewForm
93FFE4B28CFFE2AF88FFE0AC84FFDDA980FFDCA57DFFDAA37ACA
}
GlyphShowMode = gsmAlways
NumGlyphs = 0
OnClick = LoadBtnClick
TabOrder = 0
end
object SaveBtn: TBitBtn
Tag = 202
Left = 31
Left = 33
Height = 28
Top = 1
Width = 30
Width = 32
Align = alLeft
AutoSize = True
BorderSpacing.InnerBorder = 2
@ -195,13 +193,12 @@ object frPreviewForm: TfrPreviewForm
39FFBD6E3BFFBB6D3AFFBB6B38EFBB703ECBB6693554FFFFFF00
}
GlyphShowMode = gsmAlways
NumGlyphs = 0
OnClick = SaveBtnClick
TabOrder = 1
end
object PrintBtn: TBitBtn
Tag = 203
Left = 86
Left = 90
Height = 28
Top = 1
Width = 28
@ -244,13 +241,12 @@ object frPreviewForm: TfrPreviewForm
4CFEC4763B94FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
GlyphShowMode = gsmAlways
NumGlyphs = 0
OnClick = PrintBtnClick
TabOrder = 2
end
object ExitBtn: TBitBtn
Tag = 205
Left = 495
Left = 658
Height = 28
Top = 1
Width = 28
@ -293,12 +289,11 @@ object frPreviewForm: TfrPreviewForm
FF00FFFFFF00FFFFFF00FFFFFF006D9CD4896A9AD2FB6697CFEE
}
GlyphShowMode = gsmAlways
NumGlyphs = 0
OnClick = ExitBtnClick
TabOrder = 6
end
object frTBSeparator1: TPanel
Left = 61
Left = 65
Height = 28
Top = 1
Width = 25
@ -308,7 +303,7 @@ object frPreviewForm: TfrPreviewForm
TabOrder = 7
end
object frTBSeparator2: TPanel
Left = 114
Left = 118
Height = 28
Top = 1
Width = 25
@ -318,7 +313,7 @@ object frPreviewForm: TfrPreviewForm
TabOrder = 8
end
object frTBSeparator3: TPanel
Left = 263
Left = 270
Height = 28
Top = 1
Width = 25
@ -328,7 +323,7 @@ object frPreviewForm: TfrPreviewForm
TabOrder = 9
end
object PgUp: TSpeedButton
Left = 308
Left = 315
Height = 28
Top = 1
Width = 20
@ -371,11 +366,10 @@ object frPreviewForm: TfrPreviewForm
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = PgUpClick
end
object PgDown: TSpeedButton
Left = 431
Left = 438
Height = 28
Top = 1
Width = 20
@ -418,11 +412,10 @@ object frPreviewForm: TfrPreviewForm
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = PgDownClick
end
object LbPanel: TPanel
Left = 328
Left = 335
Height = 28
Top = 1
Width = 103
@ -436,7 +429,7 @@ object frPreviewForm: TfrPreviewForm
TabOrder = 10
end
object BtPgFirst: TSpeedButton
Left = 288
Left = 295
Height = 28
Top = 1
Width = 20
@ -479,11 +472,10 @@ object frPreviewForm: TfrPreviewForm
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = BtPgFirstClick
end
object BtPgLast: TSpeedButton
Left = 451
Left = 458
Height = 28
Top = 1
Width = 20
@ -526,14 +518,13 @@ object frPreviewForm: TfrPreviewForm
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
NumGlyphs = 0
OnClick = BtPgLastClick
end
object BtZoomOut: TBitBtn
Left = 139
Left = 143
Height = 28
Top = 1
Width = 26
Width = 28
Align = alLeft
AutoSize = True
Glyph.Data = {
@ -576,10 +567,10 @@ object frPreviewForm: TfrPreviewForm
TabOrder = 3
end
object BtZoomIn: TBitBtn
Left = 237
Left = 242
Height = 28
Top = 1
Width = 26
Width = 28
Align = alLeft
AutoSize = True
Glyph.Data = {
@ -621,26 +612,81 @@ object frPreviewForm: TfrPreviewForm
OnClick = BtZoomInClick
TabOrder = 5
end
object frTBSeparator4: TPanel
Left = 478
Height = 28
Top = 1
Width = 25
Align = alLeft
BevelOuter = bvNone
FullRepaint = False
TabOrder = 11
end
object FindBtn: TBitBtn
Left = 503
Height = 28
Top = 1
Width = 28
Align = alLeft
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF003E39
34FF393430FF332F2BFF2C2925FF272421FF201D1BFF1716141A110F0EDB0B0A
09FF070706FF040403FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF004641
3BFF857A70FFC3B8AEFF7C7268FF7F756BFF36322DFF1E1C190F282522D49589
7DFFBAAEA2FF7C7268FF7F756BFF010101FFFFFFFF00FFFFFF00FFFFFF004D47
41FF83786FFFCCC3BAFF786F65FF7B7167FF2F2B28F9272421011D1B18EE9589
7DFFC2B8ADFF786F65FF7C7268FF060505FFFFFFFF00FFFFFF00FFFFFF00534C
46FC83786FFFCCC3BAFF797066FF71685FFF37332ED5FFFFFF00252220D5857A
70FFC2B8ADFF786F65FF7B7167FF0A0908FCFFFFFF00FFFFFF00FFFFFF005A52
4CC39F9286FFCCC3BAFFC0B4AAFFA6988BFF3E3934A8FFFFFF002C2925A89084
79FFC2B8ADFFC0B4AAFFA89B8EFF110F0EC3FFFFFF00FFFFFF00797066055C55
4EF9423D38FF58514AFF3D3833FF332F2BFF23201DE5171614301E1C19B51A18
16FF252220FF191715FF0F0E0DFF010101EE00000002FFFFFF009F9286059D91
85FFB1A396FF7F756BFF7C7268FF776D64FF6C635BFF2E2A26FF564F48FF8076
6CFF7C7268FF776D64FF70675EFF000000FE00000005FFFFFF00AB9D9004AFA1
94E1BAAEA2FF82776DFF82776DFFAA917BFFBAA794FFB7A48EFAB09781FF9F8D
7DFF836D5BFF716357FF95897DFF040403E000000003FFFFFF00B9ACA008877D
72489B8E82FF9D9185FF867B71FF564F48FF504A44FF80766CFF6E665DFF826C
58FFA6917DFF948474FF564F48FF0C0B0B7A07070601FFFFFF00FFFFFF00FFFF
FF00746B62FFA4978AFF95897DFF9F9286FF3E3934FFFFFFFF004C4640FF7E74
6AFF857A70FF3E3934FF453F3AA72522200C15131102FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF008E8378E2C3B8AEFF655D55FFFFFFFF007C7268FFA89B
8EFF9C8F83E4FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF009C8F83E2BCB0A4FF9D9185FFFFFFFF00AEA093FF9D91
85FF655D55DAFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
OnClick = FindBtnClick
TabOrder = 12
end
end
end
object PreviewPanel: TPanel
Left = 0
Height = 490
Top = 28
Width = 524
Width = 687
Align = alClient
BevelInner = bvLowered
BevelOuter = bvNone
ClientHeight = 490
ClientWidth = 524
ClientWidth = 687
FullRepaint = False
TabOrder = 1
object ScrollBox1: TScrollBox
Left = 1
Height = 469
Top = 1
Width = 503
HorzScrollBar.Page = 503
Width = 666
HorzScrollBar.Page = 666
VertScrollBar.Page = 469
Align = alClient
BorderStyle = bsNone
@ -650,18 +696,18 @@ object frPreviewForm: TfrPreviewForm
Left = 1
Height = 19
Top = 470
Width = 522
Width = 685
Align = alBottom
BevelOuter = bvNone
ClientHeight = 19
ClientWidth = 522
ClientWidth = 685
FullRepaint = False
TabOrder = 1
object HScrollBar: TScrollBar
Left = 2
Height = 16
Top = 3
Width = 504
Height = 15
Top = 4
Width = 667
Align = alBottom
BorderSpacing.Left = 2
BorderSpacing.Right = 16
@ -675,7 +721,7 @@ object frPreviewForm: TfrPreviewForm
end
end
object RPanel: TPanel
Left = 504
Left = 667
Height = 469
Top = 1
Width = 19
@ -686,10 +732,10 @@ object frPreviewForm: TfrPreviewForm
FullRepaint = False
TabOrder = 2
object VScrollBar: TScrollBar
Left = 3
Left = 4
Height = 469
Top = 0
Width = 16
Width = 15
Align = alRight
Kind = sbVertical
LargeChange = 200

View File

@ -93,11 +93,13 @@ type
{ TfrPreviewForm }
TfrPreviewForm = class(TForm)
FindBtn: TBitBtn;
BtZoomOut: TBitBtn;
BtZoomIn: TBitBtn;
frTBSeparator1: TPanel;
frTBSeparator2: TPanel;
frTBSeparator3: TPanel;
frTBSeparator4: TPanel;
LbPanel: TPanel;
PanTop: TPanel;
PgDown: TSpeedButton;
@ -172,9 +174,13 @@ type
per: Double;
mode: TfrScaleMode;
PaintAllowed: Boolean;
FindStr: String;
CaseSensitive: Boolean;
LastFoundPage, LastFoundObject: Integer;
SearchFindStr: String;
SearchCaseSensitive: Boolean;
SearchDirecion:integer;
SearchLastFoundPage: Integer;
SearchLastFoundObject: Integer;
HF: String;
procedure ShowPageNum;
@ -184,6 +190,7 @@ type
procedure LoadFromFile(aName: String);
procedure SaveToFile(aName: String);
// procedure FindInEMF(emf: TMetafile);
function FindInEMFPages:boolean;
procedure FindText;
procedure SetGrayedButtons(Value: Boolean);
procedure Connect(ADoc: Pointer);
@ -522,6 +529,7 @@ begin
SaveBtn.Hint := sPreviewFormSave;
PrintBtn.Hint := sPreviewFormPrint;
ExitBtn.Hint := sPreviewFormClose;
FindBtn.Hint := sPreviewFormFind;
// TODO: ADD hints to new buttons
end;
@ -1028,12 +1036,12 @@ begin
end
else if Key = vk_F3 then
begin
if FindStr <> '' then
if SearchFindStr <> '' then
begin
if LastFoundPage <> CurPage - 1 then
if SearchLastFoundPage <> CurPage - 1 then
begin
LastFoundPage := CurPage - 1;
LastFoundObject := 0;
SearchLastFoundPage := CurPage - 1;
SearchLastFoundObject := 0;
end;
FindText;
end;
@ -1178,6 +1186,53 @@ begin
Connect(Doc);
end;
function TfrPreviewForm.FindInEMFPages: boolean;
var
P:PfrPageInfo;
V:TfrObject;
i, j, SK:integer;
Pages : TfrEMFPages;
begin
Result:=false;
if not Assigned(EMFPages) then exit;
Pages := TfrEMFPages(EMFPages);
for i:=SearchLastFoundPage to Pages.Count - 1 do
begin
P:=Pages[i];
if not Assigned(P^.Page) then
Pages.ObjectsToPage(i);
if i = SearchLastFoundPage then
SK:=SearchLastFoundObject + 1
else
SK:=0;
for j:=SK to P^.Page.Objects.Count - 1 do
begin
V:=TfrView(P^.Page.Objects[j]);
if Assigned(V) and (V is TfrMemoView) then
begin
if Pos(SearchFindStr, TfrMemoView(V).Memo.Text)>0 then
begin
CurPage:=i + 1;
SearchLastFoundPage:=i;
SearchLastFoundObject:=j;
ShowPageNum;
SetToCurPage;
Result:=true;
exit;
end;
end;
end;
end;
end;
//**
(*
function EnumEMFRecordsProc(DC: HDC; HandleTable: PHandleTable;
@ -1212,16 +1267,14 @@ begin
RecordNum := 0;
EnumEnhMetafile(0, emf.Handle, @EnumEMFRecordsProc, nil, Rect(0, 0, 0, 0));
end;
}
procedure TfrPreviewForm.FindText;
(*var
var
EMF: TMetafile;
EMFCanvas: TMetafileCanvas;
PageInfo: PfrPageInfo;
*)
begin
(* PaintAllowed := False;
PaintAllowed := False;
StrFound := False;
while LastFoundPage < TfrEMFPages(EMFPages).Count do
begin
@ -1256,34 +1309,51 @@ begin
Inc(LastFoundPage);
end;
PaintAllowed := True;
*)
end;
}
procedure TfrPreviewForm.FindText;
begin
PaintAllowed := False;
if not FindInEMFPages then
ShowMessage(sFindTextNotFound);
PaintAllowed := True;
end;
procedure TfrPreviewForm.FindBtnClick(Sender: TObject);
var
p: TfrPreviewSearchForm;
SrchForm: TfrPreviewSearchForm;
begin
if Doc = nil then Exit;
p := TfrPreviewSearchForm.Create(nil);
with p do
if ShowModal = mrOk then
SrchForm := TfrPreviewSearchForm.Create(nil);
SrchForm.Edit1.Text:=SearchFindStr;
SrchForm.GroupBox1.Checked[0]:=SearchCaseSensitive;
SrchForm.GroupBox2.ItemIndex:=SearchDirecion;
if SrchForm.ShowModal = mrOk then
begin
FindStr := Edit1.Text;
CaseSensitive := CB1.Checked;
if not CaseSensitive then FindStr := AnsiUpperCase(FindStr);
if RB1.Checked then
SearchFindStr := SrchForm.Edit1.Text;
SearchCaseSensitive := SrchForm.GroupBox1.Checked[0];// CB1.Checked;
SearchDirecion:=SrchForm.GroupBox2.ItemIndex;
if not SearchCaseSensitive then
SearchFindStr := AnsiUpperCase(SearchFindStr);
if SrchForm.GroupBox2.ItemIndex = 0 {RB1.Checked} then
begin
LastFoundPage := 0;
LastFoundObject := 0;
SearchLastFoundPage := 0;
SearchLastFoundObject := 0;
end
else if LastFoundPage <> CurPage - 1 then
else
if SearchLastFoundPage <> CurPage - 1 then
begin
LastFoundPage := CurPage - 1;
LastFoundObject := 0;
SearchLastFoundPage := CurPage - 1;
SearchLastFoundObject := 0;
end;
Free;
FindText;
end;
SrchForm.Free;
end;
procedure TfrPreviewForm.EditBtnClick(Sender: TObject);