diff --git a/.gitattributes b/.gitattributes index 02b5f67190..2066da0caa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1156,6 +1156,8 @@ ideintf/actionseditorstd.lfm svneol=native#text/plain ideintf/actionseditorstd.lrs svneol=native#text/pascal ideintf/actionseditorstd.pas svneol=native#text/pascal ideintf/allideintf.pas svneol=native#text/pascal +ideintf/collectionpropeditform.lfm svneol=native#text/plain +ideintf/collectionpropeditform.lrs svneol=native#text/plain ideintf/columndlg.pp svneol=native#text/pascal ideintf/componenteditors.pas svneol=native#text/pascal ideintf/componentreg.pas svneol=native#text/pascal @@ -1204,6 +1206,8 @@ ideintf/packageintf.pas svneol=native#text/pascal ideintf/projectintf.pas svneol=native#text/pascal ideintf/propedits.pp svneol=native#text/pascal ideintf/srceditorintf.pas svneol=native#text/pascal +ideintf/stringspropeditdlg.lfm svneol=native#text/plain +ideintf/stringspropeditdlg.lrs svneol=native#text/plain ideintf/texttools.pas svneol=native#text/pascal ideintf/treeviewpropedit.lfm svneol=native#text/plain ideintf/treeviewpropedit.lrs svneol=native#text/plain diff --git a/components/rtticontrols/rttictrls.pas b/components/rtticontrols/rttictrls.pas index 70322fdced..082da82666 100644 --- a/components/rtticontrols/rttictrls.pas +++ b/components/rtticontrols/rttictrls.pas @@ -2192,11 +2192,11 @@ begin GetDefaultValuesButton := TButton.Create(Self); with GetDefaultValuesButton do Begin - Parent:=Self; + Parent:=SortButton.Parent; Caption:='Get Defaults'; OnClick:=@GetDefaultValuesButtonClick; AutoSize:=true; - AnchorToCompanion(akRight,5,SortButton); + AnchorToCompanion(akTop, 6, SortButton); end; end; diff --git a/ideintf/collectionpropeditform.lfm b/ideintf/collectionpropeditform.lfm new file mode 100644 index 0000000000..fff8956ee0 --- /dev/null +++ b/ideintf/collectionpropeditform.lfm @@ -0,0 +1,206 @@ +object CollectionPropertyEditorForm: TCollectionPropertyEditorForm + ActiveControl = CollectionListBox + BorderStyle = bsSizeToolWin + Caption = 'CollectionPropertyEditorForm' + ClientHeight = 300 + ClientWidth = 190 + Constraints.MinHeight = 100 + Constraints.MinWidth = 190 + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + Position = poDefault + HorzScrollBar.Page = 189 + VertScrollBar.Page = 299 + Left = 290 + Height = 300 + Top = 153 + Width = 190 + object ToolBar1: TToolBar + AutoSize = True + ButtonHeight = 40 + ButtonWidth = 44 + Caption = 'ToolBar1' + DisabledImages = DisableImageList + Height = 42 + Images = ImageList + ShowCaptions = True + TabOrder = 0 + Height = 42 + Width = 190 + object AddButton: TToolButton + Caption = 'Add' + ImageIndex = 0 + OnClick = AddButtonClick + Height = 40 + Top = 2 + Width = 44 + end + object DeleteButton: TToolButton + Caption = 'Delete' + ImageIndex = 1 + OnClick = DeleteButtonClick + Left = 45 + Height = 40 + Top = 2 + Width = 44 + end + object ToolButton3: TToolButton + Caption = 'ToolButton3' + Style = tbsSeparator + Width = 10 + Left = 89 + Height = 40 + Top = 2 + Width = 10 + end + object MoveUpButton: TToolButton + Caption = 'Up' + ImageIndex = 2 + OnClick = MoveUpButtonClick + Left = 99 + Height = 40 + Top = 2 + Width = 44 + end + object MoveDownButton: TToolButton + Caption = 'Down' + ImageIndex = 3 + OnClick = MoveDownButtonClick + Left = 143 + Height = 40 + Top = 2 + Width = 44 + end + end + object CollectionListBox: TListBox + Align = alClient + OnClick = CollectionListBoxClick + TabOrder = 1 + Height = 258 + Top = 42 + Width = 190 + end + object ImageList: TImageList + left = 66 + top = 138 + Bitmap = { + 6C69040000001000000010000000BA0100002F2A2058504D202A2F0A73746174 + 69632063686172202A677261706869635B5D203D207B0A223136203136203520 + 31222C0A222E2063204E6F6E65222C0A222C20632023303030303834222C0A22 + 2D20632023303038344646222C0A222A20632023303030304646222C0A226120 + 632023303036424436222C0A222E2E2E2E2E2C2C2C2C2C2C2E2E2E2E2E222C0A + 222E2E2E2E2E2C2D2D2D2D2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D + 2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E + 2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222C2C2C2C2C2C2D2A2A2C2D2C2C2C2C + 2C222C0A222C2D2D2D2D2D2D2A2A2C2D2D2D2D2D2D222C0A222C2D2A2A2A2A2A + 2A2A2A2A2A2A2A2C2D222C0A222C2D2A2A2A2A2A2A2A2A2A2A2A2A2C2D222C0A + 222C612C2C2C2C2D2A2A2C2C2C2C2C2C2D222C0A222D2D2D2D2D612D2A2A2C2D + 2D2D2D2D2D222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E + 2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E + 2E222C0A222E2E2E2E2E2C2D2C2C2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D + 2D2D2D2D2E2E2E2E2E227D0ABA0100002F2A2058504D202A2F0A737461746963 + 2063686172202A677261706869635B5D203D207B0A2231362031362035203122 + 2C0A222E2063204E6F6E65222C0A222C20632023303030303834222C0A222D20 + 632023303038344646222C0A222A20632023303036424436222C0A2261206320 + 23303030304646222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E + 2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E + 2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E + 2E2E2E2E2E2E2E2E2E2E2E222C0A222C2C2C2C2C2C2C2C2C2C2C2C2C2C2C2C22 + 2C0A222C2D2D2D2D2D2D2D2D2D2D2D2D2D2A2D222C0A222C2D61616161616161 + 61616161612C2D222C0A222C2D6161616161616161616161612C2D222C0A222C + 2A2C2C2C2C2C2C2C2C2C2C2C2C2C2D222C0A222D2D2D2D2D2D2D2D2D2D2D2D2D + 2D2D2D222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E + 2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E22 + 2C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E + 2E2E2E2E2E2E2E227D0AAB0100002F2A2058504D202A2F0A7374617469632063 + 686172202A677261706869635B5D203D207B0A22313620313620342031222C0A + 222E2063204E6F6E65222C0A222C20632023303030303834222C0A222D206320 + 23303038344646222C0A222A20632023303030304646222C0A222E2E2E2E2E2E + 2E2C2D2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2C2D2C2D2E2E2E2E2E2E222C + 0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2C2D2A2A2A2A + 2C2D2E2E2E2E222C0A222E2E2E2C2D2A2A2A2A2A2A2C2D2E2E2E222C0A222E2E + 2C2D2A2A2A2A2A2A2A2A2C2D2E2E222C0A222E2E2C2C2C2C2C2A2A2C2C2C2C2D + 2E2E222C0A222E2E2E2D2D2D2D2A2A2C2D2D2D2E2E2E222C0A222E2E2E2E2E2C + 2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C + 0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C + 2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E + 2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2C2C2C2D2E2E2E + 2E2E222C0A222E2E2E2E2E2C2D2D2D2D2D2E2E2E2E2E227D0AAB0100002F2A20 + 58504D202A2F0A7374617469632063686172202A677261706869635B5D203D20 + 7B0A22313620313620342031222C0A222E2063204E6F6E65222C0A222C206320 + 23303030303834222C0A222D20632023303038344646222C0A222A2063202330 + 3030304646222C0A222E2E2E2E2E2C2D2D2D2D2D2E2E2E2E2E222C0A222E2E2E + 2E2E2C2D2C2C2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E + 2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D + 2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A + 222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D + 2E2E2E2E2E222C0A222E2E2E2D2D2D2D2A2A2C2D2D2D2E2E2E222C0A222E2E2C + 2C2C2C2C2A2A2C2C2C2C2D2E2E222C0A222E2E2C2D2A2A2A2A2A2A2A2A2C2D2E + 2E222C0A222E2E2E2C2D2A2A2A2A2A2A2C2D2E2E2E222C0A222E2E2E2E2C2D2A + 2A2A2A2C2D2E2E2E2E222C0A222E2E2E2E2E2C2D2A2A2C2D2E2E2E2E2E222C0A + 222E2E2E2E2E2E2C2D2C2D2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2C2D2E2E + 2E2E2E2E2E227D0A + } + end + object DisableImageList: TImageList + left = 66 + top = 106 + Bitmap = { + 6C69040000001000000010000000AB0100002F2A2058504D202A2F0A73746174 + 69632063686172202A677261706869635B5D203D207B0A223136203136203420 + 31222C0A222E2063204E6F6E65222C0A222C20632023334633463346222C0A22 + 2D20632023374637463746222C0A222A20632023364236423642222C0A222E2E + 2E2E2E2C2C2C2C2C2C2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2D2D2E2E2E + 2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C + 2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C + 0A222C2C2C2C2C2C2D2D2D2C2D2C2C2C2C2C222C0A222C2D2D2D2D2D2D2D2D2C + 2D2D2D2D2D2D222C0A222C2D2D2D2D2D2D2D2D2D2D2D2D2D2C2D222C0A222C2D + 2D2D2D2D2D2D2D2D2D2D2D2D2C2D222C0A222C2A2C2C2C2C2D2D2D2C2C2C2C2C + 2C2D222C0A222D2D2D2D2D2A2D2D2D2C2D2D2D2D2D2D222C0A222E2E2E2E2E2C + 2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C + 0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2C2C2C + 2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2D2D2E2E2E2E2E227D0AAB0100 + 002F2A2058504D202A2F0A7374617469632063686172202A677261706869635B + 5D203D207B0A22313620313620342031222C0A222E2063204E6F6E65222C0A22 + 2C20632023334633463346222C0A222D20632023374637463746222C0A222A20 + 632023364236423642222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A + 222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E + 2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E + 2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222C2C2C2C2C2C2C2C2C2C2C2C2C2C2C + 2C222C0A222C2D2D2D2D2D2D2D2D2D2D2D2D2D2A2D222C0A222C2D2D2D2D2D2D + 2D2D2D2D2D2D2D2C2D222C0A222C2D2D2D2D2D2D2D2D2D2D2D2D2D2C2D222C0A + 222C2A2C2C2C2C2C2C2C2C2C2C2C2C2C2D222C0A222D2D2D2D2D2D2D2D2D2D2D + 2D2D2D2D2D222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E + 2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E + 2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E + 2E2E2E2E2E2E2E2E2E227D0A9C0100002F2A2058504D202A2F0A737461746963 + 2063686172202A677261706869635B5D203D207B0A2231362031362033203122 + 2C0A222E2063204E6F6E65222C0A222C20632023334633463346222C0A222D20 + 632023374637463746222C0A222E2E2E2E2E2E2E2C2D2E2E2E2E2E2E2E222C0A + 222E2E2E2E2E2E2C2D2C2D2E2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D + 2E2E2E2E2E222C0A222E2E2E2E2C2D2D2D2D2D2C2D2E2E2E2E222C0A222E2E2E + 2C2D2D2D2D2D2D2D2C2D2E2E2E222C0A222E2E2C2D2D2D2D2D2D2D2D2D2C2D2E + 2E222C0A222E2E2C2C2C2C2C2D2D2C2C2C2C2D2E2E222C0A222E2E2E2D2D2D2D + 2D2D2C2D2D2D2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A + 222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D + 2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E + 2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E + 2E222C0A222E2E2E2E2E2C2D2C2C2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D + 2D2D2D2D2E2E2E2E2E227D0A9C0100002F2A2058504D202A2F0A737461746963 + 2063686172202A677261706869635B5D203D207B0A2231362031362033203122 + 2C0A222E2063204E6F6E65222C0A222C20632023334633463346222C0A222D20 + 632023374637463746222C0A222E2E2E2E2E2C2D2D2D2D2D2E2E2E2E2E222C0A + 222E2E2E2E2E2C2D2C2C2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D + 2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E + 2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E + 2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E2E222C0A222E2E2E2E2E2C2D + 2D2D2C2D2E2E2E2E2E222C0A222E2E2E2D2D2D2D2D2D2C2D2D2D2E2E2E222C0A + 222E2E2C2C2C2C2C2D2D2C2C2C2C2D2E2E222C0A222E2E2C2D2D2D2D2D2D2D2D + 2D2C2D2E2E222C0A222E2E2E2C2D2D2D2D2D2D2D2C2D2E2E2E222C0A222E2E2E + 2E2C2D2D2D2D2D2C2D2E2E2E2E222C0A222E2E2E2E2E2C2D2D2D2C2D2E2E2E2E + 2E222C0A222E2E2E2E2E2E2C2D2C2D2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E + 2C2D2E2E2E2E2E2E2E227D0A + } + end +end diff --git a/ideintf/collectionpropeditform.lrs b/ideintf/collectionpropeditform.lrs new file mode 100644 index 0000000000..c880db85e9 --- /dev/null +++ b/ideintf/collectionpropeditform.lrs @@ -0,0 +1,87 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TCollectionPropertyEditorForm','FORMDATA',[ + 'TPF0'#29'TCollectionPropertyEditorForm'#28'CollectionPropertyEditorForm'#13 + +'ActiveControl'#7#17'CollectionListBox'#11'BorderStyle'#7#13'bsSizeToolWin'#7 + +'Caption'#6#28'CollectionPropertyEditorForm'#12'ClientHeight'#3','#1#11'Clie' + +'ntWidth'#3#190#0#21'Constraints.MinHeight'#2'd'#20'Constraints.MinWidth'#3 + +#190#0#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#13'Pixels' + +'PerInch'#2'`'#8'Position'#7#9'poDefault'#18'HorzScrollBar.Page'#3#189#0#18 + +'VertScrollBar.Page'#3'+'#1#4'Left'#3'"'#1#6'Height'#3','#1#3'Top'#3#153#0#5 + +'Width'#3#190#0#0#8'TToolBar'#8'ToolBar1'#8'AutoSize'#9#12'ButtonHeight'#2'(' + +#11'ButtonWidth'#2','#7'Caption'#6#8'ToolBar1'#14'DisabledImages'#7#16'Disab' + +'leImageList'#6'Height'#2'*'#6'Images'#7#9'ImageList'#12'ShowCaptions'#9#8'T' + +'abOrder'#2#0#6'Height'#2'*'#5'Width'#3#190#0#0#11'TToolButton'#9'AddButton' + +#7'Caption'#6#3'Add'#10'ImageIndex'#2#0#7'OnClick'#7#14'AddButtonClick'#6'He' + +'ight'#2'('#3'Top'#2#2#5'Width'#2','#0#0#11'TToolButton'#12'DeleteButton'#7 + +'Caption'#6#6'Delete'#10'ImageIndex'#2#1#7'OnClick'#7#17'DeleteButtonClick'#4 + +'Left'#2'-'#6'Height'#2'('#3'Top'#2#2#5'Width'#2','#0#0#11'TToolButton'#11'T' + +'oolButton3'#7'Caption'#6#11'ToolButton3'#5'Style'#7#12'tbsSeparator'#5'Widt' + +'h'#2#10#4'Left'#2'Y'#6'Height'#2'('#3'Top'#2#2#5'Width'#2#10#0#0#11'TToolBu' + +'tton'#12'MoveUpButton'#7'Caption'#6#2'Up'#10'ImageIndex'#2#2#7'OnClick'#7#17 + +'MoveUpButtonClick'#4'Left'#2'c'#6'Height'#2'('#3'Top'#2#2#5'Width'#2','#0#0 + +#11'TToolButton'#14'MoveDownButton'#7'Caption'#6#4'Down'#10'ImageIndex'#2#3#7 + +'OnClick'#7#19'MoveDownButtonClick'#4'Left'#3#143#0#6'Height'#2'('#3'Top'#2#2 + +#5'Width'#2','#0#0#0#8'TListBox'#17'CollectionListBox'#5'Align'#7#8'alClient' + +#7'OnClick'#7#22'CollectionListBoxClick'#8'TabOrder'#2#1#6'Height'#3#2#1#3'T' + +'op'#2'*'#5'Width'#3#190#0#0#0#10'TImageList'#9'ImageList'#4'left'#2'B'#3'to' + +'p'#3#138#0#6'Bitmap'#10#232#6#0#0'li'#4#0#0#0#16#0#0#0#16#0#0#0#186#1#0#0'/' + +'* XPM */'#10'static char *graphic[] = {'#10'"16 16 5 1",'#10'". c None",'#10 + +'", c #000084",'#10'"- c #0084FF",'#10'"* c #0000FF",'#10'"a c #006BD6",'#10 + +'".....,,,,,,.....",'#10'".....,-----.....",'#10'".....,-**,-.....",'#10'"..' + +'...,-**,-.....",'#10'".....,-**,-.....",'#10'",,,,,,-**,-,,,,,",'#10'",----' + +'--**,------",'#10'",-************,-",'#10'",-************,-",'#10'",a,,,,-*' + +'*,,,,,,-",'#10'"-----a-**,------",'#10'".....,-**,-.....",'#10'".....,-**,-' + +'.....",'#10'".....,-**,-.....",'#10'".....,-,,,-.....",'#10'".....,-----...' + +'.."}'#10#186#1#0#0'/* XPM */'#10'static char *graphic[] = {'#10'"16 16 5 1"' + +','#10'". c None",'#10'", c #000084",'#10'"- c #0084FF",'#10'"* c #006BD6",' + +#10'"a c #0000FF",'#10'"................",'#10'"................",'#10'"....' + +'............",'#10'"................",'#10'"................",'#10'",,,,,,,' + +',,,,,,,,,",'#10'",-------------*-",'#10'",-aaaaaaaaaaaa,-",'#10'",-aaaaaaaa' + +'aaaa,-",'#10'",*,,,,,,,,,,,,,-",'#10'"----------------",'#10'".............' + +'...",'#10'"................",'#10'"................",'#10'"................' + +'",'#10'"................"}'#10#171#1#0#0'/* XPM */'#10'static char *graphic' + +'[] = {'#10'"16 16 4 1",'#10'". c None",'#10'", c #000084",'#10'"- c #0084FF' + +'",'#10'"* c #0000FF",'#10'".......,-.......",'#10'"......,-,-......",'#10'"' + +'.....,-**,-.....",'#10'"....,-****,-....",'#10'"...,-******,-...",'#10'"..,' + +'-********,-..",'#10'"..,,,,,**,,,,-..",'#10'"...----**,---...",'#10'".....,' + +'-**,-.....",'#10'".....,-**,-.....",'#10'".....,-**,-.....",'#10'".....,-**' + +',-.....",'#10'".....,-**,-.....",'#10'".....,-**,-.....",'#10'".....,-,,,-.' + +'....",'#10'".....,-----....."}'#10#171#1#0#0'/* XPM */'#10'static char *gra' + +'phic[] = {'#10'"16 16 4 1",'#10'". c None",'#10'", c #000084",'#10'"- c #00' + +'84FF",'#10'"* c #0000FF",'#10'".....,-----.....",'#10'".....,-,,,-.....",' + +#10'".....,-**,-.....",'#10'".....,-**,-.....",'#10'".....,-**,-.....",'#10 + +'".....,-**,-.....",'#10'".....,-**,-.....",'#10'".....,-**,-.....",'#10'"..' + +'.----**,---...",'#10'"..,,,,,**,,,,-..",'#10'"..,-********,-..",'#10'"...,-' + +'******,-...",'#10'"....,-****,-....",'#10'".....,-**,-.....",'#10'"......,-' + +',-......",'#10'".......,-......."}'#10#0#0#10'TImageList'#16'DisableImageLi' + +'st'#4'left'#2'B'#3'top'#2'j'#6'Bitmap'#10#172#6#0#0'li'#4#0#0#0#16#0#0#0#16 + +#0#0#0#171#1#0#0'/* XPM */'#10'static char *graphic[] = {'#10'"16 16 4 1",' + +#10'". c None",'#10'", c #3F3F3F",'#10'"- c #7F7F7F",'#10'"* c #6B6B6B",'#10 + +'".....,,,,,,.....",'#10'".....,-----.....",'#10'".....,---,-.....",'#10'"..' + +'...,---,-.....",'#10'".....,---,-.....",'#10'",,,,,,---,-,,,,,",'#10'",----' + +'----,------",'#10'",-------------,-",'#10'",-------------,-",'#10'",*,,,,--' + +'-,,,,,,-",'#10'"-----*---,------",'#10'".....,---,-.....",'#10'".....,---,-' + +'.....",'#10'".....,---,-.....",'#10'".....,-,,,-.....",'#10'".....,-----...' + +'.."}'#10#171#1#0#0'/* XPM */'#10'static char *graphic[] = {'#10'"16 16 4 1"' + +','#10'". c None",'#10'", c #3F3F3F",'#10'"- c #7F7F7F",'#10'"* c #6B6B6B",' + ,#10'"................",'#10'"................",'#10'"................",'#10 + +'"................",'#10'"................",'#10'",,,,,,,,,,,,,,,,",'#10'",-' + +'------------*-",'#10'",-------------,-",'#10'",-------------,-",'#10'",*,,,' + +',,,,,,,,,,-",'#10'"----------------",'#10'"................",'#10'"........' + +'........",'#10'"................",'#10'"................",'#10'"...........' + +'....."}'#10#156#1#0#0'/* XPM */'#10'static char *graphic[] = {'#10'"16 16 3' + +' 1",'#10'". c None",'#10'", c #3F3F3F",'#10'"- c #7F7F7F",'#10'".......,-..' + +'.....",'#10'"......,-,-......",'#10'".....,---,-.....",'#10'"....,-----,-..' + +'..",'#10'"...,-------,-...",'#10'"..,---------,-..",'#10'"..,,,,,--,,,,-.."' + +','#10'"...------,---...",'#10'".....,---,-.....",'#10'".....,---,-.....",' + +#10'".....,---,-.....",'#10'".....,---,-.....",'#10'".....,---,-.....",'#10 + +'".....,---,-.....",'#10'".....,-,,,-.....",'#10'".....,-----....."}'#10#156 + +#1#0#0'/* XPM */'#10'static char *graphic[] = {'#10'"16 16 3 1",'#10'". c No' + +'ne",'#10'", c #3F3F3F",'#10'"- c #7F7F7F",'#10'".....,-----.....",'#10'"...' + +'..,-,,,-.....",'#10'".....,---,-.....",'#10'".....,---,-.....",'#10'".....,' + +'---,-.....",'#10'".....,---,-.....",'#10'".....,---,-.....",'#10'".....,---' + +',-.....",'#10'"...------,---...",'#10'"..,,,,,--,,,,-..",'#10'"..,---------' + +',-..",'#10'"...,-------,-...",'#10'"....,-----,-....",'#10'".....,---,-....' + +'.",'#10'"......,-,-......",'#10'".......,-......."}'#10#0#0#0 +]); diff --git a/ideintf/objinspstrconsts.pas b/ideintf/objinspstrconsts.pas index 3cd53f9b82..c7afc79fdc 100644 --- a/ideintf/objinspstrconsts.pas +++ b/ideintf/objinspstrconsts.pas @@ -131,6 +131,14 @@ resourcestring //checkgroup editor clbCheckGroupEditor = 'CheckGroup Editor'; + + // Collection Editor + + oiColEditAdd = 'Add'; + oiColEditDelete = 'Delete'; + oiColEditUp = 'Up'; + oiColEditDown = 'Down'; + oiColEditEditing = 'Editing'; // Actions Editor cActionListEditorUnknownCategory = '(Unknown)'; diff --git a/ideintf/propedits.pp b/ideintf/propedits.pp index 915c72f897..f046f19db5 100644 --- a/ideintf/propedits.pp +++ b/ideintf/propedits.pp @@ -33,7 +33,7 @@ unit PropEdits; interface uses - Classes, TypInfo, SysUtils, + Classes, TypInfo, SysUtils, LResources, FPCAdds, // for StrToQWord in older fpc versions LCLProc, Forms, Controls, GraphType, Graphics, StdCtrls, Buttons, ComCtrls, Menus, LCLType, ExtCtrls, LCLIntf, @@ -1367,19 +1367,20 @@ type //============================================================================== { TStringsPropEditorDlg } - + type TStringsPropEditorDlg = class(TForm) - procedure SortButtonClick(Sender: TObject); - procedure MemoChanged(Sender: TObject); - public - Memo: TMemo; - OKButton, CancelButton: TBitBtn; - SortButton: TButton; - Panel: TPanel; + 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 Editor: TPropertyEditor; - constructor Create(TheOwner: TComponent); override; procedure AddButtons; virtual; end; @@ -3282,26 +3283,31 @@ begin end; -Type +type { TCollectionPropertyEditor } TCollectionPropertyEditorForm = class(TForm) - procedure ListClick(Sender: TObject); - procedure AddClick(Sender: TObject); - procedure DeleteClick(Sender: TObject); + CollectionListBox: TListBox; + ImageList: TImageList; + DisableImageList: TImageList; + ToolBar1: TToolBar; + AddButton: TToolButton; + DeleteButton: TToolButton; + ToolButton3: TToolButton; + MoveUpButton: TToolButton; + MoveDownButton: TToolButton; + procedure AddButtonClick(Sender: TObject); + procedure CollectionListBoxClick(Sender: TObject); + procedure DeleteButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); procedure MoveDownButtonClick(Sender: TObject); procedure MoveUpButtonClick(Sender: TObject); private FCollection: TCollection; FOwnerPersistent: TPersistent; - FPropertyName: string; + FPropertyName: String; protected - CollectionListBox: TListBox; - ButtonPanel: TPanel; - AddButton: TSpeedButton; - DeleteButton: TSpeedButton; - MoveUpButton: TSpeedButton; - MoveDownButton: TSpeedButton; procedure UpdateCaption; procedure UpdateButtons; procedure ComponentRenamed(AComponent: TComponent); @@ -3309,77 +3315,131 @@ Type procedure RefreshPropertyValues; public procedure FillCollectionListBox; - constructor Create(TheOwner: TComponent); override; - destructor Destroy; override; - procedure SelectInObjectInspector(UnselectAll: boolean); + procedure SelectInObjectInspector(UnselectAll: Boolean); procedure SetCollection(NewCollection: TCollection; - NewOwnerPersistent: TPersistent; const NewPropName: string); + NewOwnerPersistent: TPersistent; const NewPropName: String); procedure Modified; public property Collection: TCollection read FCollection; property OwnerPersistent: TPersistent read FOwnerPersistent; - property PropertyName: string read FPropertyName; + property PropertyName: String read FPropertyName; end; const CollectionForm: TCollectionPropertyEditorForm = nil; -procedure TCollectionPropertyEditorForm.ListClick(Sender: TObject); +procedure TCollectionPropertyEditorForm.FormCreate(Sender: TObject); begin - UpdateButtons; - UpdateCaption; - SelectInObjectInspector(false); + AddButton.Caption := oiColEditAdd; + DeleteButton.Caption := oiColEditDelete; + MoveUpButton.Caption := oiColEditUp; + MoveDownButton.Caption := oiColEditDown; end; -procedure TCollectionPropertyEditorForm.AddClick(Sender: TObject); +procedure TCollectionPropertyEditorForm.FormDestroy(Sender: TObject); begin - if Collection=nil then exit; - Collection.Add; + if GlobalDesignHook <> nil then + GlobalDesignHook.RemoveAllHandlersForObject(Self); +end; + +procedure TCollectionPropertyEditorForm.MoveDownButtonClick(Sender: TObject); +var + I: Integer; +begin + if Collection = nil then Exit; + + I := CollectionListBox.ItemIndex; + if I >= Collection.Count - 1 then Exit; + + Collection.Items[I].Index := I + 1; + CollectionListBox.ItemIndex := I + 1; + FillCollectionListBox; - if CollectionListBox.Items.Count>0 then - CollectionListBox.ItemIndex := CollectionListBox.Items.Count-1; - SelectInObjectInspector(false); + SelectInObjectInspector(False); + Modified; +end; + +procedure TCollectionPropertyEditorForm.MoveUpButtonClick(Sender: TObject); +var + I: Integer; +begin + if Collection = nil then Exit; + + I := CollectionListBox.ItemIndex; + if I < 0 then Exit; + + Collection.Items[I].Index := I - 1; + CollectionListBox.ItemIndex := I - 1; + + FillCollectionListBox; + SelectInObjectInspector(False); + Modified; +end; + +procedure TCollectionPropertyEditorForm.AddButtonClick(Sender: TObject); +begin + if Collection = nil then Exit; + Collection.Add; + + FillCollectionListBox; + if CollectionListBox.Items.Count > 0 then + CollectionListBox.ItemIndex := CollectionListBox.Items.Count - 1; + SelectInObjectInspector(False); + UpdateButtons; UpdateCaption; Modified; end; -procedure TCollectionPropertyEditorForm.DeleteClick(Sender: TObject); +procedure TCollectionPropertyEditorForm.CollectionListBoxClick(Sender: TObject); +begin + UpdateButtons; + UpdateCaption; + SelectInObjectInspector(False); +end; + +procedure TCollectionPropertyEditorForm.DeleteButtonClick(Sender: TObject); var I : Integer; NewItemIndex: Integer; begin - if Collection=nil then exit; + if Collection = nil then Exit; + I := CollectionListBox.ItemIndex; - if (i>=0) and (i= 0) and (I < Collection.Count) then + begin if MessageDlg(oisConfirmDelete, - Format(oisDeleteItem, ['"', Collection.Items[i].DisplayName, '"']), - mtConfirmation,[mbYes,mbNo],0) = mrYes then + Format(oisDeleteItem, ['"', Collection.Items[I].DisplayName, '"']), + mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin // select other item, or unselect - NewItemIndex:=i+1; - while (NewItemIndexi then dec(NewItemIndex); + + if NewItemIndex > I then Dec(NewItemIndex); //debugln('TCollectionPropertyEditorForm.DeleteClick A NewItemIndex=',dbgs(NewItemIndex),' ItemIndex=',dbgs(CollectionListBox.ItemIndex),' CollectionListBox.Items.Count=',dbgs(CollectionListBox.Items.Count),' Collection.Count=',dbgs(Collection.Count)); // unselect all items in OI (collections can act strange on delete) - SelectInObjectInspector(true); + SelectInObjectInspector(True); // now delete - Collection.Items[i].Free; + Collection.Items[I].Free; // update listbox after whatever happened FillCollectionListBox; // set NewItemIndex - if NewItemIndex=Collection.Count-1 then exit; - Collection.Items[i].Index:=i+1; - CollectionListBox.ItemIndex:=i+1; - FillCollectionListBox; - SelectInObjectInspector(false); - Modified; -end; - -procedure TCollectionPropertyEditorForm.MoveUpButtonClick(Sender: TObject); -var - i: LongInt; -begin - if Collection=nil then exit; - i:=CollectionListBox.ItemIndex; - if i<=0 then exit; - Collection.Items[i].Index:=i-1; - CollectionListBox.ItemIndex:=i-1; - FillCollectionListBox; - SelectInObjectInspector(false); - Modified; -end; - procedure TCollectionPropertyEditorForm.UpdateCaption; var NewCaption: String; @@ -3424,49 +3456,50 @@ begin //I think to match Delphi this should be formatted like //"Editing ComponentName.PropertyName[Index]" if OwnerPersistent is TComponent then - NewCaption:=TComponent(OwnerPersistent).Name - else if OwnerPersistent<>nil then - NewCaption:=OwnerPersistent.GetNamePath + NewCaption := TComponent(OwnerPersistent).Name else - NewCaption:=''; - if NewCaption<>'' then NewCaption:=NewCaption+'.'; - NewCaption:=NewCaption+PropertyName; - NewCaption:= 'Editing ' + NewCaption; - If CollectionListBox.ItemIndex > -1 then - NewCaption:=NewCaption + '[' + IntToStr(CollectionListBox.ItemIndex) + ']'; - Caption:=NewCaption; + if OwnerPersistent <> nil then + NewCaption := OwnerPersistent.GetNamePath + else + NewCaption := ''; + + if NewCaption <> '' then NewCaption := NewCaption + '.'; + NewCaption := oiColEditEditing + ' ' + NewCaption + PropertyName; + + if CollectionListBox.ItemIndex > -1 then + NewCaption := NewCaption + '[' + IntToStr(CollectionListBox.ItemIndex) + ']'; + Caption := NewCaption; end; procedure TCollectionPropertyEditorForm.UpdateButtons; var - i: LongInt; + I: Integer; begin - i:=CollectionListBox.ItemIndex; - AddButton.Enabled:=Collection<>nil; - DeleteButton.Enabled:= i > -1; - MoveUpButton.Enabled:=i>0; - MoveDownButton.Enabled:=(i>=0) and (i nil; + DeleteButton.Enabled := I > -1; + MoveUpButton.Enabled := I > 0; + MoveDownButton.Enabled := (I >= 0) and (I < Collection.Count - 1); end; -procedure TCollectionPropertyEditorForm.ComponentRenamed(AComponent: TComponent - ); +procedure TCollectionPropertyEditorForm.ComponentRenamed(AComponent: TComponent); begin - if AComponent=OwnerPersistent then - UpdateCaption; + if AComponent = OwnerPersistent then UpdateCaption; end; -procedure TCollectionPropertyEditorForm.PersistentDeleting( - APersistent: TPersistent); +procedure TCollectionPropertyEditorForm.PersistentDeleting(APersistent: TPersistent); var OldCollection: TCollection; begin //debugln('TCollectionPropertyEditorForm.PersistentDeleting A APersistent=',dbgsName(APersistent),' OwnerPersistent=',dbgsName(OwnerPersistent)); - if APersistent=OwnerPersistent then begin - OldCollection:=Collection; - SetCollection(nil,nil,''); + if APersistent = OwnerPersistent then + begin + OldCollection := Collection; + SetCollection(nil, nil, ''); GlobalDesignHook.Unselect(OldCollection); - if GlobalDesignHook.LookupRoot=OldCollection then - GlobalDesignHook.LookupRoot:=nil; + if GlobalDesignHook.LookupRoot = OldCollection then + GlobalDesignHook.LookupRoot := nil; + Hide; end; end; @@ -3478,159 +3511,90 @@ end; procedure TCollectionPropertyEditorForm.FillCollectionListBox; var - I : Longint; + I: Integer; CurItem: String; Cnt: Integer; begin CollectionListBox.Items.BeginUpdate; - if Collection<>nil then - Cnt:=Collection.Count - else - Cnt:=0; - // add or replace list items - for I:=0 to Cnt - 1 do begin - CurItem:=Collection.Items[I].DisplayName; - if i>=CollectionListBox.Items.Count then - CollectionListBox.Items.Add(CurItem) - else - CollectionListBox.Items[I]:=CurItem; - end; - // delete unneeded list items - if Cnt>0 then begin - while CollectionListBox.Items.Count>Cnt do begin - CollectionListBox.Items.Delete(CollectionListBox.Items.Count-1); + try + if Collection <> nil then Cnt := Collection.Count + else Cnt := 0; + + // add or replace list items + for I := 0 to Cnt - 1 do + begin + CurItem := IntToStr(I) + ' - ' + Collection.Items[I].DisplayName; + if I >= CollectionListBox.Items.Count then + CollectionListBox.Items.Add(CurItem) + else + CollectionListBox.Items[I] := CurItem; end; - end else begin - CollectionListBox.Items.Clear; - end; - CollectionListBox.Items.EndUpdate; - UpdateButtons; - UpdateCaption; + // delete unneeded list items + if Cnt > 0 then + begin + while CollectionListBox.Items.Count > Cnt do + begin + CollectionListBox.Items.Delete(CollectionListBox.Items.Count - 1); + end; + end + else + begin + CollectionListBox.Items.Clear; + end; + finally + CollectionListBox.Items.EndUpdate; + UpdateButtons; + UpdateCaption; + end; end; -Constructor TCollectionPropertyEditorForm.Create(TheOwner : TComponent); +procedure TCollectionPropertyEditorForm.SelectInObjectInspector(UnselectAll: Boolean); var - x: Integer; - y: Integer; - w: Integer; - h: Integer; -begin - Inherited Create(TheOwner); - - Position := poDefault; - - Height:= 216; - Width:= 220; - - ButtonPanel := TPanel.Create(Self); - With ButtonPanel do begin - Parent := Self; - Align:= alTop; - BevelOuter:= bvRaised; - BevelInner:= bvLowered; - BorderWidth:= 2; - Height:= 41; - end; - - x:=6; - y:=6; - w:=43; - h:=27; - AddButton:= TSpeedButton.Create(Self); - With AddButton do begin - Parent:= ButtonPanel; - Caption:= oiscAdd; - OnClick:= @AddClick; - SetBounds(x,y,w,h); - inc(x,w); - end; - - DeleteButton := TSpeedButton.Create(Self); - With DeleteButton do begin - Parent:= ButtonPanel; - Caption:= oiscDelete; - OnClick:= @DeleteClick; - SetBounds(x,y,w,h); - inc(x,w); - end; - - MoveUpButton := TSpeedButton.Create(Self); - With MoveUpButton do begin - Parent:= ButtonPanel; - Caption:= 'Up'; // replace this by up arrow - OnClick:=@MoveUpButtonClick; - SetBounds(x,y,w,h); - inc(x,w); - end; - - MoveDownButton := TSpeedButton.Create(Self); - With MoveDownButton do begin - Parent:= ButtonPanel; - Caption:= 'Down'; // replace this by down arrow - OnClick:=@MoveDownButtonClick; - SetBounds(x,y,w,h); - inc(x,w); - end; - - CollectionListBox := TListBox.Create(Self); - With CollectionListBox do begin - Parent:= Self; - Align:= alClient; -// MultiSelect:= true; - OnClick:= @ListClick; - end; -end; - -destructor TCollectionPropertyEditorForm.Destroy; -begin - if GlobalDesignHook<>nil then - GlobalDesignHook.RemoveAllHandlersForObject(Self); - inherited Destroy; -end; - -procedure TCollectionPropertyEditorForm.SelectInObjectInspector( - UnselectAll: boolean); -var - i: Integer; + I: Integer; NewSelection: TPersistentSelectionList; begin - if Collection=nil then exit; + if Collection = nil then Exit; // select in OI - NewSelection:=TPersistentSelectionList.Create; + NewSelection := TPersistentSelectionList.Create; try - if not UnselectAll then begin - for i:=0 to CollectionListBox.Items.Count-1 do - if CollectionListBox.Selected[i] then - NewSelection.Add(Collection.Items[i]); + if not UnselectAll then + begin + for I := 0 to CollectionListBox.Items.Count - 1 do + if CollectionListBox.Selected[I] then + NewSelection.Add(Collection.Items[I]); end; GlobalDesignHook.SetSelection(NewSelection); - GlobalDesignHook.LookupRoot:=GetLookupRootForComponent(OwnerPersistent); + GlobalDesignHook.LookupRoot := GetLookupRootForComponent(OwnerPersistent); finally NewSelection.Free; end; end; -procedure TCollectionPropertyEditorForm.SetCollection( - NewCollection: TCollection; NewOwnerPersistent: TPersistent; - const NewPropName: string); +procedure TCollectionPropertyEditorForm.SetCollection(NewCollection: TCollection; + NewOwnerPersistent: TPersistent; const NewPropName: String); begin - if (FCollection=NewCollection) and (FOwnerPersistent=NewOwnerPersistent) - and (FPropertyName=NewPropName) then - exit; - FCollection:=NewCollection; - FOwnerPersistent:=NewOwnerPersistent; - FPropertyName:=NewPropName; + if (FCollection = NewCollection) and (FOwnerPersistent = NewOwnerPersistent) + and (FPropertyName = NewPropName) then Exit; + + FCollection := NewCollection; + FOwnerPersistent := NewOwnerPersistent; + FPropertyName := NewPropName; //debugln('TCollectionPropertyEditorForm.SetCollection A Collection=',dbgsName(FCollection),' OwnerPersistent=',dbgsName(OwnerPersistent),' PropName=',PropertyName); - if GlobalDesignHook<>nil then begin - if FOwnerPersistent<>nil then begin + if GlobalDesignHook <> nil then + begin + if FOwnerPersistent <> nil then + begin GlobalDesignHook.AddHandlerComponentRenamed(@ComponentRenamed); GlobalDesignHook.AddHandlerPersistentDeleting(@PersistentDeleting); GlobalDesignHook.AddHandlerRefreshPropertyValues(@RefreshPropertyValues); - end else begin + end + else + begin GlobalDesignHook.RemoveAllHandlersForObject(Self); end; end; + FillCollectionListBox; UpdateCaption; end; @@ -4554,76 +4518,27 @@ end; { TStringsPropEditorDlg } -constructor TStringsPropEditorDlg.Create(TheOwner : TComponent); +procedure TStringsPropEditorDlg.FormCreate(Sender: TObject); begin - inherited Create(TheOwner); - Position := poScreenCenter; - Width := 400; - Height := 250; Caption := oisStringsEditorDialog; + StatusLabel.Caption := ois0Lines0Chars; + SortButton.Caption := oisSort; - Panel := TPanel.Create(Self); - with Panel do begin - Parent:=Self; - BorderSpacing.Around:=4; - BevelInner:=bvLowered; - Align:=alTop; - end; - - StatusLabel:= TLabel.Create(Self); - with StatusLabel do begin - Parent:=Panel; - Left:=7; - Top:=5; - Caption:= ois0Lines0Chars; - end; - - Memo := TMemo.Create(self); - with Memo do begin - Parent:= Panel; - Align:=alBottom; - AnchorToNeighbour(akTop,2,StatusLabel); - Memo.OnChange:= @MemoChanged; - end; - AddButtons; - - Panel.AnchorToNeighbour(akBottom,4,OKButton); - - CancelControl:=CancelButton; - DefaultControl:=OKButton; end; -procedure TStringsPropEditorDlg.AddButtons; +procedure TStringsPropEditorDlg.MemoChange(Sender: TObject); +var + NumChars: Integer; + I: Integer; begin - OKButton := TBitBtn.Create(Self); - with OKButton do Begin - Parent:=Self; - Kind:=bkOK; - AutoSize:=true; - Anchors:=[akRight,akBottom]; - AnchorParallel(akRight,4,Parent); - AnchorParallel(akBottom,4,Parent); - end; + NumChars := 0; + for I := 0 to Memo.Lines.Count - 1 do Inc(NumChars, Length(Memo.Lines[I])); - CancelButton := TBitBtn.Create(Self); - with CancelButton do Begin - Parent:=Self; - Kind:=bkCancel; - AutoSize:=true; - AnchorToCompanion(akRight,5,OKButton); - end; - - if Assigned(ShowSortSelectionDialogFunc) then begin - SortButton := TButton.Create(Self); - with SortButton do Begin - Parent:=Self; - Caption:=oisSort; - OnClick:=@SortButtonClick; - AutoSize:=true; - AnchorToCompanion(akRight,5,CancelButton); - end; - end; + 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); @@ -4631,32 +4546,30 @@ var OldText, NewSortedText: String; SortOnlySelection: Boolean; begin - if not Assigned(ShowSortSelectionDialogFunc) then begin - SortButton.Enabled:=false; - exit; + 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; + + 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 ShowSortSelectionDialogFunc(OldText, nil, NewSortedText) <> mrOk then Exit; if SortOnlySelection then - Memo.SelText:=NewSortedText + Memo.SelText := NewSortedText else - Memo.Lines.Text:=NewSortedText; + Memo.Lines.Text := NewSortedText; end; -procedure TStringsPropEditorDlg.MemoChanged(Sender : TObject); -var - NumChars: integer; +procedure TStringsPropEditorDlg.AddButtons; begin - NumChars := Length(Memo.Lines.Text) - Memo.Lines.Count * Length(LineEnding); - if Memo.Lines.Count=1 then - StatusLabel.Text:= Format(ois1LineDChars, [NumChars]) - else - StatusLabel.Text:= Format(oisDLinesDChars, [Memo.Lines.Count, NumChars]); + // end; { TStringsPropertyEditor } @@ -4684,6 +4597,7 @@ begin Result:=TStringsPropEditorDlg.Create(Application); Result.Editor:=Self; Result.Memo.Text:=s.Text; + Result.MemoChange(nil); // force call OnChange event end; function TStringsPropertyEditor.GetAttributes: TPropertyAttributes; @@ -6181,6 +6095,9 @@ begin end; initialization + {$I stringspropeditdlg.lrs} + {$I collectionpropeditform.lrs} + InitPropEdits; finalization diff --git a/ideintf/stringspropeditdlg.lfm b/ideintf/stringspropeditdlg.lfm new file mode 100644 index 0000000000..2fec2a34b5 --- /dev/null +++ b/ideintf/stringspropeditdlg.lfm @@ -0,0 +1,95 @@ +object StringsPropEditorDlg: TStringsPropEditorDlg + ActiveControl = Memo + Caption = 'StringsPropEditorDlg' + ClientHeight = 300 + ClientWidth = 400 + Constraints.MinHeight = 160 + Constraints.MinWidth = 180 + OnCreate = FormCreate + PixelsPerInch = 96 + Position = poScreenCenter + HorzScrollBar.Page = 399 + VertScrollBar.Page = 299 + Left = 290 + Height = 300 + Top = 153 + Width = 400 + object GroupBox1: TGroupBox + Align = alTop + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + ClientHeight = 240 + ClientWidth = 384 + TabOrder = 0 + Left = 6 + Height = 258 + Top = 6 + Width = 388 + object StatusLabel: TLabel + Anchors = [akLeft, akBottom] + BorderSpacing.Around = 6 + Caption = 'StatusLabel' + Color = clNone + ParentColor = False + Left = 9 + Height = 14 + Top = 218 + Width = 57 + end + object Memo: TMemo + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + OnChange = MemoChange + ScrollBars = ssAutoBoth + TabOrder = 0 + WordWrap = False + Left = 6 + Height = 208 + Top = 6 + Width = 290 + end + object SortButton: TButton + Anchors = [akTop, akRight] + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'Sort' + OnClick = SortButtonClick + TabOrder = 1 + Left = 304 + Height = 25 + Top = 6 + Width = 75 + end + end + object OKButton: TBitBtn + Anchors = [akRight, akBottom] + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = '&OK' + Default = True + Kind = bkOK + ModalResult = 1 + NumGlyphs = 0 + TabOrder = 1 + Left = 318 + Height = 25 + Top = 270 + Width = 75 + end + object CancelButton: TBitBtn + Anchors = [akRight, akBottom] + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Cancel = True + Caption = 'Cancel' + Kind = bkCancel + ModalResult = 2 + NumGlyphs = 0 + TabOrder = 2 + Left = 234 + Height = 25 + Top = 270 + Width = 75 + end +end diff --git a/ideintf/stringspropeditdlg.lrs b/ideintf/stringspropeditdlg.lrs new file mode 100644 index 0000000000..ca969e5937 --- /dev/null +++ b/ideintf/stringspropeditdlg.lrs @@ -0,0 +1,32 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TStringsPropEditorDlg','FORMDATA',[ + 'TPF0'#21'TStringsPropEditorDlg'#20'StringsPropEditorDlg'#13'ActiveControl'#7 + +#4'Memo'#7'Caption'#6#20'StringsPropEditorDlg'#12'ClientHeight'#3','#1#11'Cl' + +'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 + +#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' + +'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#25'BorderSpacing.InnerB' + +'order'#2#2#12'ClientHeight'#3#240#0#11'ClientWidth'#3#128#1#8'TabOrder'#2#0 + +#4'Left'#2#6#6'Height'#3#2#1#3'Top'#2#6#5'Width'#3#132#1#0#6'TLabel'#11'Stat' + +'usLabel'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6 + +#7'Caption'#6#11'StatusLabel'#5'Color'#7#6'clNone'#11'ParentColor'#8#4'Left' + +#2#9#6'Height'#2#14#3'Top'#3#218#0#5'Width'#2'9'#0#0#5'TMemo'#4'Memo'#7'Anch' + +'ors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'BorderSpacing.Around' + +#2#6#8'OnChange'#7#10'MemoChange'#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder' + +#2#0#8'WordWrap'#8#4'Left'#2#6#6'Height'#3#208#0#3'Top'#2#6#5'Width'#3'"'#1#0 + +#0#7'TButton'#10'SortButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#20'BorderSp' + +'acing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#4'Sort'#7 + +'OnClick'#7#15'SortButtonClick'#8'TabOrder'#2#1#4'Left'#3'0'#1#6'Height'#2#25 + +#3'Top'#2#6#5'Width'#2'K'#0#0#0#7'TBitBtn'#8'OKButton'#7'Anchors'#11#7'akRig' + +'ht'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder' + +#2#2#7'Caption'#6#3'&OK'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9 + +'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#3'>'#1#6'Height'#2#25#3'Top'#3#14#1#5 + +'Width'#2'K'#0#0#7'TBitBtn'#12'CancelButton'#7'Anchors'#11#7'akRight'#8'akBo' + +'ttom'#0#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#6'Ca' + +'ncel'#9#7'Caption'#6#6'Cancel'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9 + +'NumGlyphs'#2#0#8'TabOrder'#2#2#4'Left'#3#234#0#6'Height'#2#25#3'Top'#3#14#1 + +#5'Width'#2'K'#0#0#0 +]);