Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Commit

Permalink
Designer: OI: objectinspector.pp get image index
Browse files Browse the repository at this point in the history
  • Loading branch information
x2nie committed May 23, 2014
1 parent 322d63c commit 68f9b3f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/ideintf/objectinspector.pp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ TCustomPropertiesGrid = class(TOICustomPropertyGrid)

TOnAddAvailablePersistent = procedure(APersistent: TPersistent;
var Allowed: boolean) of object;
//copy of TGetPersistentImageIndexEvent
TOnOINodeGetImageEvent = procedure(APersistent: TPersistent; var AImageIndex: integer) of object;

TOIFlag = (
oifRebuildPropListsNeeded
Expand Down Expand Up @@ -635,6 +637,7 @@ TObjectInspectorDlg = class(TForm)
procedure OnShowStatusBarPopupMenuItemClick(Sender: TObject);
procedure OnShowOptionsPopupMenuItemClick(Sender: TObject);
procedure OnMainPopupMenuPopup(Sender: TObject);
procedure OnVTNodeGetImageIndex(APersistent: TPersistent; var AIndex: integer);
procedure RestrictedPageShow(Sender: TObject);
procedure WidgetSetRestrictedPaint(Sender: TObject);
procedure ComponentRestrictedPaint(Sender: TObject);
Expand Down Expand Up @@ -672,6 +675,7 @@ TObjectInspectorDlg = class(TForm)
FUpdateLock: integer;
FUpdatingAvailComboBox: Boolean;
FComponentEditor: TBaseComponentEditor;
FOnNodeGetImageIndex: TOnOINodeGetImageEvent;
function GetGridControl(Page: TObjectInspectorPage): TOICustomPropertyGrid;
procedure SetComponentEditor(const AValue: TBaseComponentEditor);
procedure SetFavorites(const AValue: TOIFavoriteProperties);
Expand Down Expand Up @@ -774,6 +778,7 @@ TObjectInspectorDlg = class(TForm)
property OnUpdateRestricted: TNotifyEvent read FOnUpdateRestricted
write FOnUpdateRestricted;
property OnViewRestricted: TNotifyEvent read FOnViewRestricted write FOnViewRestricted;
property OnNodeGetImageIndex : TOnOINodeGetImageEvent read FOnNodeGetImageIndex write FOnNodeGetImageIndex;
property PropertyEditorHook: TPropertyEditorHook
read FPropertyEditorHook write SetPropertyEditorHook;
property RestrictedProps: TOIRestrictedProperties read FRestricted write SetRestricted;
Expand Down Expand Up @@ -4089,6 +4094,7 @@ constructor TObjectInspectorDlg.Create(AnOwner: TComponent);
OnDblClick := @ComponentTreeDblClick;
OnKeyDown := @ComponentTreeKeyDown;
OnSelectionChanged := @ComponentTreeSelectionChanged;
OnNodeGetImageIndex := @OnVTNodeGetImageIndex;
OnModified := @DoModified;
Scrollbars := ssAutoBoth;
PopupMenu := MainPopupMenu;
Expand Down Expand Up @@ -5508,6 +5514,14 @@ procedure TObjectInspectorDlg.SetFavorites(const AValue: TOIFavoriteProperties);
FavoriteGrid.Favorites:=FFavorites;
end;

procedure TObjectInspectorDlg.OnVTNodeGetImageIndex(
APersistent: TPersistent; var AIndex: integer);
begin
//ask TMediator
if assigned(FOnNodeGetImageIndex) then
FOnNodeGetImageIndex(APersistent, AIndex);
end;

{ TCustomPropertiesGrid }

function TCustomPropertiesGrid.GetTIObject: TPersistent;
Expand Down

0 comments on commit 68f9b3f

Please sign in to comment.