IdeIntf: Property editor for Strings in ValueListEditor. Does not work well yet.

git-svn-id: trunk@44575 -
This commit is contained in:
juha 2014-04-01 00:12:59 +00:00
parent 234935f6bc
commit 18858b8e2d
3 changed files with 243 additions and 186 deletions

View File

@ -20,50 +20,50 @@
<Description Value="IDEIntf - the interface units for the Lazarus IDE"/>
<License Value="Modified LPGL2"/>
<Version Major="1"/>
<Files Count="73">
<Files Count="75">
<Item1>
<Filename Value="actionseditor.lfm"/>
<Type Value="LFM"/>
</Item1>
<Item2>
<Filename Value="actionseditor.pas"/>
<UnitName Value="ActionsEditor"/>
</Item1>
<Item2>
<Filename Value="actionseditor.lfm"/>
<Type Value="LFM"/>
</Item2>
<Item3>
<Filename Value="actionseditorstd.lfm"/>
<Type Value="LFM"/>
</Item3>
<Item4>
<Filename Value="actionseditorstd.pas"/>
<UnitName Value="ActionsEditorStd"/>
</Item3>
<Item4>
<Filename Value="actionseditorstd.lfm"/>
<Type Value="LFM"/>
</Item4>
<Item5>
<Filename Value="baseideintf.pas"/>
<UnitName Value="BaseIDEIntf"/>
</Item5>
<Item6>
<Filename Value="checkgroupeditordlg.lfm"/>
<Type Value="LFM"/>
</Item6>
<Item7>
<Filename Value="checkgroupeditordlg.pas"/>
<UnitName Value="CheckGroupEditorDlg"/>
</Item6>
<Item7>
<Filename Value="checkgroupeditordlg.lfm"/>
<Type Value="LFM"/>
</Item7>
<Item8>
<Filename Value="checklistboxeditordlg.lfm"/>
<Type Value="LFM"/>
</Item8>
<Item9>
<Filename Value="checklistboxeditordlg.pas"/>
<UnitName Value="CheckListboxEditorDlg"/>
</Item8>
<Item9>
<Filename Value="checklistboxeditordlg.lfm"/>
<Type Value="LFM"/>
</Item9>
<Item10>
<Filename Value="collectionpropeditform.lfm"/>
<Type Value="LFM"/>
</Item10>
<Item11>
<Filename Value="collectionpropeditform.pas"/>
<UnitName Value="CollectionPropEditForm"/>
</Item10>
<Item11>
<Filename Value="collectionpropeditform.lfm"/>
<Type Value="LFM"/>
</Item11>
<Item12>
<Filename Value="columndlg.pp"/>
@ -82,19 +82,19 @@
<UnitName Value="ComponentTreeView"/>
</Item15>
<Item16>
<Filename Value="dbpropedits.pas"/>
<UnitName Value="DBPropEdits"/>
<Filename Value="compoptsintf.pas"/>
<UnitName Value="CompOptsIntf"/>
</Item16>
<Item17>
<Filename Value="fieldseditor.lfm"/>
<Type Value="LFM"/>
<Filename Value="dbpropedits.pas"/>
<UnitName Value="DBPropEdits"/>
</Item17>
<Item18>
<Filename Value="fieldseditor.pas"/>
<UnitName Value="fieldseditor"/>
</Item18>
<Item19>
<Filename Value="fieldslist.lfm"/>
<Filename Value="fieldseditor.lfm"/>
<Type Value="LFM"/>
</Item19>
<Item20>
@ -102,218 +102,226 @@
<UnitName Value="fieldslist"/>
</Item20>
<Item21>
<Filename Value="formeditingintf.pas"/>
<UnitName Value="FormEditingIntf"/>
<Filename Value="fieldslist.lfm"/>
<Type Value="LFM"/>
</Item21>
<Item22>
<Filename Value="frmselectprops.lfm"/>
<Type Value="LFM"/>
<Filename Value="filefilterpropeditor.pas"/>
<UnitName Value="FileFilterPropEditor"/>
</Item22>
<Item23>
<Filename Value="frmselectprops.pas"/>
<UnitName Value="frmSelectProps"/>
<Filename Value="filefilterpropeditor.lfm"/>
<Type Value="LFM"/>
</Item23>
<Item24>
<Filename Value="graphicpropedit.lfm"/>
<Type Value="LFM"/>
<Filename Value="formeditingintf.pas"/>
<UnitName Value="FormEditingIntf"/>
</Item24>
<Item25>
<Filename Value="graphicpropedit.pas"/>
<UnitName Value="GraphicPropEdit"/>
<Filename Value="frmselectprops.pas"/>
<UnitName Value="frmSelectProps"/>
</Item25>
<Item26>
<Filename Value="graphpropedits.pas"/>
<UnitName Value="GraphPropEdits"/>
<Filename Value="frmselectprops.lfm"/>
<Type Value="LFM"/>
</Item26>
<Item27>
<Filename Value="headercontrolpropedit.pp"/>
<UnitName Value="HeaderControlPropEdit"/>
<Filename Value="graphicpropedit.pas"/>
<UnitName Value="GraphicPropEdit"/>
</Item27>
<Item28>
<Filename Value="helpfpdoc.pas"/>
<UnitName Value="HelpFPDoc"/>
<Filename Value="graphicpropedit.lfm"/>
<Type Value="LFM"/>
</Item28>
<Item29>
<Filename Value="idecommands.pas"/>
<UnitName Value="IDECommands"/>
<Filename Value="graphpropedits.pas"/>
<UnitName Value="GraphPropEdits"/>
</Item29>
<Item30>
<Filename Value="idedialogs.pas"/>
<UnitName Value="IDEDialogs"/>
<Filename Value="headercontrolpropedit.pp"/>
<UnitName Value="HeaderControlPropEdit"/>
</Item30>
<Item31>
<Filename Value="ideexterntoolintf.pas"/>
<UnitName Value="IDEExternToolIntf"/>
<Filename Value="helpfpdoc.pas"/>
<UnitName Value="HelpFPDoc"/>
</Item31>
<Item32>
<Filename Value="idehelpintf.pas"/>
<UnitName Value="IDEHelpIntf"/>
<Filename Value="idecommands.pas"/>
<UnitName Value="IDECommands"/>
</Item32>
<Item33>
<Filename Value="ideimagesintf.pas"/>
<UnitName Value="IDEImagesIntf"/>
<Filename Value="idedialogs.pas"/>
<UnitName Value="IDEDialogs"/>
</Item33>
<Item34>
<Filename Value="idemsgintf.pas"/>
<UnitName Value="IDEMsgIntf"/>
<Filename Value="ideexterntoolintf.pas"/>
<UnitName Value="IDEExternToolIntf"/>
</Item34>
<Item35>
<Filename Value="ideoptionsintf.pas"/>
<UnitName Value="IDEOptionsIntf"/>
<Filename Value="idehelpintf.pas"/>
<UnitName Value="IDEHelpIntf"/>
</Item35>
<Item36>
<Filename Value="idetextconverter.pas"/>
<UnitName Value="IDETextConverter"/>
<Filename Value="ideimagesintf.pas"/>
<UnitName Value="IDEImagesIntf"/>
</Item36>
<Item37>
<Filename Value="idemsgintf.pas"/>
<UnitName Value="IDEMsgIntf"/>
</Item37>
<Item38>
<Filename Value="ideoptionsintf.pas"/>
<UnitName Value="IDEOptionsIntf"/>
</Item38>
<Item39>
<Filename Value="idetextconverter.pas"/>
<UnitName Value="IDETextConverter"/>
</Item39>
<Item40>
<Filename Value="ideutils.pas"/>
<UnitName Value="IDEUtils"/>
</Item40>
<Item41>
<Filename Value="idewindowintf.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="IDEWindowIntf"/>
</Item37>
<Item38>
<Filename Value="imagelisteditor.lfm"/>
<Type Value="LFM"/>
</Item38>
<Item39>
<Filename Value="imagelisteditor.pp"/>
<UnitName Value="ImageListEditor"/>
</Item39>
<Item40>
<Filename Value="lazideintf.pas"/>
<UnitName Value="LazIDEIntf"/>
</Item40>
<Item41>
<Filename Value="lazstringgridedit.lfm"/>
<Type Value="LFM"/>
</Item41>
<Item42>
<Filename Value="lazstringgridedit.pas"/>
<UnitName Value="LazStringGridEdit"/>
<Filename Value="imagelisteditor.pp"/>
<UnitName Value="ImageListEditor"/>
</Item42>
<Item43>
<Filename Value="listviewpropedit.lfm"/>
<Filename Value="imagelisteditor.lfm"/>
<Type Value="LFM"/>
</Item43>
<Item44>
<Filename Value="listviewpropedit.pp"/>
<UnitName Value="ListViewPropEdit"/>
<Filename Value="keyvalpropeditdlg.pas"/>
<UnitName Value="KeyValPropEditDlg"/>
</Item44>
<Item45>
<Filename Value="macrointf.pas"/>
<UnitName Value="MacroIntf"/>
<Filename Value="keyvalpropeditdlg.lfm"/>
<Type Value="LFM"/>
</Item45>
<Item46>
<Filename Value="maskpropedit.lfm"/>
<Type Value="LFM"/>
<Filename Value="lazideintf.pas"/>
<UnitName Value="LazIDEIntf"/>
</Item46>
<Item47>
<Filename Value="maskpropedit.pas"/>
<UnitName Value="MaskPropEdit"/>
<Filename Value="lazstringgridedit.pas"/>
<UnitName Value="LazStringGridEdit"/>
</Item47>
<Item48>
<Filename Value="menuintf.pas"/>
<UnitName Value="MenuIntf"/>
<Filename Value="lazstringgridedit.lfm"/>
<Type Value="LFM"/>
</Item48>
<Item49>
<Filename Value="newfield.lfm"/>
<Type Value="LFM"/>
<Filename Value="listviewpropedit.pp"/>
<UnitName Value="ListViewPropEdit"/>
</Item49>
<Item50>
<Filename Value="newfield.pas"/>
<UnitName Value="newfield"/>
<Filename Value="listviewpropedit.lfm"/>
<Type Value="LFM"/>
</Item50>
<Item51>
<Filename Value="newitemintf.pas"/>
<UnitName Value="NewItemIntf"/>
</Item51>
<Item52>
<Filename Value="objectinspector.lfm"/>
<Type Value="LFM"/>
</Item52>
<Item53>
<Filename Value="objectinspector.pp"/>
<UnitName Value="ObjectInspector"/>
</Item53>
<Item54>
<Filename Value="objinspstrconsts.pas"/>
<UnitName Value="ObjInspStrConsts"/>
</Item54>
<Item55>
<Filename Value="packageintf.pas"/>
<UnitName Value="PackageIntf"/>
</Item55>
<Item56>
<Filename Value="projectintf.pas"/>
<UnitName Value="ProjectIntf"/>
</Item56>
<Item57>
<Filename Value="projectresourcesintf.pas"/>
<UnitName Value="ProjectResourcesIntf"/>
</Item57>
<Item58>
<Filename Value="propedits.pp"/>
<UnitName Value="PropEdits"/>
</Item58>
<Item59>
<Filename Value="propeditutils.pp"/>
<UnitName Value="PropEditUtils"/>
</Item59>
<Item60>
<Filename Value="srceditorintf.pas"/>
<UnitName Value="SrcEditorIntf"/>
</Item60>
<Item61>
<Filename Value="statusbarpropedit.pp"/>
<UnitName Value="StatusBarPropEdit"/>
</Item61>
<Item62>
<Filename Value="stringspropeditdlg.lfm"/>
<Type Value="LFM"/>
</Item62>
<Item63>
<Filename Value="stringspropeditdlg.pas"/>
<UnitName Value="StringsPropEditDlg"/>
</Item63>
<Item64>
<Filename Value="texttools.pas"/>
<UnitName Value="TextTools"/>
</Item64>
<Item65>
<Filename Value="treeviewpropedit.lfm"/>
<Type Value="LFM"/>
</Item65>
<Item66>
<Filename Value="treeviewpropedit.pas"/>
<UnitName Value="TreeViewPropEdit"/>
</Item66>
<Item67>
<Filename Value="compoptsintf.pas"/>
<UnitName Value="CompOptsIntf"/>
</Item67>
<Item68>
<Filename Value="oifavoriteproperties.pas"/>
<UnitName Value="OIFavoriteProperties"/>
</Item68>
<Item69>
<Filename Value="unitresources.pas"/>
<UnitName Value="UnitResources"/>
</Item69>
<Item70>
<Filename Value="macrodefintf.pas"/>
<UnitName Value="MacroDefIntf"/>
</Item51>
<Item52>
<Filename Value="macrointf.pas"/>
<UnitName Value="MacroIntf"/>
</Item52>
<Item53>
<Filename Value="maskpropedit.pas"/>
<UnitName Value="MaskPropEdit"/>
</Item53>
<Item54>
<Filename Value="maskpropedit.lfm"/>
<Type Value="LFM"/>
</Item54>
<Item55>
<Filename Value="menuintf.pas"/>
<UnitName Value="MenuIntf"/>
</Item55>
<Item56>
<Filename Value="newfield.pas"/>
<UnitName Value="newfield"/>
</Item56>
<Item57>
<Filename Value="newfield.lfm"/>
<Type Value="LFM"/>
</Item57>
<Item58>
<Filename Value="newitemintf.pas"/>
<UnitName Value="NewItemIntf"/>
</Item58>
<Item59>
<Filename Value="objectinspector.pp"/>
<UnitName Value="ObjectInspector"/>
</Item59>
<Item60>
<Filename Value="objectinspector.lfm"/>
<Type Value="LFM"/>
</Item60>
<Item61>
<Filename Value="objinspstrconsts.pas"/>
<UnitName Value="ObjInspStrConsts"/>
</Item61>
<Item62>
<Filename Value="oifavoriteproperties.pas"/>
<UnitName Value="OIFavoriteProperties"/>
</Item62>
<Item63>
<Filename Value="packageintf.pas"/>
<UnitName Value="PackageIntf"/>
</Item63>
<Item64>
<Filename Value="projectintf.pas"/>
<UnitName Value="ProjectIntf"/>
</Item64>
<Item65>
<Filename Value="projectresourcesintf.pas"/>
<UnitName Value="ProjectResourcesIntf"/>
</Item65>
<Item66>
<Filename Value="propedits.pp"/>
<UnitName Value="PropEdits"/>
</Item66>
<Item67>
<Filename Value="propeditutils.pp"/>
<UnitName Value="PropEditUtils"/>
</Item67>
<Item68>
<Filename Value="srceditorintf.pas"/>
<UnitName Value="SrcEditorIntf"/>
</Item68>
<Item69>
<Filename Value="statusbarpropedit.pp"/>
<UnitName Value="StatusBarPropEdit"/>
</Item69>
<Item70>
<Filename Value="stringspropeditdlg.pas"/>
<UnitName Value="StringsPropEditDlg"/>
</Item70>
<Item71>
<Filename Value="filefilterpropeditor.lfm"/>
<Filename Value="stringspropeditdlg.lfm"/>
<Type Value="LFM"/>
</Item71>
<Item72>
<Filename Value="filefilterpropeditor.pas"/>
<UnitName Value="FileFilterPropEditor"/>
<Filename Value="texttools.pas"/>
<UnitName Value="TextTools"/>
</Item72>
<Item73>
<Filename Value="ideutils.pas"/>
<UnitName Value="IDEUtils"/>
<Filename Value="treeviewpropedit.pas"/>
<UnitName Value="TreeViewPropEdit"/>
</Item73>
<Item74>
<Filename Value="treeviewpropedit.lfm"/>
<Type Value="LFM"/>
</Item74>
<Item75>
<Filename Value="unitresources.pas"/>
<UnitName Value="UnitResources"/>
</Item75>
</Files>
<LazDoc Paths="docs"/>
<i18n>

View File

@ -9,17 +9,17 @@ interface
uses
ActionsEditor, ActionsEditorStd, BaseIDEIntf, CheckGroupEditorDlg,
CheckListboxEditorDlg, CollectionPropEditForm, ColumnDlg, ComponentEditors,
ComponentReg, ComponentTreeView, DBPropEdits, fieldseditor, fieldslist,
FormEditingIntf, frmSelectProps, GraphicPropEdit, GraphPropEdits,
HeaderControlPropEdit, HelpFPDoc, IDECommands, IDEDialogs,
IDEExternToolIntf, IDEHelpIntf, IDEImagesIntf, IDEMsgIntf, IDEOptionsIntf,
IDETextConverter, IDEWindowIntf, ImageListEditor, LazIDEIntf,
LazStringGridEdit, ListViewPropEdit, MacroIntf, MaskPropEdit, MenuIntf,
newfield, NewItemIntf, ObjectInspector, ObjInspStrConsts, PackageIntf,
ProjectIntf, ProjectResourcesIntf, PropEdits, PropEditUtils, SrcEditorIntf,
StatusBarPropEdit, StringsPropEditDlg, TextTools, TreeViewPropEdit,
CompOptsIntf, OIFavoriteProperties, UnitResources, MacroDefIntf,
FileFilterPropEditor, IDEUtils, LazarusPackageIntf;
ComponentReg, ComponentTreeView, CompOptsIntf, DBPropEdits, fieldseditor,
fieldslist, FileFilterPropEditor, FormEditingIntf, frmSelectProps,
GraphicPropEdit, GraphPropEdits, HeaderControlPropEdit, HelpFPDoc,
IDECommands, IDEDialogs, IDEExternToolIntf, IDEHelpIntf, IDEImagesIntf,
IDEMsgIntf, IDEOptionsIntf, IDETextConverter, IDEUtils, IDEWindowIntf,
ImageListEditor, KeyValPropEditDlg, LazIDEIntf, LazStringGridEdit,
ListViewPropEdit, MacroDefIntf, MacroIntf, MaskPropEdit, MenuIntf, newfield,
NewItemIntf, ObjectInspector, ObjInspStrConsts, OIFavoriteProperties,
PackageIntf, ProjectIntf, ProjectResourcesIntf, PropEdits, PropEditUtils,
SrcEditorIntf, StatusBarPropEdit, StringsPropEditDlg, TextTools,
TreeViewPropEdit, UnitResources, LazarusPackageIntf;
implementation

View File

@ -30,10 +30,11 @@ uses
Classes, TypInfo, SysUtils, types, Forms, Controls, LCLProc, GraphType,
FPCAdds, // for StrToQWord in older fpc versions
StringHashList, ButtonPanel, Graphics, StdCtrls, Buttons, Menus, LCLType,
ExtCtrls, ComCtrls, LCLIntf, Dialogs, EditBtn, PropertyStorage,
ExtCtrls, ComCtrls, LCLIntf, Dialogs, EditBtn, PropertyStorage, ValEdit,
FileUtil, FileCtrl, ObjInspStrConsts, PropEditUtils,
// Forms with .lfm files
FrmSelectProps, StringsPropEditDlg, CollectionPropEditForm, FileFilterPropEditor;
FrmSelectProps, StringsPropEditDlg, KeyValPropEditDlg, CollectionPropEditForm,
FileFilterPropEditor;
const
MaxIdentLength: Byte = 63;
@ -791,7 +792,7 @@ type
{ TStringsPropertyEditor
PropertyEditor editor for the TStrings properties.
Brings up the dialog for entering text. }
Brings up a dialog with a Memo for entering text. }
TStringsPropEditorDlg = class;
@ -803,6 +804,20 @@ type
end;
{ TValueListPropertyEditor
PropertyEditor editor for the TStrings property of TValueListEditor.
Brings up a dialog with a ValueListEditor for entering keys and values. }
TKeyValPropEditorDlg = class;
TValueListPropertyEditor = class(TClassPropertyEditor)
public
procedure Edit; override;
function CreateDlg(s: TStrings): TKeyValPropEditorDlg; virtual;
function GetAttributes: TPropertyAttributes; override;
end;
{ TCursorPropertyEditor
PropertyEditor editor for the TCursor properties.
Displays cursor as constant name if exists, otherwise an integer. }
@ -1464,6 +1479,11 @@ type
Editor: TPropertyEditor;
end;
TKeyValPropEditorDlg = class(TKeyValPropEditorFrm)
public
Editor: TPropertyEditor;
end;
{ TCustomShortCutGrabBox }
TCustomShortCutGrabBox = class(TCustomPanel)
@ -4997,6 +5017,34 @@ begin
Result := [paMultiSelect, paDialog, paRevertable, paReadOnly];
end;
{ TValueListPropertyEditor }
procedure TValueListPropertyEditor.Edit;
var
TheDialog: TKeyValPropEditorDlg;
begin
TheDialog := CreateDlg(TStrings(GetObjectValue));
try
if (TheDialog.ShowModal = mrOK) then
SetPtrValue(TheDialog.ValueListEdit.Strings);
finally
TheDialog.Free;
end;
end;
function TValueListPropertyEditor.CreateDlg(s: TStrings): TKeyValPropEditorDlg;
begin
Result := TKeyValPropEditorDlg.Create(Application);
Result.Editor := Self;
Result.ValueListEdit.Strings.Assign(s);
Result.ValueListEdit.Invalidate;
end;
function TValueListPropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect, paDialog, paRevertable, paReadOnly];
end;
{ TStringMultilinePropertyEditor }
procedure TStringMultilinePropertyEditor.Edit;
@ -6821,6 +6869,7 @@ begin
RegisterPropertyEditor(TypeInfo(AnsiString), TFilterComboBox, 'Filter', TFileDlgFilterProperty);
RegisterPropertyEditor(TypeInfo(AnsiString), TFileNameEdit, 'Filter', TFileDlgFilterProperty);
RegisterPropertyEditor(TypeInfo(AnsiString), TCustomPropertyStorage, 'Filename', TFileNamePropertyEditor);
RegisterPropertyEditor(TypeInfo(TStrings), TValueListEditor, '', TValueListPropertyEditor);
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideLeft', THiddenPropertyEditor);
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideTop', THiddenPropertyEditor);
RegisterPropertyEditor(TypeInfo(TAnchorSide), TControl, 'AnchorSideRight', THiddenPropertyEditor);