[lazarus] Create component editor : questions

olivier Guilbaud golivier at free.fr
Wed Jan 22 17:31:13 EST 2003


Hello

I test of create an TMenu editor (property Items of TMenu and TPopupMenu) but 
i have some problems : howto select the new TMenuItem in the object inspector 
?

my code is 

procedure TMenuComponentEditor.AddNewItemToDesigner(aItem : TMenuItem);
var
  Hook: TPropertyEditorHook;
  NewName: string;
begin
  Hook:=nil;
  if not GetHook(Hook) then exit;
  NewName:=GetDesigner.CreateUniqueComponentName(aItem.ClassName);
  aItem.Caption:=NewName;
  aItem.Name:=NewName;

  Hook.ComponentAdded(aItem,true);
  GetDesigner.Modified;
end;

i have an AccessViolation at " Hook.ComponentAdded(aItem,true);" and Hook is 
assigned (?)

Other problem, the Object inspector is locked because i showModal the editor 
?? then how to make. if somebody had a idee or an end of source code with an 
example

I go can be to make another editor (simpler) to advance more quickly. 
TTreeView, TListView, TToolBar ...

Thanks
Olivier






More information about the Lazarus mailing list