<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Am 25.04.2018 um 22:07 schrieb Werner Pamler via Lazarus:<br>
<blockquote type="cite"
cite="mid:75e68054-b8f6-cbae-7959-42fba73ee5ff@freenet.de">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Am 25.04.2018 um 20:40 schrieb Vojtěch Čihák via Lazarus: <br>
<blockquote type="cite"
cite="mid:20180425204017.1C3573CE@atlas.cz">
<p style="padding:0 0 0 0; margin:0 0 0 0;">ad 1: I never tried
two level collection. Are they all published (both collections
and their items)?</p>
</blockquote>
<br>
Yes. And both collections are accessible in the object inspector:
The JvOutlookBar has a property "Pages", the ellipsis button next
to it opens the usual collection property editor which can be used
to add, delete or rearrange pages. And when one of the pages is
selected the object inspector displays the property "Buttons",
again with an ellipsis button to open another collection property
editor, now for the buttons. This part is working out of the box.
The problem is the component tree which only shows the page nodes
but no button nodes.<br>
</blockquote>
<br>
I am getting the impression that this is a bug of the component
tree. The listed page items inherit from TCollectionItem, not from
TComponent. The component tree somehow must be instructed to look
for another collection within each page colletionItem. <br>
<br>
<blockquote type="cite"
cite="mid:75e68054-b8f6-cbae-7959-42fba73ee5ff@freenet.de">
<blockquote type="cite"
cite="mid:20180425204017.1C3573CE@atlas.cz">
<p style="padding:0 0 0 0; margin:0 0 0 0;">ad 2: You can do (in
your component editor) something like:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">var aHook:
TPropertyEditorHook;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">begin</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> ...</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> aHook:=nil;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> if not
GetHook(aHook) then exit;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> ...</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> //add or insert:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">
AddedItem:=aComponent.Columns.Add;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">
aHook.PersistentAdded(<span style="font-size: 13.3333px;">AddedItem</span>,
True); //this notifies component tree</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">
aHook.SelectOnlyThis(<span style="font-size: 13.3333px;">AddedItem</span>); //this
selects added object</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> //deleting</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> DeletedItem:=<span
style="font-size: 13.3333px;">aComponent</span>.Columns[<span
style="font-size: 13.3333px;">aIndex</span>];</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">
aHook.DeletePersistent(TPersistent(<span style="font-size:
13.3333px;">DeletedItem</span>)); <span style="font-size:
13.3333px;"> </span><span style="font-size: 13.3333px;">//this
notifies component tree</span></p>
</blockquote>
<br>
This is for notification of the component tree by the component
editor and this code is already there and working. What I want is
notification of the component editor by the designer if pages or
buttons are added while the component editor is open (the
component editor is not modal).<br>
</blockquote>
<br>
I was able to solve this based on code I found in unit
components/ideintf/fieldseditor. The key point is that handlers for
GlobalDesignHook events/notifications must be added. BTW, there is a
"GlobalDesignHook" and a "FDesigner.PropertyEditorHook" - are they
the same, or: what is the difference?<br>
</body>
</html>