From: <jfu...@us...> - 2008-01-22 01:32:00
|
Revision: 11701 http://jvcl.svn.sourceforge.net/jvcl/?rev=11701&view=rev Author: jfudickar Date: 2008-01-21 17:31:58 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Enhanced PropertyEditor Modified Paths: -------------- trunk/jvcl/run/JvPropertyStore.pas trunk/jvcl/run/JvPropertyStoreEditor.dfm trunk/jvcl/run/JvPropertyStoreEditor.pas Modified: trunk/jvcl/run/JvPropertyStore.pas =================================================================== --- trunk/jvcl/run/JvPropertyStore.pas 2008-01-22 01:31:15 UTC (rev 11700) +++ trunk/jvcl/run/JvPropertyStore.pas 2008-01-22 01:31:58 UTC (rev 11701) @@ -142,7 +142,7 @@ function EditIntf_GetVisibleObjectName: string; virtual; function EditIntf_TranslatePropertyName(const PropertyName: string): string; virtual; - function EditIntf_DisplayProperty(const PropertyName: string): Boolean; + function EditIntf_DisplayProperty(const PropertyName: string): Boolean; virtual; function EditIntf_GetPropertyHint(const PropertyName: string): string; virtual; function EditIntf_IsPropertySimple(const PropertyName: string): Boolean; @@ -600,13 +600,14 @@ begin Result := true; for I := 0 to GetPropCount(Self) - 1 do - begin - Result := EditIntf_IsPropertySimple(GetPropName(Self, I)); - if not Result then - Exit; - end; + if EditIntf_DisplayProperty(GetPropName(Self, I)) then + begin + Result := EditIntf_IsPropertySimple(GetPropName(Self, I)); + if not Result then + Exit; + end; end - else if PropType(Self, PropertyName) = tkClass then + else if IsPublishedProp(Self, PropertyName) and (PropType(Self, PropertyName) = tkClass) then if (TPersistent(GetObjectProp(Self, PropertyName)) is TJvCustomPropertyListStore) then Result := False Modified: trunk/jvcl/run/JvPropertyStoreEditor.dfm =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-01-22 01:31:15 UTC (rev 11700) +++ trunk/jvcl/run/JvPropertyStoreEditor.dfm 2008-01-22 01:31:58 UTC (rev 11701) @@ -12,214 +12,7 @@ Font.Style = [] OldCreateOrder = False Position = poScreenCenter + OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 - object Splitter1: TSplitter - Left = 185 - Top = 0 - Height = 360 - ExplicitLeft = 225 - ExplicitTop = 100 - ExplicitHeight = 100 - end - object BottomPanel: TPanel - Left = 0 - Top = 360 - Width = 586 - Height = 34 - Align = alBottom - BevelOuter = bvNone - TabOrder = 0 - object BottomButtonPanel: TPanel - Left = 420 - Top = 0 - Width = 166 - Height = 34 - Align = alRight - BevelOuter = bvNone - TabOrder = 0 - object OkButton: TButton - Left = 4 - Top = 6 - Width = 75 - Height = 25 - Caption = 'Ok' - ModalResult = 1 - TabOrder = 0 - OnClick = OkButtonClick - end - object CancelButton: TButton - Left = 85 - Top = 6 - Width = 75 - Height = 25 - Caption = 'Cancel' - ModalResult = 2 - TabOrder = 1 - OnClick = CancelButtonClick - end - end - end - object EditPanel: TPanel - Left = 188 - Top = 0 - Width = 398 - Height = 360 - Align = alClient - BevelOuter = bvNone - BorderWidth = 3 - TabOrder = 1 - object ListPanel: TPanel - Left = 0 - Top = 15 - Width = 241 - Height = 416 - BevelOuter = bvNone - TabOrder = 0 - object Splitter2: TSplitter - Left = 0 - Top = 141 - Width = 241 - Height = 3 - Cursor = crVSplit - Align = alTop - ExplicitTop = 132 - ExplicitWidth = 185 - end - object ListButtonPanel: TPanel - Left = 0 - Top = 144 - Width = 241 - Height = 25 - Align = alTop - BevelOuter = bvNone - TabOrder = 0 - object ListInsertButton: TButton - Left = 0 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Insert' - TabOrder = 0 - OnClick = ListInsertButtonClick - end - object ListEditButton: TButton - Left = 80 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Edit' - TabOrder = 1 - OnClick = ListEditButtonClick - end - object ListDeleteButton: TButton - Left = 120 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Delete' - TabOrder = 2 - OnClick = ListDeleteButtonClick - end - object ListCopyButton: TButton - Left = 40 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Copy' - TabOrder = 3 - OnClick = ListCopyButtonClick - end - object ListUpButton: TButton - Left = 166 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Up' - TabOrder = 4 - OnClick = ListUpButtonClick - end - object ListDownButton: TButton - Left = 205 - Top = 0 - Width = 40 - Height = 22 - Caption = '&Down' - TabOrder = 5 - OnClick = ListDownButtonClick - end - end - object ListInspectorPanel: TPanel - Left = 0 - Top = 0 - Width = 241 - Height = 141 - Align = alTop - BevelOuter = bvNone - Caption = 'ListInspectorPanel' - TabOrder = 1 - end - object ListBox: TJvListBox - Left = 0 - Top = 169 - Width = 241 - Height = 247 - Align = alClient - ItemHeight = 13 - Background.FillMode = bfmTile - Background.Visible = False - ParentFlat = False - TabOrder = 2 - OnDblClick = ListEditButtonClick - end - end - object InspectorPanel: TPanel - Left = 300 - Top = 15 - Width = 284 - Height = 386 - BevelOuter = bvNone - TabOrder = 1 - object JvInspector: TJvInspector - Left = 0 - Top = 0 - Width = 284 - Height = 386 - Align = alClient - AutoDropDown = True - Divider = 150 - ItemHeight = 16 - WantTabs = True - AfterItemCreate = JvInspectorAfterItemCreate - BeforeItemCreate = JvInspectorBeforeItemCreate - ExplicitLeft = -49 - end - end - end - object TreePanel: TPanel - Left = 0 - Top = 0 - Width = 185 - Height = 360 - Align = alLeft - BevelOuter = bvNone - BorderWidth = 3 - TabOrder = 2 - object PropertyStoreTreeView: TJvTreeView - Left = 3 - Top = 3 - Width = 179 - Height = 354 - Align = alClient - HideSelection = False - HotTrack = True - Indent = 19 - RowSelect = True - SortType = stText - TabOrder = 0 - OnChange = PropertyStoreTreeViewChange - OnChanging = PropertyStoreTreeViewChanging - LineColor = clScrollBar - end - end end Modified: trunk/jvcl/run/JvPropertyStoreEditor.pas =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-01-22 01:31:15 UTC (rev 11700) +++ trunk/jvcl/run/JvPropertyStoreEditor.pas 2008-01-22 01:31:58 UTC (rev 11701) @@ -34,31 +34,12 @@ {$ENDIF UNITVERSIONING} Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, JvExComCtrls, JvComCtrls, ExtCtrls, JvExControls, - JvInspector, StdCtrls, JvExStdCtrls, JvListBox, JvPropertyStore, JvPropertyStoreEditorIntf; + JvInspector, StdCtrls, JvExStdCtrls, JvListBox, JvPropertyStore, + JvPropertyStoreEditorIntf, JvDynControlEngineIntf; type TJvPropertyStoreEditorForm = class(TForm) - BottomButtonPanel: TPanel; - BottomPanel: TPanel; - CancelButton: TButton; - EditPanel: TPanel; - InspectorPanel: TPanel; - JvInspector: TJvInspector; - ListBox: TJvListBox; - ListButtonPanel: TPanel; - ListCopyButton: TButton; - ListDeleteButton: TButton; - ListDownButton: TButton; - ListEditButton: TButton; - ListInsertButton: TButton; - ListInspectorPanel: TPanel; - ListPanel: TPanel; - ListUpButton: TButton; - OkButton: TButton; - PropertyStoreTreeView: TJvTreeView; - Splitter1: TSplitter; - Splitter2: TSplitter; - TreePanel: TPanel; + procedure FormCreate(Sender: TObject); procedure CancelButtonClick(Sender: TObject); procedure JvInspectorAfterItemCreate(Sender: TObject; Item: TJvCustomInspectorItem); @@ -79,6 +60,14 @@ FInspectedObjectEditorHandler: IJvPropertyEditorHandler; FInspectedObjectListEditorHandler: IJvPropertyListEditorHandler; FPropertyStore: TComponent; + Inspector: TWinControl; + InspectorPanel: TWinControl; + ListBoxControlItems: IJvDynControlItems; + ListBoxControlItemIndex : IJvDynControlItemIndex; + ListPanel: TWinControl; + PropertyStoreTreeView: IJvDynControlTreeView; + RTTIInspectorControl: IJvDynControlRTTIInspectorControl; + TreePanel: TWinControl; function GetPropCount(Instance: TPersistent): Integer; function GetPropName(Instance: TPersistent; Index: Integer): string; procedure SetInspectedObject(const Value: TPersistent); @@ -91,9 +80,13 @@ FInspectedObjectEditorHandler; procedure FillListBox; protected + ListInspectorPanel: TWinControl; + procedure CreateFormControls; procedure FillTreeView(GotoNodeObject: TPersistent = nil); procedure FillTreeViewByComponent(TreeNodes: TTreeNodes; Parent: TTreeNode; aPropertyStore: TPersistent); + function OnDisplayProperty(const aPropertyName : String): Boolean; + function OnTranslatePropertyName(const aPropertyName : String): string; public procedure GotoEditObject(EditObject: TPersistent); property InspectedObjectListEditorHandler: IJvPropertyListEditorHandler read @@ -119,8 +112,19 @@ {$IFDEF HAS_UNIT_RTLCONSTS} RTLConsts, {$ENDIF HAS_UNIT_RTLCONSTS} - TypInfo; + TypInfo, JvDynControlEngine; +resourcestring + RSDialogButtonOk = '&Ok'; + RSDialogButtonCancel = '&Cancel'; + RSListButtonInsert = '&Insert'; + RSListButtonCopy = '&Copy'; + RSListButtonEdit = '&Edit'; + RSListButtonDelete = '&Delete'; + RSListButtonUp = '&Up'; + RSListButtonDown = 'Do&wn'; + RSDialogCaptionEditProperties = 'Edit Properties'; + {$R *.dfm} @@ -146,24 +150,136 @@ end; end; +procedure TJvPropertyStoreEditorForm.FormCreate(Sender: TObject); +begin + CreateFormControls; +end; + procedure TJvPropertyStoreEditorForm.CancelButtonClick(Sender: TObject); begin // end; +procedure TJvPropertyStoreEditorForm.CreateFormControls; +var BottomPanel, BottomButtonPanel : TWinControl; + Button: TButton; + TreeView: TWinControl; + TreeSplitter: TSplitter; + EditPanel: TWinControl; + ListSplitter: TSplitter; + DynControlDblClick : IJvDynControlDblClick; + ListButtonPanel: TWinControl; + ListBox: TWinControl; +begin + BottomPanel := DefaultDynControlEngine.CreatePanelControl(Self, Self, 'BottomPanel', '', alBottom); + BottomPanel.Height := 34; + if BottomPanel is TPanel then + TPanel(BottomPanel).BevelOuter := bvNone; + BottomPanel.TabOrder := 0; + BottomButtonPanel := DefaultDynControlEngine.CreatePanelControl(Self, BottomPanel, 'BottomButtonPanel', '', alRight); + BottomButtonPanel.Width := 166; + if BottomButtonPanel is TPanel then + TPanel(BottomButtonPanel).BevelOuter := bvNone; + Button := DefaultDynControlEngine.CreateButton(Self, BottomButtonPanel, 'OKButton', RSDialogButtonOk, '', OkButtonClick); + Button.Left := 4; + Button.Top := 6; + Button.Width := 75; + Button.Height := 25; + Button.ModalResult := mrOk; + Button := DefaultDynControlEngine.CreateButton(Self, BottomButtonPanel, 'CancelButton', RSDialogButtonCancel, '', CancelButtonClick); + Button.Left := 85; + Button.Top := 6; + Button.Width := 75; + Button.Height := 25; + Button.ModalResult := mrCancel; + TreePanel := DefaultDynControlEngine.CreatePanelControl(Self, Self, 'TreePanel', '', alLeft); + TreePanel.Width := 200; + if TreePanel is TPanel then + begin + TPanel(TreePanel).BevelOuter := bvNone; + TPanel(TreePanel).BorderWidth := 3; + end; + TreeView := DefaultDynControlEngine.CreateTreeViewControl(Self, TreePanel, 'PropertyStoreTreeView'); + Supports(TreeView, IJvDynControlTreeView, PropertyStoreTreeView); + TreeView.Align := alClient; + PropertyStoreTreeView.ControlSetHotTrack (True); + PropertyStoreTreeView.ControlSetOnChange (PropertyStoreTreeViewChange); + PropertyStoreTreeView.ControlSetOnChanging (PropertyStoreTreeViewChanging); + PropertyStoreTreeView.ControlSetSortType(stNone); + TreeSplitter := TSplitter.Create(Self); + TreeSplitter.Align := alLeft; + TreeSplitter.Parent := Self; + EditPanel := DefaultDynControlEngine.CreatePanelControl(Self, Self, 'EditPanel', '', alClient); + if EditPanel is TPanel then + begin + TPanel(EditPanel).BevelOuter := bvNone; + TPanel(EditPanel).BorderWidth := 3; + end; + ListPanel := DefaultDynControlEngine.CreatePanelControl(Self, EditPanel, 'ListPanel', '', alClient); + if ListPanel is TPanel then + TPanel(ListPanel).BevelOuter := bvNone; + ListInspectorPanel := DefaultDynControlEngine.CreatePanelControl(Self, ListPanel, 'ListInspectorPanel', '', alTop); + if ListInspectorPanel is TPanel then + TPanel(ListInspectorPanel).BevelOuter := bvNone; + ListInspectorPanel.Height := 141; + ListSplitter := TSplitter.Create (Self); + ListSplitter.Parent := ListPanel; + ListSplitter.Align := alTop; + ListSplitter.Cursor := crVSplit; + ListButtonPanel := DefaultDynControlEngine.CreatePanelControl(Self, ListPanel, 'ListButtonPanel', '', alTop); + ListButtonPanel.Height := 25; + if ListButtonPanel is TPanel then + TPanel(ListButtonPanel).BevelOuter := bvNone; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListInsertButton', RSListButtonInsert, '', ListInsertButtonClick); + Button.Left := 0; + Button.Width := 40; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListCopyButton', RSListButtonCopy, '', ListCopyButtonClick); + Button.Left := 40; + Button.Width := 40; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListEditButton', RSListButtonEdit, '', ListEditButtonClick); + Button.Left := 80; + Button.Width := 40; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListDeleteButton', RSListButtonDelete, '', ListDeleteButtonClick); + Button.Left := 120; + Button.Width := 40; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListUpButton', RSListButtonUp, '', ListUpButtonClick); + Button.Left := 165; + Button.Width := 40; + Button := DefaultDynControlEngine.CreateButton(Self, ListButtonPanel, 'ListDownButton', RSListButtonDown, '', ListDownButtonClick); + Button.Left := 205; + Button.Width := 40; + ListBox := DefaultDynControlEngine.CreateListBoxControl(Self, ListPanel, 'ListBox', Nil); + ListBox.Align := alClient; + Supports (ListBox, IJvDynControlItems, ListBoxControlItems); + Supports (ListBox, IJvDynControlItemIndex, ListBoxControlItemIndex); + if Supports(ListBox, IJvDynControlDblClick, DynControlDblClick) then + DynControlDblClick.ControlSetOnDblClick(ListEditButtonClick); + InspectorPanel := DefaultDynControlEngine.CreatePanelControl(Self, EditPanel, 'InspectorPanel', '', alClient); + if InspectorPanel is TPanel then + TPanel(InspectorPanel).BevelOuter := bvNone; + + Inspector := DefaultDynControlEngine.CreateRTTIInspectorControl(self, InspectorPanel, + 'Inspector', OnDisplayProperty, OnTranslatePropertyName); + Supports (Inspector, IJvDynControlRTTIInspectorControl, RTTIInspectorControl); + Inspector.Align := alClient; + + Caption := RSDialogCaptionEditProperties; + +end; + procedure TJvPropertyStoreEditorForm.FillTreeView(GotoNodeObject: TPersistent = nil); begin - PropertyStoreTreeView.Items.BeginUpdate; + PropertyStoreTreeView.ControlItems.BeginUpdate; try - PropertyStoreTreeView.Items.Clear; - FillTreeViewByComponent(PropertyStoreTreeView.Items, nil, PropertyStore); + PropertyStoreTreeView.ControlItems.Clear; + FillTreeViewByComponent(PropertyStoreTreeView.ControlItems, nil, PropertyStore); finally - PropertyStoreTreeView.Items.EndUpdate; + PropertyStoreTreeView.ControlItems.EndUpdate; end; if not Assigned(GotoNodeObject ) then - if PropertyStoreTreeView.Items.Count > 0 then - GotoEditObject(PropertyStoreTreeView.Items[0].Data) + if PropertyStoreTreeView.ControlItems.Count > 0 then + GotoEditObject(PropertyStoreTreeView.ControlItems[0].Data) else GotoEditObject(nil) else @@ -194,25 +310,24 @@ end else begin + RTTIInspectorControl.ControlInspectedObject := aPropertyStore; for I := 0 to GetPropCount(aPropertyStore) - 1 do begin PropName := GetPropName(aPropertyStore,I); - if PropertyEditorHandler.EditIntf_DisplayProperty(PropName) and - ShowPropertyInTreeView (aPropertyStore, PropName) then - case PropType(aPropertyStore, PropName) of - tkClass: - begin - SubObj := GetObjectProp(aPropertyStore, PropName); - if Supports(SubObj, IJvPropertyEditorHandler, DetailPropertyEditorHandler) and - (SubObj is TPersistent)then - begin - Node := TreeNodes.AddChildObject(Parent, - DetailPropertyEditorHandler.EditIntf_TranslatePropertyName(PropName), - SubObj); - FillTreeViewByComponent(TreeNodes, Node, TPersistent(SubObj)); - end; - end; - end; + if PropIsType(aPropertyStore, PropName, tkClass) then + begin + SubObj := GetObjectProp(aPropertyStore, PropName); + if PropertyEditorHandler.EditIntf_DisplayProperty(PropName) then + if ShowPropertyInTreeView (aPropertyStore, PropName) then + if Supports(SubObj, IJvPropertyEditorHandler, DetailPropertyEditorHandler) then + if (SubObj is TPersistent)then + begin + Node := TreeNodes.AddChildObject(Parent, + DetailPropertyEditorHandler.EditIntf_TranslatePropertyName(PropName), + SubObj); + FillTreeViewByComponent(TreeNodes, Node, TPersistent(SubObj)); + end; + end; end; if Supports (aPropertyStore, IJvPropertyListEditorHandler, PropertyListEditorHandler) then for i := 0 to PropertyListEditorHandler.ListEditIntf_ObjectCount - 1 do @@ -270,16 +385,16 @@ begin if not Assigned(EditObject) then begin - PropertyStoreTreeViewChange(nil, PropertyStoreTreeView.Selected); + PropertyStoreTreeViewChange(nil, PropertyStoreTreeView.ControlSelected); Exit; end; - for i := 0 to PropertyStoreTreeView.Items.Count - 1 do + for i := 0 to PropertyStoreTreeView.ControlItems.Count - 1 do begin - TreeNode := PropertyStoreTreeView.Items[i]; + TreeNode := PropertyStoreTreeView.ControlItems[i]; if Assigned(TreeNode.Data) and (TreeNode.Data = EditObject) then begin TreeNode.Expand(false); - PropertyStoreTreeView.Selected := TreeNode; + PropertyStoreTreeView.ControlSelected := TreeNode; Exit; end; end; @@ -291,13 +406,13 @@ i: Integer; SubObj: TObject; begin - ListBox.Items.Clear; + ListBoxControlItems.ControlItems.Clear; for i := 0 to InspectedObjectListEditorHandler.ListEditIntf_ObjectCount - 1 do begin SubObj := InspectedObjectListEditorHandler.ListEditIntf_GetObject(i); if Supports(SubObj, IJvPropertyEditorHandler, DetailObjectEditorHandler) then begin - ListBox.Items.AddObject(DetailObjectEditorHandler.EditIntf_GetVisibleObjectName + ' - ' + ' [' + inttostr(i + 1) + '] ', SubObj); + ListBoxControlItems.ControlItems.AddObject(DetailObjectEditorHandler.EditIntf_GetVisibleObjectName + ' - ' + ' [' + inttostr(i + 1) + '] ', SubObj); end; end; end; @@ -333,7 +448,7 @@ begin if Assigned(InspectedObjectListEditorHandler) then begin - NewObject := InspectedObjectListEditorHandler.ListEditIntf_CloneNewObject(ListBox.ItemIndex); + NewObject := InspectedObjectListEditorHandler.ListEditIntf_CloneNewObject(ListBoxControlItemIndex.ControlItemIndex); if Assigned(NewObject) then begin FillTreeView (NewObject); @@ -347,8 +462,8 @@ begin if Assigned(InspectedObjectListEditorHandler) then begin - EditObject := TPersistent(PropertyStoreTreeView.Selected.Data); - InspectedObjectListEditorHandler.ListEditIntf_DeleteObject(ListBox.ItemIndex); + EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); + InspectedObjectListEditorHandler.ListEditIntf_DeleteObject(ListBoxControlItemIndex.ControlItemIndex); FillTreeView (EditObject); end; end; @@ -358,13 +473,13 @@ EditObject: TPersistent; Ind : Integer; begin - if Assigned(InspectedObjectListEditorHandler) and (ListBox.ItemIndex < ListBox.Items.Count) then + if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndex.ControlItemIndex < ListBoxControlItems.ControlItems.Count) then begin - EditObject := TPersistent(PropertyStoreTreeView.Selected.Data); - Ind := ListBox.ItemIndex; - InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBox.ItemIndex, ListBox.ItemIndex+1); + EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); + Ind := ListBoxControlItemIndex.ControlItemIndex; + InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndex.ControlItemIndex, ListBoxControlItemIndex.ControlItemIndex+1); FillTreeView (EditObject); - ListBox.ItemIndex := Ind +1; + ListBoxControlItemIndex.ControlItemIndex := Ind +1; end; end; @@ -374,7 +489,7 @@ begin if Assigned(InspectedObjectListEditorHandler) then begin - EditObject := InspectedObjectListEditorHandler.ListEditIntf_GetObject(ListBox.ItemIndex); + EditObject := InspectedObjectListEditorHandler.ListEditIntf_GetObject(ListBoxControlItemIndex.ControlItemIndex); if Assigned(EditObject) then GotoEditObject (EditObject); end; @@ -396,13 +511,13 @@ EditObject: TPersistent; Ind : Integer; begin - if Assigned(InspectedObjectListEditorHandler) and (ListBox.ItemIndex > 0) then + if Assigned(InspectedObjectListEditorHandler) and (ListBoxControlItemIndex.ControlItemIndex > 0) then begin - EditObject := TPersistent(PropertyStoreTreeView.Selected.Data); - Ind := ListBox.ItemIndex; - InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBox.ItemIndex, ListBox.ItemIndex-1); + EditObject := TPersistent(PropertyStoreTreeView.ControlSelected.Data); + Ind := ListBoxControlItemIndex.ControlItemIndex; + InspectedObjectListEditorHandler.ListEditIntf_MoveObjectPosition(ListBoxControlItemIndex.ControlItemIndex, ListBoxControlItemIndex.ControlItemIndex-1); FillTreeView (EditObject); - ListBox.ItemIndex := Ind -1; + ListBoxControlItemIndex.ControlItemIndex := Ind -1; end; end; @@ -411,6 +526,14 @@ // end; +function TJvPropertyStoreEditorForm.OnDisplayProperty(const aPropertyName : + String): Boolean; +begin + if Assigned(InspectedObjectEditorHandler) then + Result := InspectedObjectEditorHandler.EditIntf_DisplayProperty(aPropertyName) + and InspectedObjectEditorHandler.EditIntf_IsPropertySimple(aPropertyName) ; +end; + procedure TJvPropertyStoreEditorForm.PropertyStoreTreeViewChange(Sender: TObject; Node: TTreeNode); begin @@ -428,13 +551,13 @@ TObject; Node: TTreeNode; var AllowChange: Boolean); var JvPropertyEditorHandler : IJvPropertyEditorHandler; begin - if Assigned(Node) and - Assigned(Node.Data) and - (TObject(Node.Data) is TPersistent) and - Supports(TObject(Node.Data), IJvPropertyEditorHandler, JvPropertyEditorHandler) and - (JvPropertyEditorHandler.EditIntf_GetVisibleObjectName <> '') then - Node.Text := JvPropertyEditorHandler.EditIntf_GetVisibleObjectName; - + RTTIInspectorControl.ControlSaveEditorValues; + if Assigned(PropertyStoreTreeView.ControlSelected) and + Assigned(PropertyStoreTreeView.ControlSelected.Data) and + (TObject(PropertyStoreTreeView.ControlSelected.Data) is TPersistent) then + if Supports(TObject(PropertyStoreTreeView.ControlSelected.Data), IJvPropertyEditorHandler, JvPropertyEditorHandler) then + if (JvPropertyEditorHandler.EditIntf_GetVisibleObjectName <> '') then + PropertyStoreTreeView.ControlSelected.Text := JvPropertyEditorHandler.EditIntf_GetVisibleObjectName; end; procedure TJvPropertyStoreEditorForm.SetInspectedObject(const Value: @@ -443,29 +566,21 @@ FInspectedObject := Value; Supports(InspectedObject, IJvPropertyEditorHandler, FInspectedObjectEditorHandler); Supports(InspectedObject, IJvPropertyListEditorHandler, FInspectedObjectListEditorHandler); - JvInspector.SaveValues; - JvInspector.InspectObject := Value; - if not Assigned(InspectedObject) then + RTTIInspectorControl.ControlSaveEditorValues; + RTTIInspectorControl.ControlInspectedObject := Value; + if Assigned(FInspectedObjectListEditorHandler) then begin - ListPanel.visible := False; + ListPanel.visible := True; + Inspector.Parent := ListInspectorPanel; InspectorPanel.visible := False; - end - else if Assigned(FInspectedObjectListEditorHandler) then - begin - ListPanel.visible := True; - ListPanel.Align := alClient; - InspectorPanel.Parent := ListInspectorPanel; - InspectorPanel.Align := alClient; - ListInspectorPanel.visible := JvInspector.VisibleCount > 0; + ListInspectorPanel.visible := RTTIInspectorControl.ControlGetVisibleItemsCount > 0; FillListBox; end else begin InspectorPanel.visible := True; ListPanel.visible := False; - ListPanel.Align := alClient; - InspectorPanel.Parent := EditPanel; - InspectorPanel.Align := alClient; + Inspector.Parent := InspectorPanel; end; end; @@ -474,7 +589,7 @@ if not Supports(Value, IJvPropertyEditorHandler) then Raise Exception.Create ('TJvPropertyStoreEditorForm.SetPropertyStore : PropertyStore must support IJvPropertyEditorHandler'); FPropertyStore := Value; - FillTreeView; + FillTreeView(Value); end; function TJvPropertyStoreEditorForm.ShowPropertyInTreeView(PropObject: TObject; @@ -487,9 +602,21 @@ Result := False else if Supports(PropObject, IJvPropertyEditorHandler, PropertyEditorHandler) then - Result := not PropertyEditorHandler.EditIntf_IsPropertySimple(PropertyName); + begin + Result := (not PropertyEditorHandler.EditIntf_IsPropertySimple(PropertyName)); + Result := Result or (not RTTIInspectorControl.ControlIsPropertySupported(PropertyName)) + end + else + Result := not RTTIInspectorControl.ControlIsPropertySupported(PropertyName); end; +function TJvPropertyStoreEditorForm.OnTranslatePropertyName(const aPropertyName : + String): string; +begin +// Result := ; + // TODO -cMM: TJvPropertyStoreEditorForm.TranslatePropertyName default body inserted +end; + {$IFDEF UNITVERSIONING} initialization RegisterUnitVersion(HInstance, UnitVersioning); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |