Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TMySelectionEditor = class(TSelectionEditor)
- public
- procedure RequiresUnits(Proc: TGetStrProc); override;
- end;
- procedure Register;
- implementation
- procedure TMySelectionEditor.RequiresUnits(Proc: TGetStrProc);
- var
- comp: TMyComponent;
- I: Integer;
- begin
- inherited RequiresUnits(Proc);
- Proc('ExtraUnit');
- // might be a better way of doing the code from here onwards?
- if (Designer=nil)or(Designer.Root=nil) then Exit;
- for I := 0 to Designer.Root.ComponentCount - 1 do
- begin
- if (Designer.Root.Components[i] is TMyComponent) then
- begin
- comp := TMyComponent(Designer.Root.Components[i]);
- if comp.SampleProperty = True then
- Proc('ExtraUnit2');
- Proc(comp.ObjProperty.UnitName);
- end;
- end;
- end;
- procedure Register;
- begin
- RegisterSelectionEditor(TMyComponent, TMySelectionEditor);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement