+ converted findreplacedialog to lfm

patch by: Darius

git-svn-id: trunk@9556 -
This commit is contained in:
vincents 2006-07-04 18:48:31 +00:00
parent 2b7bb69fe4
commit d61a9821fb
5 changed files with 532 additions and 320 deletions

2
.gitattributes vendored
View File

@ -1178,6 +1178,8 @@ ide/findpalettecomp.pas svneol=native#text/plain
ide/findrenameidentifier.lfm svneol=native#text/plain
ide/findrenameidentifier.lrs svneol=native#text/pascal
ide/findrenameidentifier.pas svneol=native#text/pascal
ide/findreplacedialog.lfm svneol=native#text/plain
ide/findreplacedialog.lrs svneol=native#text/plain
ide/findreplacedialog.pp svneol=native#text/pascal
ide/formeditor.pp svneol=native#text/pascal
ide/frmsearch.lfm svneol=native#text/plain

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ components/turbopower_ipro/units
designer/jitform/units
designer/units
examples/units
ide/*.bak
ide/revision.inc
ide/units
ideintf/units

340
ide/findreplacedialog.lfm Normal file
View File

@ -0,0 +1,340 @@
object LazFindReplaceDialog: TLazFindReplaceDialog
ActiveControl = TextToFindComboBox
BorderIcons = [biSystemMenu]
Caption = 'LazFindReplaceDialog'
ClientHeight = 331
ClientWidth = 416
Constraints.MinHeight = 312
OnResize = FormResize
PixelsPerInch = 96
Position = poScreenCenter
HorzScrollBar.Page = 415
VertScrollBar.Page = 330
Left = 311
Height = 331
Top = 426
Width = 416
object TextToFindLabel: TLabel
Alignment = taRightJustify
BorderSpacing.Around = 6
Caption = 'TextToFindLabel'
Color = clNone
FocusControl = TextToFindComboBox
ParentColor = False
AnchorSideLeft.Control = Owner
Left = 6
Height = 14
Top = 16
Width = 80
end
object ReplaceWithLabel: TLabel
Alignment = taRightJustify
BorderSpacing.Around = 6
Caption = 'ReplaceWithLabel'
Color = clNone
FocusControl = ReplaceTextComboBox
ParentColor = False
AnchorSideLeft.Control = Owner
Left = 6
Height = 14
Top = 40
Width = 86
end
object TextToFindComboBox: TComboBox
Anchors = [akTop, akLeft, akRight]
AutoComplete = True
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactRetainPrefixCase, cbactSearchAscending]
BorderSpacing.Left = 6
BorderSpacing.Around = 6
MaxLength = 0
OnKeyDown = TextToFindComboboxKeyDown
TabOrder = 0
Text = 'TextToFindComboBox'
AnchorSideLeft.Control = TextToFindLabel
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 98
Height = 21
Top = 12
Width = 312
end
object ReplaceTextComboBox: TComboBox
Anchors = [akTop, akLeft, akRight]
AutoComplete = True
AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactRetainPrefixCase, cbactSearchAscending]
BorderSpacing.Left = 6
BorderSpacing.Around = 6
MaxLength = 0
OnKeyDown = TextToFindComboboxKeyDown
TabOrder = 1
Text = 'ReplaceTextComboBox'
AnchorSideLeft.Control = ReplaceWithLabel
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 104
Height = 21
Top = 39
Width = 306
end
object CancelButton: TBitBtn
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
BorderSpacing.InnerBorder = 2
Cancel = True
Caption = 'Cancel'
Constraints.MaxHeight = 33
Kind = bkCancel
ModalResult = 2
NumGlyphs = 0
OnClick = CancelButtonClick
TabOrder = 2
AnchorSideRight.Control = ReplaceAllButton
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 194
Height = 33
Top = 292
Width = 80
end
object OKButton: TBitBtn
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
BorderSpacing.InnerBorder = 2
Caption = '&OK'
Constraints.MaxHeight = 33
Default = True
Kind = bkOK
ModalResult = 1
NumGlyphs = 0
OnClick = OkButtonClick
TabOrder = 3
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 348
Height = 33
Top = 292
Width = 62
end
object OptionsGroupBox: TGroupBox
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Bottom = 6
Caption = 'OptionsGroupBox'
ClientHeight = 202
ClientWidth = 195
TabOrder = 4
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ReplaceTextComboBox
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = CancelButton
Left = 6
Height = 220
Top = 66
Width = 199
object PromptOnReplaceCheckBox: TCheckBox
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'PromptOnReplaceCheckBox'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 0
AnchorSideTop.Side = asrBottom
Left = 6
Height = 13
Top = 112
Width = 183
end
object MultiLineCheckBox: TCheckBox
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'MultiLineCheckBox'
Enabled = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
AnchorSideTop.Side = asrBottom
Left = 6
Height = 13
Top = 87
Width = 183
end
object RegularExpressionsCheckBox: TCheckBox
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'RegularExpressionsCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 2
AnchorSideTop.Side = asrBottom
Left = 6
Height = 13
Top = 62
Width = 183
end
object WholeWordsOnlyCheckBox: TCheckBox
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'WholeWordsOnlyCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 3
AnchorSideTop.Side = asrBottom
Left = 6
Height = 13
Top = 37
Width = 183
end
object CaseSensitiveCheckBox: TCheckBox
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'CaseSensitiveCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 4
AnchorSideTop.Side = asrBottom
Left = 6
Height = 13
Top = 12
Width = 183
end
end
object ScopeGroupBox: TGroupBox
BorderSpacing.Around = 6
Caption = 'ScopeGroupBox'
ClientHeight = 51
ClientWidth = 195
TabOrder = 5
AnchorSideLeft.Control = OptionsGroupBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = OriginGroupBox
AnchorSideTop.Side = asrBottom
Left = 211
Height = 69
Top = 141
Width = 199
object SelectedRadioButton: TRadioButton
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'SelectedRadioButton'
TabOrder = 0
Left = 6
Height = 13
Top = 31
Width = 183
end
object GlobalRadioButton: TRadioButton
Align = alTop
BorderSpacing.Around = 6
Caption = 'GlobalRadioButton'
TabOrder = 1
Left = 6
Height = 13
Top = 6
Width = 183
end
end
object DirectionGroupBox: TGroupBox
BorderSpacing.Around = 6
Caption = 'DirectionGroupBox'
ClientHeight = 51
ClientWidth = 195
TabOrder = 6
AnchorSideLeft.Control = OptionsGroupBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ScopeGroupBox
AnchorSideTop.Side = asrBottom
Left = 211
Height = 69
Top = 216
Width = 199
object BackwardRadioButton: TRadioButton
Align = alTop
BorderSpacing.Top = 6
BorderSpacing.Around = 6
Caption = 'BackwardRadioButton'
TabOrder = 0
Left = 6
Height = 13
Top = 31
Width = 183
end
object ForwardRadioButton: TRadioButton
Align = alTop
BorderSpacing.Around = 6
Caption = 'ForwardRadioButton'
TabOrder = 1
Left = 6
Height = 13
Top = 6
Width = 183
end
end
object OriginGroupBox: TGroupBox
BorderSpacing.Around = 6
Caption = 'OriginGroupBox'
ClientHeight = 51
ClientWidth = 195
TabOrder = 7
AnchorSideLeft.Control = OptionsGroupBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ReplaceTextComboBox
AnchorSideTop.Side = asrBottom
Left = 211
Height = 69
Top = 66
Width = 199
object FromCursorRadioButton: TRadioButton
Align = alTop
BorderSpacing.Around = 6
Caption = 'FromCursorRadioButton'
TabOrder = 0
Left = 6
Height = 13
Top = 6
Width = 183
end
object EntireScopeRadioButton: TRadioButton
Align = alTop
BorderSpacing.Around = 6
Caption = 'EntireScopeRadioButton'
TabOrder = 1
Left = 6
Height = 13
Top = 25
Width = 183
end
end
object ReplaceAllButton: TBitBtn
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Around = 6
Caption = '&All'
Constraints.MaxHeight = 33
Kind = bkAll
ModalResult = 8
NumGlyphs = 0
TabOrder = 8
AnchorSideRight.Control = OKButton
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 280
Height = 33
Top = 292
Width = 62
end
end

115
ide/findreplacedialog.lrs Normal file
View File

@ -0,0 +1,115 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TLazFindReplaceDialog','FORMDATA',[
'TPF0'#21'TLazFindReplaceDialog'#20'LazFindReplaceDialog'#13'ActiveControl'#7
+#18'TextToFindComboBox'#11'BorderIcons'#11#12'biSystemMenu'#0#7'Caption'#6#20
+'LazFindReplaceDialog'#12'ClientHeight'#3'K'#1#11'ClientWidth'#3#160#1#21'Co'
+'nstraints.MinHeight'#3'8'#1#8'OnResize'#7#10'FormResize'#13'PixelsPerInch'#2
+'`'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#159#1#18'VertS'
+'crollBar.Page'#3'J'#1#4'Left'#3'7'#1#6'Height'#3'K'#1#3'Top'#3#170#1#5'Widt'
+'h'#3#160#1#0#6'TLabel'#15'TextToFindLabel'#9'Alignment'#7#14'taRightJustify'
+#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'TextToFindLabel'#5'Color'#7#6
+'clNone'#12'FocusControl'#7#18'TextToFindComboBox'#11'ParentColor'#8#22'Anch'
+'orSideLeft.Control'#7#5'Owner'#4'Left'#2#6#6'Height'#2#14#3'Top'#2#16#5'Wid'
+'th'#2'P'#0#0#6'TLabel'#16'ReplaceWithLabel'#9'Alignment'#7#14'taRightJustif'
+'y'#20'BorderSpacing.Around'#2#6#7'Caption'#6#16'ReplaceWithLabel'#5'Color'#7
+#6'clNone'#12'FocusControl'#7#19'ReplaceTextComboBox'#11'ParentColor'#8#22'A'
+'nchorSideLeft.Control'#7#5'Owner'#4'Left'#2#6#6'Height'#2#14#3'Top'#2'('#5
+'Width'#2'V'#0#0#9'TComboBox'#18'TextToFindComboBox'#7'Anchors'#11#5'akTop'#6
+'akLeft'#7'akRight'#0#12'AutoComplete'#9#16'AutoCompleteText'#11#12'cbactEna'
+'bled'#22'cbactEndOfLineComplete'#21'cbactRetainPrefixCase'#20'cbactSearchAs'
+'cending'#0#18'BorderSpacing.Left'#2#6#20'BorderSpacing.Around'#2#6#9'MaxLen'
+'gth'#2#0#9'OnKeyDown'#7#25'TextToFindComboboxKeyDown'#8'TabOrder'#2#0#4'Tex'
+'t'#6#18'TextToFindComboBox'#22'AnchorSideLeft.Control'#7#15'TextToFindLabel'
+#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owne'
+'r'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2'b'#6'Height'#2#21#3'To'
+'p'#2#12#5'Width'#3'8'#1#0#0#9'TComboBox'#19'ReplaceTextComboBox'#7'Anchors'
+#11#5'akTop'#6'akLeft'#7'akRight'#0#12'AutoComplete'#9#16'AutoCompleteText'
+#11#12'cbactEnabled'#22'cbactEndOfLineComplete'#21'cbactRetainPrefixCase'#20
+'cbactSearchAscending'#0#18'BorderSpacing.Left'#2#6#20'BorderSpacing.Around'
+#2#6#9'MaxLength'#2#0#9'OnKeyDown'#7#25'TextToFindComboboxKeyDown'#8'TabOrde'
+'r'#2#1#4'Text'#6#19'ReplaceTextComboBox'#22'AnchorSideLeft.Control'#7#16'Re'
+'placeWithLabel'#19'AnchorSideLeft.Side'#7#9'asrBottom'#23'AnchorSideRight.C'
+'ontrol'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2'h'#6'H'
+'eight'#2#21#3'Top'#2''''#5'Width'#3'2'#1#0#0#7'TBitBtn'#12'CancelButton'#7
+'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'
+#2#6#25'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#6'Cancel'#21
+'Constraints.MaxHeight'#2'!'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'Num'
+'Glyphs'#2#0#7'OnClick'#7#17'CancelButtonClick'#8'TabOrder'#2#2#23'AnchorSid'
+'eRight.Control'#7#16'ReplaceAllButton'#24'AnchorSideBottom.Control'#7#5'Own'
+'er'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#194#0#6'Height'#2'!'
+#3'Top'#3'$'#1#5'Width'#2'P'#0#0#7'TBitBtn'#8'OKButton'#7'Anchors'#11#7'akRi'
+'ght'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpac'
+'ing.InnerBorder'#2#2#7'Caption'#6#3'&OK'#21'Constraints.MaxHeight'#2'!'#7'D'
+'efault'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#7'OnClick'
+#7#13'OkButtonClick'#8'TabOrder'#2#3#23'AnchorSideRight.Control'#7#5'Owner'
+#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Ow'
+'ner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'\'#1#6'Height'#2'!'
+#3'Top'#3'$'#1#5'Width'#2'>'#0#0#9'TGroupBox'#15'OptionsGroupBox'#7'Anchors'
+#11#5'akTop'#6'akLeft'#8'akBottom'#0#18'BorderSpacing.Left'#2#6#17'BorderSpa'
+'cing.Top'#2#6#20'BorderSpacing.Bottom'#2#6#7'Caption'#6#15'OptionsGroupBox'
+#12'ClientHeight'#3#202#0#11'ClientWidth'#3#195#0#8'TabOrder'#2#4#22'AnchorS'
+'ideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#19'ReplaceTextCombo'
+'Box'#18'AnchorSideTop.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#12
+'CancelButton'#4'Left'#2#6#6'Height'#3#220#0#3'Top'#2'B'#5'Width'#3#199#0#0#9
+'TCheckBox'#23'PromptOnReplaceCheckBox'#5'Align'#7#5'alTop'#17'BorderSpacing'
+'.Top'#2#6#20'BorderSpacing.Around'#2#6#7'Caption'#6#23'PromptOnReplaceCheck'
+'Box'#7'Checked'#9#14'ParentShowHint'#8#8'ShowHint'#9#5'State'#7#9'cbChecked'
+#8'TabOrder'#2#0#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'
+#2#13#3'Top'#2'p'#5'Width'#3#183#0#0#0#9'TCheckBox'#17'MultiLineCheckBox'#5
+'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#6#20'BorderSpacing.Around'#2#6#7
+'Caption'#6#17'MultiLineCheckBox'#7'Enabled'#8#14'ParentShowHint'#8#8'ShowHi'
+'nt'#9#8'TabOrder'#2#1#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'H'
+'eight'#2#13#3'Top'#2'W'#5'Width'#3#183#0#0#0#9'TCheckBox'#26'RegularExpress'
+'ionsCheckBox'#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#6#20'BorderSpacin'
+'g.Around'#2#6#7'Caption'#6#26'RegularExpressionsCheckBox'#14'ParentShowHint'
+#8#8'ShowHint'#9#8'TabOrder'#2#2#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Lef'
+'t'#2#6#6'Height'#2#13#3'Top'#2'>'#5'Width'#3#183#0#0#0#9'TCheckBox'#22'Whol'
,'eWordsOnlyCheckBox'#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#6#20'Border'
+'Spacing.Around'#2#6#7'Caption'#6#22'WholeWordsOnlyCheckBox'#14'ParentShowHi'
+'nt'#8#8'ShowHint'#9#8'TabOrder'#2#3#18'AnchorSideTop.Side'#7#9'asrBottom'#4
+'Left'#2#6#6'Height'#2#13#3'Top'#2'%'#5'Width'#3#183#0#0#0#9'TCheckBox'#21'C'
+'aseSensitiveCheckBox'#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#6#20'Bord'
+'erSpacing.Around'#2#6#7'Caption'#6#21'CaseSensitiveCheckBox'#14'ParentShowH'
+'int'#8#8'ShowHint'#9#8'TabOrder'#2#4#18'AnchorSideTop.Side'#7#9'asrBottom'#4
+'Left'#2#6#6'Height'#2#13#3'Top'#2#12#5'Width'#3#183#0#0#0#0#9'TGroupBox'#13
+'ScopeGroupBox'#20'BorderSpacing.Around'#2#6#7'Caption'#6#13'ScopeGroupBox'
+#12'ClientHeight'#2'3'#11'ClientWidth'#3#195#0#8'TabOrder'#2#5#22'AnchorSide'
+'Left.Control'#7#15'OptionsGroupBox'#19'AnchorSideLeft.Side'#7#9'asrBottom'
+#21'AnchorSideTop.Control'#7#14'OriginGroupBox'#18'AnchorSideTop.Side'#7#9'a'
+'srBottom'#4'Left'#3#211#0#6'Height'#2'E'#3'Top'#3#141#0#5'Width'#3#199#0#0
+#12'TRadioButton'#19'SelectedRadioButton'#5'Align'#7#5'alTop'#17'BorderSpaci'
+'ng.Top'#2#6#20'BorderSpacing.Around'#2#6#7'Caption'#6#19'SelectedRadioButto'
+'n'#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#13#3'Top'#2#31#5'Width'#3#183#0#0
+#0#12'TRadioButton'#17'GlobalRadioButton'#5'Align'#7#5'alTop'#20'BorderSpaci'
+'ng.Around'#2#6#7'Caption'#6#17'GlobalRadioButton'#8'TabOrder'#2#1#4'Left'#2
+#6#6'Height'#2#13#3'Top'#2#6#5'Width'#3#183#0#0#0#0#9'TGroupBox'#17'Directio'
+'nGroupBox'#20'BorderSpacing.Around'#2#6#7'Caption'#6#17'DirectionGroupBox'
+#12'ClientHeight'#2'3'#11'ClientWidth'#3#195#0#8'TabOrder'#2#6#22'AnchorSide'
+'Left.Control'#7#15'OptionsGroupBox'#19'AnchorSideLeft.Side'#7#9'asrBottom'
+#21'AnchorSideTop.Control'#7#13'ScopeGroupBox'#18'AnchorSideTop.Side'#7#9'as'
+'rBottom'#4'Left'#3#211#0#6'Height'#2'E'#3'Top'#3#216#0#5'Width'#3#199#0#0#12
+'TRadioButton'#19'BackwardRadioButton'#5'Align'#7#5'alTop'#17'BorderSpacing.'
+'Top'#2#6#20'BorderSpacing.Around'#2#6#7'Caption'#6#19'BackwardRadioButton'#8
+'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#13#3'Top'#2#31#5'Width'#3#183#0#0#0#12
+'TRadioButton'#18'ForwardRadioButton'#5'Align'#7#5'alTop'#20'BorderSpacing.A'
+'round'#2#6#7'Caption'#6#18'ForwardRadioButton'#8'TabOrder'#2#1#4'Left'#2#6#6
+'Height'#2#13#3'Top'#2#6#5'Width'#3#183#0#0#0#0#9'TGroupBox'#14'OriginGroupB'
+'ox'#20'BorderSpacing.Around'#2#6#7'Caption'#6#14'OriginGroupBox'#12'ClientH'
+'eight'#2'3'#11'ClientWidth'#3#195#0#8'TabOrder'#2#7#22'AnchorSideLeft.Contr'
+'ol'#7#15'OptionsGroupBox'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorS'
+'ideTop.Control'#7#19'ReplaceTextComboBox'#18'AnchorSideTop.Side'#7#9'asrBot'
+'tom'#4'Left'#3#211#0#6'Height'#2'E'#3'Top'#2'B'#5'Width'#3#199#0#0#12'TRadi'
+'oButton'#21'FromCursorRadioButton'#5'Align'#7#5'alTop'#20'BorderSpacing.Aro'
+'und'#2#6#7'Caption'#6#21'FromCursorRadioButton'#8'TabOrder'#2#0#4'Left'#2#6
+#6'Height'#2#13#3'Top'#2#6#5'Width'#3#183#0#0#0#12'TRadioButton'#22'EntireSc'
+'opeRadioButton'#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#6#7'Caption'
+#6#22'EntireScopeRadioButton'#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#13#3'T'
+'op'#2#25#5'Width'#3#183#0#0#0#0#7'TBitBtn'#16'ReplaceAllButton'#7'Anchors'
+#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Ca'
+'ption'#6#4'&All'#21'Constraints.MaxHeight'#2'!'#4'Kind'#7#5'bkAll'#11'Modal'
+'Result'#2#8#9'NumGlyphs'#2#0#8'TabOrder'#2#8#23'AnchorSideRight.Control'#7#8
+'OKButton'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'
+#7#9'asrBottom'#4'Left'#3#24#1#6'Height'#2'!'#3'Top'#3'$'#1#5'Width'#2'>'#0#0
+#0
]);

View File

@ -40,32 +40,39 @@ interface
uses
Classes, SysUtils, LCLProc, LCLType, Controls, StdCtrls, Forms, Buttons,
ExtCtrls, LResources, Dialogs, SynEditTypes, SynRegExpr, SynEdit,
LazarusIdeStrConsts;
LazarusIdeStrConsts, Math;
type
TFindDlgComponent = (fdcText, fdcReplace);
TOnFindDlgKey = procedure(Sender: TObject; var Key: Word; Shift:TShiftState;
FindDlgComponent: TFindDlgComponent) of Object;
{ TLazFindReplaceDialog }
TLazFindReplaceDialog = class(TForm)
BackwardRadioButton: TRadioButton;
ReplaceAllButton: TBitBtn;
CaseSensitiveCheckBox: TCheckBox;
EntireScopeRadioButton: TRadioButton;
ForwardRadioButton: TRadioButton;
FromCursorRadioButton: TRadioButton;
GlobalRadioButton: TRadioButton;
DirectionGroupBox: TGroupBox;
OriginGroupBox: TGroupBox;
ScopeGroupBox: TGroupBox;
OptionsGroupBox: TGroupBox;
MultiLineCheckBox: TCheckBox;
OKButton: TBitBtn;
PromptOnReplaceCheckBox: TCheckBox;
RegularExpressionsCheckBox: TCheckBox;
SelectedRadioButton: TRadioButton;
TextToFindLabel: TLabel;
ReplaceWithLabel: TLabel;
TextToFindComboBox: TComboBox;
ReplaceTextComboBox: TComboBox;
OptionsGroupBox: TGroupBox;
CaseSensitiveCheckBox: TCheckBox;
CancelButton: TBitBtn;
WholeWordsOnlyCheckBox: TCheckBox;
RegularExpressionsCheckBox: TCheckBox;
MultiLineCheckBox: TCheckBox;
PromptOnReplaceCheckBox: TCheckBox;
DirectionRadioGroup: TRadioGroup;
ScopeRadioGroup: TRadioGroup;
OriginRadioGroup: TRadioGroup;
OkButton: TButton;
ReplaceAllButton: TButton;
CancelButton: TButton;
procedure LazFindReplaceDialogResize(Sender: TObject);
procedure OptionsGroupBoxResize(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure TextToFindComboboxKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure OkButtonClick(Sender: TObject);
@ -107,232 +114,59 @@ implementation
{ TLazFindReplaceDialog }
constructor TLazFindReplaceDialog.Create(TheOwner:TComponent);
var
x: Integer;
y: Integer;
ComboX: Integer;
OptionW: Integer;
OptionsGrpW: Integer;
OptionY: Integer;
OptionH: Integer;
begin
inherited Create(TheOwner);
Name:='LazFindReplaceDialog';
Caption:='';
Width:=400;
Height:=300;
BorderStyle:= bsDialog;
Position:=poDesigned;
OnResize:=@LazFindReplaceDialogResize;
x:=4;
y:=4;
ComboX:=x+90;
TextToFindComboBox:=TComboBox.Create(Self);
with TextToFindComboBox do begin
Name:='TextToFindComboBox';
SetBounds(ComboX,y,Self.ClientWidth-ComboX-x,Height);
Anchors:= [akLeft, akTop, akRight];
Text:='';
AutoCompleteText := [cbactEnabled, cbactEndOfLineComplete, cbactRetainPrefixCase, cbactSearchAscending];
OnKeyDown:=@TextToFindComboBoxKeyDown;
Parent:=Self;
TabOrder:=0;
end;
TextToFindComboBox.Text:='';
TextToFindLabel.Caption:=dlgTextToFing;
ReplaceTextComboBox.Text:='';
ReplaceWithLabel.Caption:=dlgReplaceWith;
TextToFindLabel:=TLabel.Create(Self);
with TextToFindLabel do begin
Name:='TextToFindLabel';
SetBounds(x,y+3,ComboX-x,Height);
Caption:=dlgTextToFing;
FocusControl:= TextToFindComboBox;
Parent:=Self;
end;
inc(y,TextToFindComboBox.Height+1);
ReplaceTextComboBox:=TComboBox.Create(Self);
with ReplaceTextComboBox do begin
Name:='ReplaceTextComboBox';
SetBounds(ComboX,y,Self.ClientWidth-ComboX-x,Height);
Anchors:= [akLeft, akTop, akRight];
Text:='';
AutoCompleteText := [cbactEnabled, cbactEndOfLineComplete, cbactRetainPrefixCase, cbactSearchAscending];
OnKeyDown:=@TextToFindComboBoxKeyDown;
Parent:=Self;
TabOrder:=1;
end;
ReplaceWithLabel:=TLabel.Create(Self);
with ReplaceWithLabel do begin
Name:='ReplaceWithLabel';
SetBounds(x,y+3,ComboX-x,Height);
Caption:=dlgReplaceWith;
FocusControl:= ReplaceTextComboBox;
Parent:=Self;
end;
inc(y,ReplaceTextComboBox.Height+1);
OptionsGroupBox.Caption:=dlgFROpts;
OptionsGrpW:=(ClientWidth-15) div 2;
x:=5;
OptionsGroupBox:=TGroupBox.Create(Self);
with OptionsGroupBox do begin
Name:='OptionsGroupBox';
SetBounds(x,y,OptionsGrpW,160);
Caption:=dlgFROpts;
OnResize:=@OptionsGroupBoxResize;
Parent:=Self;
end;
OptionH:=OptionsGroupBox.ClientHeight div 5;
OptionW:=OptionsGroupBox.ClientWidth-12;
OptionY:=2;
CaseSensitiveCheckBox:=TCheckBox.Create(Self);
with CaseSensitiveCheckBox do begin
Name:='CaseSensitiveCheckBox';
Parent:=OptionsGroupBox;
AutoSize := True;
SetBounds(8,OptionY,OptionW,Height);
Caption:=dlgCaseSensitive;
Hint:=lisDistinguishBigAndSmallLettersEGAAndA;
ShowHint:=true;
inc(OptionY,OptionH);
end;
WholeWordsOnlyCheckBox:=TCheckBox.Create(Self);
with WholeWordsOnlyCheckBox do begin
Name:='WholeWordsOnlyCheckBox';
Parent:=OptionsGroupBox;
AutoSize := False;
SetBounds(8,OptionY,OptionW,Height);
Caption:=dlgWholeWordsOnly;
Hint:=lisOnlySearchForWholeWords;
ShowHint:=true;
inc(OptionY,OptionH);
end;
RegularExpressionsCheckBox:=TCheckBox.Create(Self);
with RegularExpressionsCheckBox do begin
Name:='RegularExpressionsCheckBox';
Parent:=OptionsGroupBox;
AutoSize := False;
SetBounds(8,OptionY,OptionW,Height);
Caption:=dlgRegularExpressions;
Hint:=lisActivateRegularExpressionSyntaxForTextAndReplaceme;
ShowHint:=true;
inc(OptionY,OptionH);
end;
MultiLineCheckBox:=TCheckBox.Create(Self);
with MultiLineCheckBox do begin
Name:='MultiLineCheckBox';
Parent:=OptionsGroupBox;
AutoSize := False;
SetBounds(8,OptionY,OptionW,Height);
Caption:=dlgMultiLine;
Enabled:=false;
Hint:=lisAllowSearchingForMultipleLines;
ShowHint:=true;
inc(OptionY,OptionH);
end;
PromptOnReplaceCheckBox:=TCheckBox.Create(Self);
with PromptOnReplaceCheckBox do begin
Name:='PromptOnReplaceCheckBox';
Parent:=OptionsGroupBox;
AutoSize := False;
SetBounds(8,OptionY,OptionW,Height);
Caption:=dlgPromptOnReplace;
Checked:=true;
Hint:=lisAskBeforeReplacingEachFoundText;
ShowHint:=true;
inc(OptionY,OptionH);
end;
OriginRadioGroup:=TRadioGroup.Create(Self);
with OriginRadioGroup do begin
Name:='OriginRadioGroup';
Parent:= Self;
SetBounds(x+OptionsGrpW+x,OptionsGroupBox.Top,OptionsGrpW,65);
Caption:=dlgSROrigin;
with Items do begin
BeginUpdate;
Clear;
Add(dlgFromCursor);
Add(dlgEntireScope);
EndUpdate;
end;
ItemIndex:=0;
end;
OriginGroupBox.Caption:=dlgSROrigin;
FromCursorRadioButton.Caption := dlgFromCursor;
EntireScopeRadioButton.Caption := dlgEntireScope;
ScopeRadioGroup:=TRadioGroup.Create(Self);
with ScopeRadioGroup do begin
Name:='ScopeRadioGroup';
Parent:=Self;
SetBounds(OriginRadioGroup.Left,
OriginRadioGroup.Top+OriginRadioGroup.Height+5,
OriginRadioGroup.Width,65);
Caption:=dlgScope;
with Items do begin
BeginUpdate;
Clear;
Add(dlgGlobal);
Add(dlgSelectedText);
EndUpdate;
end;
ItemIndex:=0;
end;
ScopeGroupBox.Caption:=dlgScope;
GlobalRadioButton.Caption := dlgGlobal;
SelectedRadioButton.Caption := dlgSelectedText;
DirectionRadioGroup:=TRadioGroup.Create(Self);
with DirectionRadioGroup do begin
Name:='DirectionRadioGroup';
Parent:=Self;
SetBounds(OriginRadioGroup.Left,
ScopeRadioGroup.Top+ScopeRadioGroup.Height+5,
OriginRadioGroup.Width,65);
Caption:=dlgDirection;
with Items do begin
BeginUpdate;
Clear;
Add(lisFRForwardSearch);
Add(lisFRBackwardSearch);
EndUpdate;
end;
ItemIndex:=0;
end;
DirectionGroupBox.Caption:=dlgDirection;
ForwardRadioButton.Caption := lisFRForwardSearch;
BackwardRadioButton.Caption := lisFRBackwardSearch;
OkButton:=TButton.Create(Self);
with OkButton do begin
Name:='OkButton';
Parent:= Self;
Default:=true;
SetBounds(Parent.ClientWidth-350,Parent.ClientHeight-32,120,Height);
Caption:='O&k';
OnClick:=@OkButtonClick;
end;
ReplaceAllButton.Caption:=dlgReplaceAll;
CancelButton.Caption:=dlgCancel;
ReplaceAllButton:=TButton.Create(Self);
with ReplaceAllButton do begin
Name:='ReplaceAllButton';
Parent:= Self;
SetBounds(OkButton.Left+OkButton.Width+10,OkButton.Top,120,Height);
Caption:=dlgReplaceAll;
OnClick:=@ReplaceAllButtonClick;
end;
CancelButton:=TButton.Create(Self);
with CancelButton do begin
Name:='CancelButton';
Parent:= Self;
Cancel:=true;
SetBounds(ReplaceAllButton.Left+ReplaceAllButton.Width+10,OkButton.Top,
80,Height);
Caption:=dlgCancel;
OnClick:=@CancelButtonClick;
end;
fReplaceAllClickedLast:=false;
ActiveControl:=TextToFindComboBox;
end;
destructor TLazFindReplaceDialog.Destroy;
@ -361,104 +195,21 @@ begin
end;
end;
procedure TLazFindReplaceDialog.OptionsGroupBoxResize(Sender: TObject);
procedure TLazFindReplaceDialog.FormResize(Sender: TObject);
var
OptionH: Integer;
OptionW: Integer;
OptionY: Integer;
w: integer;
h: integer;
begin
OptionH:=OptionsGroupBox.ClientHeight div 5;
OptionW:=OptionsGroupBox.ClientWidth-12;
OptionY:=2;
with CaseSensitiveCheckBox do begin
SetBounds(8,OptionY,OptionW,Height);
inc(OptionY,OptionH);
end;
with WholeWordsOnlyCheckBox do begin
SetBounds(8,OptionY,OptionW,Height);
inc(OptionY,OptionH);
end;
with RegularExpressionsCheckBox do begin
SetBounds(8,OptionY,OptionW,Height);
inc(OptionY,OptionH);
end;
with MultiLineCheckBox do begin
SetBounds(8,OptionY,OptionW,Height);
inc(OptionY,OptionH);
end;
with PromptOnReplaceCheckBox do begin
SetBounds(8,OptionY,OptionW,Height);
inc(OptionY,OptionH);
end;
end;
procedure TLazFindReplaceDialog.LazFindReplaceDialogResize(Sender: TObject);
var
x: Integer;
y: Integer;
ComboX: Integer;
OptionsGrpW: Integer;
begin
x:=4;
y:=4;
ComboX:=x+90;
with TextToFindComboBox do begin
SetBounds(ComboX,y,Parent.ClientWidth-ComboX-x,Height);
end;
with TextToFindLabel do begin
SetBounds(x,y+3,ComboX-x,Height);
end;
inc(y,TextToFindComboBox.Height+1);
with ReplaceTextComboBox do begin
SetBounds(ComboX,y,Parent.ClientWidth-ComboX-x,Height);
end;
with ReplaceWithLabel do begin
SetBounds(x,y+3,ComboX-x,Height);
end;
inc(y,ReplaceTextComboBox.Height+1);
OptionsGrpW:=(ClientWidth-15) div 2;
x:=5;
with OptionsGroupBox do begin
SetBounds(x,y,OptionsGrpW,160);
end;
with OriginRadioGroup do begin
SetBounds(x+OptionsGrpW+x,OptionsGroupBox.Top,OptionsGrpW,65);
end;
with ScopeRadioGroup do begin
SetBounds(OriginRadioGroup.Left,
OriginRadioGroup.Top+OriginRadioGroup.Height+5,
OriginRadioGroup.Width,65);
end;
with DirectionRadioGroup do begin
SetBounds(OriginRadioGroup.Left,
ScopeRadioGroup.Top+ScopeRadioGroup.Height+5,
OriginRadioGroup.Width,65);
end;
with OkButton do begin
SetBounds(Parent.ClientWidth-350,Parent.ClientHeight-32,120,Height);
end;
with ReplaceAllButton do begin
SetBounds(OkButton.Left+OkButton.Width+10,OkButton.Top,120,Height);
end;
with CancelButton do begin
SetBounds(ReplaceAllButton.Left+ReplaceAllButton.Width+10,OkButton.Top,
80,Height);
end;
w := (Width - 18) div 2;
OptionsGroupBox.Width := w;
OriginGroupBox.Width := w;
ScopeGroupBox.Width := w;
DirectionGroupBox.Width := w;
h := (OptionsGroupBox.Height - 12) div 3;
OriginGroupBox.Height := h;
ScopeGroupBox.Height := h;
DirectionGroupBox.Height := h;
end;
procedure TLazFindReplaceDialog.OkButtonClick(Sender:TObject);
@ -466,7 +217,6 @@ begin
if not CheckInput then exit;
fReplaceAllClickedLast:=false;
ActiveControl:=TextToFindComboBox;
ModalResult:=mrOk;
end;
procedure TLazFindReplaceDialog.ReplaceAllButtonClick(Sender:TObject);
@ -474,13 +224,11 @@ begin
if not CheckInput then exit;
fReplaceAllClickedLast:=true;
ActiveControl:=TextToFindComboBox;
ModalResult:=mrAll;
end;
procedure TLazFindReplaceDialog.CancelButtonClick(Sender:TObject);
begin
ActiveControl:=TextToFindComboBox;
ModalResult:=mrCancel;
end;
function TLazFindReplaceDialog.CheckInput: boolean;
@ -544,28 +292,30 @@ begin
RegularExpressionsCheckBox.Checked:=ssoRegExpr in NewOptions;
MultiLineCheckBox.Checked:=ssoRegExprMultiLine in NewOptions;
PromptOnReplaceCheckBox.Checked:=ssoPrompt in NewOptions;
if ssoEntireScope in NewOptions
then OriginRadioGroup.ItemIndex:=1
else OriginRadioGroup.ItemIndex:=0;
then EntireScopeRadioButton.Checked:=True
else FromCursorRadioButton.Checked:=True;
if ssoSelectedOnly in NewOptions
then ScopeRadioGroup.ItemIndex:=1
else ScopeRadioGroup.ItemIndex:=0;
then SelectedRadioButton.Checked:=True
else GlobalRadioButton.Checked:=True;
if ssoBackwards in NewOptions
then DirectionRadioGroup.ItemIndex:=1
else DirectionRadioGroup.ItemIndex:=0;
if ssoSelectedOnly in NewOptions then
ScopeRadioGroup.ItemIndex := 1 else
ScopeRadioGroup.ItemIndex := 0;
ReplaceAllButton.Enabled:=ssoReplace in NewOptions;
ReplaceTextComboBox.Enabled:=ReplaceAllButton.Enabled;
ReplaceWithLabel.Enabled:=ReplaceAllButton.Enabled;
PromptOnReplaceCheckBox.Enabled:=ReplaceAllButton.Enabled;
then BackwardRadioButton.Checked:=True
else ForwardRadioButton.Checked:=True;
ReplaceAllButton.Visible:=ssoReplace in NewOptions;
ReplaceTextComboBox.Enabled:=ReplaceAllButton.Visible;
ReplaceWithLabel.Enabled:=ReplaceAllButton.Visible;
PromptOnReplaceCheckBox.Enabled:=ReplaceAllButton.Visible;
if ssoReplace in NewOptions then begin
Caption:=lisMenuReplace;
OkButton.Caption:=lisMenuReplace;
CancelButton.AnchorSideRight.Control := ReplaceAllButton
end else begin
Caption:=lisMenuFind ;
OkButton.Caption:=lisMenuFind ;
CancelButton.AnchorSideRight.Control := OKButton;
end;
end;
@ -577,10 +327,11 @@ begin
if RegularExpressionsCheckBox.Checked then Include(Result,ssoRegExpr);
if MultiLineCheckBox.Checked then Include(Result,ssoRegExprMultiLine);
if PromptOnReplaceCheckBox.Checked then Include(Result,ssoPrompt);
if OriginRadioGroup.ItemIndex=1 then Include(Result,ssoEntireScope);
if ScopeRadioGroup.ItemIndex=1 then include(Result,ssoSelectedOnly);
if DirectionRadioGroup.ItemIndex=1 then include(Result,ssoBackwards);
if ReplaceAllButton.Enabled then include(Result,ssoReplace);
if EntireScopeRadioButton.Checked then Include(Result,ssoEntireScope);
if SelectedRadioButton.Checked then include(Result,ssoSelectedOnly);
if BackwardRadioButton.Checked then include(Result,ssoBackwards);
if ReplaceAllButton.Visible then include(Result,ssoReplace);
if fReplaceAllClickedLast then include(Result,ssoReplaceAll);
end;
@ -621,4 +372,7 @@ begin
end;
end;
initialization
{$I findreplacedialog.lrs}
end.