mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 12:00:15 +02:00
added ideintf/stringspropeditdlg.pas
git-svn-id: trunk@9353 -
This commit is contained in:
parent
3d36c2396e
commit
085f6ed50a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1347,6 +1347,7 @@ ideintf/stringgriddlg.lfm svneol=native#text/plain
|
|||||||
ideintf/stringgriddlg.lrs svneol=native#text/plain
|
ideintf/stringgriddlg.lrs svneol=native#text/plain
|
||||||
ideintf/stringspropeditdlg.lfm svneol=native#text/plain
|
ideintf/stringspropeditdlg.lfm svneol=native#text/plain
|
||||||
ideintf/stringspropeditdlg.lrs svneol=native#text/plain
|
ideintf/stringspropeditdlg.lrs svneol=native#text/plain
|
||||||
|
ideintf/stringspropeditdlg.pas svneol=native#text/plain
|
||||||
ideintf/texttools.pas svneol=native#text/pascal
|
ideintf/texttools.pas svneol=native#text/pascal
|
||||||
ideintf/treeviewpropedit.lfm svneol=native#text/plain
|
ideintf/treeviewpropedit.lfm svneol=native#text/plain
|
||||||
ideintf/treeviewpropedit.lrs svneol=native#text/plain
|
ideintf/treeviewpropedit.lrs svneol=native#text/plain
|
||||||
|
@ -19,12 +19,12 @@ object AnchorDesigner: TAnchorDesigner
|
|||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
Caption = 'BorderSpaceGroupBox'
|
Caption = 'BorderSpaceGroupBox'
|
||||||
ClientHeight = 87
|
ClientHeight = 87
|
||||||
ClientWidth = 168
|
ClientWidth = 176
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Left = 172
|
Left = 170
|
||||||
Height = 104
|
Height = 104
|
||||||
Top = 80
|
Top = 80
|
||||||
Width = 172
|
Width = 180
|
||||||
object LeftBorderSpaceSpinEdit: TSpinEdit
|
object LeftBorderSpaceSpinEdit: TSpinEdit
|
||||||
OnChange = BorderSpaceSpinEditChange
|
OnChange = BorderSpaceSpinEditChange
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TAnchorDesigner','FORMDATA',[
|
LazarusResources.Add('TAnchorDesigner','FORMDATA',[
|
||||||
'TPF0'#15'TAnchorDesigner'#14'AnchorDesigner'#13'ActiveControl'#7#23'LeftBord'
|
'TPF0'#15'TAnchorDesigner'#14'AnchorDesigner'#13'ActiveControl'#7#23'LeftBord'
|
||||||
+'erSpaceSpinEdit'#7'Caption'#6#14'AnchorDesigner'#12'ClientHeight'#3#3#1#11
|
+'erSpaceSpinEdit'#7'Caption'#6#14'AnchorDesigner'#12'ClientHeight'#3#3#1#11
|
||||||
@ -7,8 +9,8 @@ LazarusResources.Add('TAnchorDesigner','FORMDATA',[
|
|||||||
+#18'HorzScrollBar.Page'#3#7#2#18'VertScrollBar.Page'#3#2#1#4'Left'#3'*'#1#6
|
+#18'HorzScrollBar.Page'#3#7#2#18'VertScrollBar.Page'#3#2#1#4'Left'#3'*'#1#6
|
||||||
+'Height'#3#3#1#3'Top'#3#179#0#5'Width'#3#8#2#0#9'TGroupBox'#19'BorderSpaceGr'
|
+'Height'#3#3#1#3'Top'#3#179#0#5'Width'#3#8#2#0#9'TGroupBox'#19'BorderSpaceGr'
|
||||||
+'oupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#19'Bord'
|
+'oupBox'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'Caption'#6#19'Bord'
|
||||||
+'erSpaceGroupBox'#12'ClientHeight'#2'W'#11'ClientWidth'#3#168#0#8'TabOrder'#2
|
+'erSpaceGroupBox'#12'ClientHeight'#2'W'#11'ClientWidth'#3#176#0#8'TabOrder'#2
|
||||||
+#0#4'Left'#3#172#0#6'Height'#2'h'#3'Top'#2'P'#5'Width'#3#172#0#0#9'TSpinEdit'
|
+#0#4'Left'#3#170#0#6'Height'#2'h'#3'Top'#2'P'#5'Width'#3#180#0#0#9'TSpinEdit'
|
||||||
+#23'LeftBorderSpaceSpinEdit'#8'OnChange'#7#25'BorderSpaceSpinEditChange'#14
|
+#23'LeftBorderSpaceSpinEdit'#8'OnChange'#7#25'BorderSpaceSpinEditChange'#14
|
||||||
+'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#0#5'Value'#2#1#6'Height'#2#20
|
+'ParentShowHint'#8#8'ShowHint'#9#8'TabOrder'#2#0#5'Value'#2#1#6'Height'#2#20
|
||||||
+#3'Top'#2#30#5'Width'#2'8'#0#0#9'TSpinEdit'#24'RightBorderSpaceSpinEdit'#8'O'
|
+#3'Top'#2#30#5'Width'#2'8'#0#0#9'TSpinEdit'#24'RightBorderSpaceSpinEdit'#8'O'
|
||||||
|
@ -49,6 +49,7 @@ uses
|
|||||||
ProjectIntf,
|
ProjectIntf,
|
||||||
PropEdits,
|
PropEdits,
|
||||||
SrcEditorIntf,
|
SrcEditorIntf,
|
||||||
|
StringsPropEditDlg,
|
||||||
TextTools,
|
TextTools,
|
||||||
TreeViewPropEdit;
|
TreeViewPropEdit;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ uses
|
|||||||
LCLProc, Forms, Controls, GraphType,
|
LCLProc, Forms, Controls, GraphType,
|
||||||
Graphics, StdCtrls, Buttons, ComCtrls, Menus, LCLType, ExtCtrls, LCLIntf,
|
Graphics, StdCtrls, Buttons, ComCtrls, Menus, LCLType, ExtCtrls, LCLIntf,
|
||||||
Dialogs, Grids, EditBtn, PropertyStorage, TextTools, FrmSelectProps,
|
Dialogs, Grids, EditBtn, PropertyStorage, TextTools, FrmSelectProps,
|
||||||
ColumnDlg, FileUtil, ObjInspStrConsts;
|
StringsPropEditDlg, ColumnDlg, FileUtil, ObjInspStrConsts;
|
||||||
|
|
||||||
const
|
const
|
||||||
MaxIdentLength: Byte = 63;
|
MaxIdentLength: Byte = 63;
|
||||||
@ -1354,24 +1354,10 @@ type
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
{ TStringsPropEditorDlg }
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TStringsPropEditorDlg = class(TForm)
|
TStringsPropEditorDlg = class(TStringsPropEditorFrm)
|
||||||
OKButton: TBitBtn;
|
|
||||||
CancelButton: TBitBtn;
|
|
||||||
StatusLabel: TLabel;
|
|
||||||
SortButton: TButton;
|
|
||||||
GroupBox1: TGroupBox;
|
|
||||||
Memo: TMemo;
|
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure MemoChange(Sender: TObject);
|
|
||||||
procedure SortButtonClick(Sender: TObject);
|
|
||||||
public
|
public
|
||||||
Editor: TPropertyEditor;
|
Editor: TPropertyEditor;
|
||||||
procedure AddButtons; virtual;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@ -4511,62 +4497,6 @@ begin
|
|||||||
Result := [paMultiSelect, paAutoUpdate, paRevertable];
|
Result := [paMultiSelect, paAutoUpdate, paRevertable];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TStringsPropEditorDlg }
|
|
||||||
|
|
||||||
procedure TStringsPropEditorDlg.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Caption := oisStringsEditorDialog;
|
|
||||||
StatusLabel.Caption := ois0Lines0Chars;
|
|
||||||
SortButton.Caption := oisSort;
|
|
||||||
|
|
||||||
AddButtons;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TStringsPropEditorDlg.MemoChange(Sender: TObject);
|
|
||||||
var
|
|
||||||
NumChars: Integer;
|
|
||||||
I: Integer;
|
|
||||||
begin
|
|
||||||
NumChars := 0;
|
|
||||||
for I := 0 to Memo.Lines.Count - 1 do Inc(NumChars, Length(Memo.Lines[I]));
|
|
||||||
|
|
||||||
if Memo.Lines.Count = 1 then
|
|
||||||
StatusLabel.Text := Format(ois1LineDChars, [NumChars])
|
|
||||||
else
|
|
||||||
StatusLabel.Text := Format(oisDLinesDChars, [Memo.Lines.Count, NumChars]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TStringsPropEditorDlg.SortButtonClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
OldText, NewSortedText: String;
|
|
||||||
SortOnlySelection: Boolean;
|
|
||||||
begin
|
|
||||||
if not Assigned(ShowSortSelectionDialogFunc) then
|
|
||||||
begin
|
|
||||||
SortButton.Enabled := False;
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
SortOnlySelection := True;
|
|
||||||
OldText := Memo.SelText;
|
|
||||||
if OldText = '' then
|
|
||||||
begin
|
|
||||||
SortOnlySelection := False;
|
|
||||||
OldText := Memo.Lines.Text;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if ShowSortSelectionDialogFunc(OldText, nil, NewSortedText) <> mrOk then Exit;
|
|
||||||
if SortOnlySelection then
|
|
||||||
Memo.SelText := NewSortedText
|
|
||||||
else
|
|
||||||
Memo.Lines.Text := NewSortedText;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TStringsPropEditorDlg.AddButtons;
|
|
||||||
begin
|
|
||||||
//
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TStringsPropertyEditor }
|
{ TStringsPropertyEditor }
|
||||||
|
|
||||||
procedure TStringsPropertyEditor.Edit;
|
procedure TStringsPropertyEditor.Edit;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
object StringsPropEditorDlg: TStringsPropEditorDlg
|
object StringsPropEditorFrm: TStringsPropEditorFrm
|
||||||
ActiveControl = Memo
|
ActiveControl = Memo
|
||||||
Caption = 'StringsPropEditorDlg'
|
Caption = 'StringsPropEditorFrm'
|
||||||
ClientHeight = 300
|
ClientHeight = 300
|
||||||
ClientWidth = 400
|
ClientWidth = 400
|
||||||
Constraints.MinHeight = 160
|
Constraints.MinHeight = 160
|
||||||
Constraints.MinWidth = 180
|
Constraints.MinWidth = 180
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 112
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
HorzScrollBar.Page = 399
|
HorzScrollBar.Page = 399
|
||||||
VertScrollBar.Page = 299
|
VertScrollBar.Page = 299
|
||||||
@ -18,12 +18,12 @@ object StringsPropEditorDlg: TStringsPropEditorDlg
|
|||||||
Align = alTop
|
Align = alTop
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
ClientHeight = 238
|
||||||
ClientHeight = 240
|
|
||||||
ClientWidth = 384
|
ClientWidth = 384
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
|
AnchorSideBottom.Control = OKButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 258
|
Height = 255
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 388
|
Width = 388
|
||||||
object StatusLabel: TLabel
|
object StatusLabel: TLabel
|
||||||
@ -34,7 +34,7 @@ object StringsPropEditorDlg: TStringsPropEditorDlg
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
Left = 9
|
Left = 9
|
||||||
Height = 14
|
Height = 14
|
||||||
Top = 218
|
Top = 216
|
||||||
Width = 57
|
Width = 57
|
||||||
end
|
end
|
||||||
object Memo: TMemo
|
object Memo: TMemo
|
||||||
@ -45,14 +45,14 @@ object StringsPropEditorDlg: TStringsPropEditorDlg
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
WordWrap = False
|
WordWrap = False
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 208
|
Height = 206
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 290
|
Width = 290
|
||||||
end
|
end
|
||||||
object SortButton: TButton
|
object SortButton: TButton
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
BorderSpacing.InnerBorder = 4
|
||||||
Caption = 'Sort'
|
Caption = 'Sort'
|
||||||
OnClick = SortButtonClick
|
OnClick = SortButtonClick
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -64,32 +64,34 @@ object StringsPropEditorDlg: TStringsPropEditorDlg
|
|||||||
end
|
end
|
||||||
object OKButton: TBitBtn
|
object OKButton: TBitBtn
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
|
||||||
Caption = '&OK'
|
Caption = '&OK'
|
||||||
Default = True
|
Default = True
|
||||||
Kind = bkOK
|
Kind = bkOK
|
||||||
ModalResult = 1
|
ModalResult = 1
|
||||||
NumGlyphs = 0
|
NumGlyphs = 0
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Left = 318
|
Left = 338
|
||||||
Height = 25
|
Height = 28
|
||||||
Top = 270
|
Top = 267
|
||||||
Width = 75
|
Width = 55
|
||||||
end
|
end
|
||||||
object CancelButton: TBitBtn
|
object CancelButton: TBitBtn
|
||||||
Anchors = [akRight, akBottom]
|
Anchors = [akRight, akBottom]
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Right = 6
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
|
||||||
Cancel = True
|
Cancel = True
|
||||||
Caption = 'Cancel'
|
Caption = 'Cancel'
|
||||||
Kind = bkCancel
|
Kind = bkCancel
|
||||||
ModalResult = 2
|
ModalResult = 2
|
||||||
NumGlyphs = 0
|
NumGlyphs = 0
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Left = 234
|
AnchorSideRight.Control = OKButton
|
||||||
Height = 25
|
Left = 249
|
||||||
Top = 270
|
Height = 28
|
||||||
Width = 75
|
Top = 267
|
||||||
|
Width = 77
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,28 +1,32 @@
|
|||||||
LazarusResources.Add('TStringsPropEditorDlg','FORMDATA',[
|
{ This is an automatically generated lazarus resource file }
|
||||||
'TPF0'#21'TStringsPropEditorDlg'#20'StringsPropEditorDlg'#13'ActiveControl'#7
|
|
||||||
+#4'Memo'#7'Caption'#6#20'StringsPropEditorDlg'#12'ClientHeight'#3','#1#11'Cl'
|
LazarusResources.Add('TStringsPropEditorFrm','FORMDATA',[
|
||||||
|
'TPF0'#21'TStringsPropEditorFrm'#20'StringsPropEditorFrm'#13'ActiveControl'#7
|
||||||
|
+#4'Memo'#7'Caption'#6#20'StringsPropEditorFrm'#12'ClientHeight'#3','#1#11'Cl'
|
||||||
+'ientWidth'#3#144#1#21'Constraints.MinHeight'#3#160#0#20'Constraints.MinWidt'
|
+'ientWidth'#3#144#1#21'Constraints.MinHeight'#3#160#0#20'Constraints.MinWidt'
|
||||||
+'h'#3#180#0#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'`'#8'Position'#7
|
+'h'#3#180#0#8'OnCreate'#7#10'FormCreate'#13'PixelsPerInch'#2'p'#8'Position'#7
|
||||||
+#14'poScreenCenter'#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3
|
+#14'poScreenCenter'#18'HorzScrollBar.Page'#3#143#1#18'VertScrollBar.Page'#3
|
||||||
+'+'#1#4'Left'#3'"'#1#6'Height'#3','#1#3'Top'#3#153#0#5'Width'#3#144#1#0#9'TG'
|
+'+'#1#4'Left'#3'"'#1#6'Height'#3','#1#3'Top'#3#153#0#5'Width'#3#144#1#0#9'TG'
|
||||||
+'roupBox'#9'GroupBox1'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7
|
+'roupBox'#9'GroupBox1'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7
|
||||||
+'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#12'ClientHeight'#3#240#0
|
+'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#12'ClientHeight'#3#238#0
|
||||||
+#11'ClientWidth'#3#128#1#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#3#2#1#3'Top'#2
|
+#11'ClientWidth'#3#128#1#8'TabOrder'#2#0#24'AnchorSideBottom.Control'#7#8'OK'
|
||||||
+#6#5'Width'#3#132#1#0#6'TLabel'#11'StatusLabel'#7'Anchors'#11#6'akLeft'#8'ak'
|
+'Button'#4'Left'#2#6#6'Height'#3#255#0#3'Top'#2#6#5'Width'#3#132#1#0#6'TLabe'
|
||||||
+'Bottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#11'StatusLabel'#5'Color'
|
+'l'#11'StatusLabel'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#20'BorderSpacing.A'
|
||||||
+#7#6'clNone'#11'ParentColor'#8#4'Left'#2#9#6'Height'#2#14#3'Top'#3#218#0#5'W'
|
+'round'#2#6#7'Caption'#6#11'StatusLabel'#5'Color'#7#6'clNone'#11'ParentColor'
|
||||||
+'idth'#2'9'#0#0#5'TMemo'#4'Memo'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
+#8#4'Left'#2#9#6'Height'#2#14#3'Top'#3#216#0#5'Width'#2'9'#0#0#5'TMemo'#4'Me'
|
||||||
+#8'akBottom'#0#20'BorderSpacing.Around'#2#6#8'OnChange'#7#10'MemoChange'#10
|
+'mo'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpac'
|
||||||
+'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#8'WordWrap'#8#4'Left'#2#6#6'He'
|
+'ing.Around'#2#6#8'OnChange'#7#10'MemoChange'#10'ScrollBars'#7#10'ssAutoBoth'
|
||||||
+'ight'#3#208#0#3'Top'#2#6#5'Width'#3'"'#1#0#0#7'TButton'#10'SortButton'#7'An'
|
+#8'TabOrder'#2#0#8'WordWrap'#8#4'Left'#2#6#6'Height'#3#206#0#3'Top'#2#6#5'Wi'
|
||||||
+'chors'#11#5'akTop'#7'akRight'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#4
|
+'dth'#3'"'#1#0#0#7'TButton'#10'SortButton'#7'Anchors'#11#5'akTop'#7'akRight'
|
||||||
+'Sort'#7'OnClick'#7#15'SortButtonClick'#8'TabOrder'#2#1#4'Left'#3'0'#1#6'Hei'
|
+#0#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
|
||||||
+'ght'#2#25#3'Top'#2#6#5'Width'#2'K'#0#0#0#7'TBitBtn'#8'OKButton'#7'Anchors'
|
+#6#4'Sort'#7'OnClick'#7#15'SortButtonClick'#8'TabOrder'#2#1#4'Left'#3'0'#1#6
|
||||||
+#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#3'&OK'
|
+'Height'#2#25#3'Top'#2#6#5'Width'#2'K'#0#0#0#7'TBitBtn'#8'OKButton'#7'Anchor'
|
||||||
+#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOr'
|
+'s'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7
|
||||||
+'der'#2#1#4'Left'#3'>'#1#6'Height'#2#25#3'Top'#3#14#1#5'Width'#2'K'#0#0#7'TB'
|
+'Caption'#6#3'&OK'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumG'
|
||||||
+'itBtn'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#20'BorderSpa'
|
+'lyphs'#2#0#8'TabOrder'#2#1#4'Left'#3'R'#1#6'Height'#2#28#3'Top'#3#11#1#5'Wi'
|
||||||
+'cing.Around'#2#6#6'Cancel'#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11
|
+'dth'#2'7'#0#0#7'TBitBtn'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBott'
|
||||||
+'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#2#4'Left'#3#234#0#6'Height'
|
+'om'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Around'#2#6
|
||||||
+#2#25#3'Top'#3#14#1#5'Width'#2'K'#0#0#0
|
+#6'Cancel'#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2
|
||||||
|
+#9'NumGlyphs'#2#0#8'TabOrder'#2#2#23'AnchorSideRight.Control'#7#8'OKButton'#4
|
||||||
|
+'Left'#3#249#0#6'Height'#2#28#3'Top'#3#11#1#5'Width'#2'M'#0#0#0
|
||||||
]);
|
]);
|
||||||
|
109
ideintf/stringspropeditdlg.pas
Normal file
109
ideintf/stringspropeditdlg.pas
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
*****************************************************************************
|
||||||
|
* *
|
||||||
|
* See the file COPYING.modifiedLGPL, included in this distribution, *
|
||||||
|
* for details about the copyright. *
|
||||||
|
* *
|
||||||
|
* This program is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* *
|
||||||
|
*****************************************************************************
|
||||||
|
|
||||||
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
Dialog for the TStrings property editor.
|
||||||
|
}
|
||||||
|
unit StringsPropEditDlg;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, LResources, Forms, Controls, Buttons, Dialogs, StdCtrls,
|
||||||
|
TextTools, ObjInspStrConsts;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TStringsPropEditorFrm }
|
||||||
|
|
||||||
|
TStringsPropEditorFrm = class(TForm)
|
||||||
|
OKButton: TBitBtn;
|
||||||
|
CancelButton: TBitBtn;
|
||||||
|
StatusLabel: TLabel;
|
||||||
|
SortButton: TButton;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
Memo: TMemo;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure MemoChange(Sender: TObject);
|
||||||
|
procedure SortButtonClick(Sender: TObject);
|
||||||
|
public
|
||||||
|
procedure AddButtons; virtual;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TStringsPropEditorFrm }
|
||||||
|
|
||||||
|
procedure TStringsPropEditorFrm.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Caption := oisStringsEditorDialog;
|
||||||
|
StatusLabel.Caption := ois0Lines0Chars;
|
||||||
|
SortButton.Caption := oisSort;
|
||||||
|
|
||||||
|
AddButtons;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TStringsPropEditorFrm.MemoChange(Sender: TObject);
|
||||||
|
var
|
||||||
|
NumChars: Integer;
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
NumChars := 0;
|
||||||
|
for I := 0 to Memo.Lines.Count - 1 do Inc(NumChars, Length(Memo.Lines[I]));
|
||||||
|
|
||||||
|
if Memo.Lines.Count = 1 then
|
||||||
|
StatusLabel.Text := Format(ois1LineDChars, [NumChars])
|
||||||
|
else
|
||||||
|
StatusLabel.Text := Format(oisDLinesDChars, [Memo.Lines.Count, NumChars]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TStringsPropEditorFrm.SortButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
OldText, NewSortedText: String;
|
||||||
|
SortOnlySelection: Boolean;
|
||||||
|
begin
|
||||||
|
if not Assigned(ShowSortSelectionDialogFunc) then
|
||||||
|
begin
|
||||||
|
SortButton.Enabled := False;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
SortOnlySelection := True;
|
||||||
|
OldText := Memo.SelText;
|
||||||
|
if OldText = '' then
|
||||||
|
begin
|
||||||
|
SortOnlySelection := False;
|
||||||
|
OldText := Memo.Lines.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if ShowSortSelectionDialogFunc(OldText, nil, NewSortedText) <> mrOk then Exit;
|
||||||
|
if SortOnlySelection then
|
||||||
|
Memo.SelText := NewSortedText
|
||||||
|
else
|
||||||
|
Memo.Lines.Text := NewSortedText;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TStringsPropEditorFrm.AddButtons;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I stringspropeditdlg.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -1013,7 +1013,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
function CopyFile(const SrcFilename, DestFilename: string): boolean;
|
||||||
begin
|
begin
|
||||||
result := CopyFile(SrcFilename, DestFilename, false);
|
Result := CopyFile(SrcFilename, DestFilename, false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -275,9 +275,9 @@ type
|
|||||||
TArrayNodesTree = class
|
TArrayNodesTree = class
|
||||||
public
|
public
|
||||||
Root: TArrayNode;
|
Root: TArrayNode;
|
||||||
function FindNode(IntArray: PInteger; Count: integer): TArrayNode;
|
function FindNode(Path: PInteger; Count: integer): TArrayNode;
|
||||||
function FindData(IntArray: PInteger; Count: integer): Pointer;
|
function FindData(Path: PInteger; Count: integer): Pointer;
|
||||||
function SetNode(IntArray: PInteger; Count: integer;
|
function SetNode(Path: PInteger; Count: integer;
|
||||||
Data: Pointer): TArrayNode;
|
Data: Pointer): TArrayNode;
|
||||||
procedure Delete(Node: TArrayNode);
|
procedure Delete(Node: TArrayNode);
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
@ -2914,7 +2914,7 @@ end;
|
|||||||
|
|
||||||
{ TArrayNodesTree }
|
{ TArrayNodesTree }
|
||||||
|
|
||||||
function TArrayNodesTree.FindNode(IntArray: PInteger; Count: integer
|
function TArrayNodesTree.FindNode(Path: PInteger; Count: integer
|
||||||
): TArrayNode;
|
): TArrayNode;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -2922,23 +2922,23 @@ begin
|
|||||||
Result:=Root;
|
Result:=Root;
|
||||||
i:=0;
|
i:=0;
|
||||||
while (Result<>nil) and (i<Count) do begin
|
while (Result<>nil) and (i<Count) do begin
|
||||||
Result:=Result.GetChildNode(IntArray[i],false);
|
Result:=Result.GetChildNode(Path[i],false);
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TArrayNodesTree.FindData(IntArray: PInteger; Count: integer): Pointer;
|
function TArrayNodesTree.FindData(Path: PInteger; Count: integer): Pointer;
|
||||||
var
|
var
|
||||||
ANode: TArrayNode;
|
ANode: TArrayNode;
|
||||||
begin
|
begin
|
||||||
ANode:=FindNode(IntArray,Count);
|
ANode:=FindNode(Path,Count);
|
||||||
if ANode<>nil then
|
if ANode<>nil then
|
||||||
Result:=ANode.Data
|
Result:=ANode.Data
|
||||||
else
|
else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TArrayNodesTree.SetNode(IntArray: PInteger; Count: integer;
|
function TArrayNodesTree.SetNode(Path: PInteger; Count: integer;
|
||||||
Data: Pointer): TArrayNode;
|
Data: Pointer): TArrayNode;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -2948,7 +2948,7 @@ begin
|
|||||||
Result:=Root;
|
Result:=Root;
|
||||||
for i:=0 to Count-1 do begin
|
for i:=0 to Count-1 do begin
|
||||||
//DebugLn('TArrayNodesTree.SetNode A ',DbgS(Result));
|
//DebugLn('TArrayNodesTree.SetNode A ',DbgS(Result));
|
||||||
Result:=Result.GetChildNode(IntArray[i],true);
|
Result:=Result.GetChildNode(Path[i],true);
|
||||||
end;
|
end;
|
||||||
Result.Data:=Data;
|
Result.Data:=Data;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user