Re: [Lazarus] Component editors and related

2018-05-01 Thread Werner Pamler via Lazarus

Am 01.05.2018 um 20:54 schrieb Juha Manninen via Lazarus:

Please test with r57763.


Excellent, works perfectly! Thank you.

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Component editors and related

2018-05-01 Thread Juha Manninen via Lazarus
On Wed, Apr 25, 2018 at 8:56 PM, Werner Pamler via Lazarus
 wrote:
> currently I am porting those JVCL components which look interesting to me
> (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/),
> but at the moment I am stuck with the component editor of the TJvOutlookBar.

Please test with r57763.

Juha
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Component editors and related

2018-04-26 Thread Mattias Gaertner via Lazarus
On Thu, 26 Apr 2018 14:33:15 +0200
Werner Pamler via Lazarus  wrote:

>[...]there is a 
> "GlobalDesignHook" and a "FDesigner.PropertyEditorHook" - are they the 
> same, or: what is the difference?

They are the same.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Component editors and related

2018-04-26 Thread Werner Pamler via Lazarus

Am 25.04.2018 um 22:07 schrieb Werner Pamler via Lazarus:

Am 25.04.2018 um 20:40 schrieb Vojtěch Čihák via Lazarus:


ad 1: I never tried two level collection. Are they all published 
(both collections and their items)?




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.


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.



ad 2: You can do (in your component editor) something like:

var aHook: TPropertyEditorHook;

begin

  ...

  aHook:=nil;

      if not GetHook(aHook) then exit;

  ...

  //add or insert:

AddedItem:=aComponent.Columns.Add;

aHook.PersistentAdded(AddedItem, True);  //this notifies component tree

aHook.SelectOnlyThis(AddedItem);   //this selects added object

  //deleting

   DeletedItem:=aComponent.Columns[aIndex];

 aHook.DeletePersistent(TPersistent(DeletedItem)); //this notifies 
component tree




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).


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?
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Component editors and related

2018-04-25 Thread Werner Pamler via Lazarus

Am 25.04.2018 um 20:40 schrieb Vojtěch Čihák via Lazarus:


ad 1: I never tried two level collection. Are they all published (both 
collections and their items)?




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.



ad 2: You can do (in your component editor) something like:

var aHook: TPropertyEditorHook;

begin

  ...

  aHook:=nil;

      if not GetHook(aHook) then exit;

  ...

  //add or insert:

AddedItem:=aComponent.Columns.Add;

aHook.PersistentAdded(AddedItem, True);  //this notifies component tree

aHook.SelectOnlyThis(AddedItem);   //this selects added object

  //deleting

   DeletedItem:=aComponent.Columns[aIndex];

 aHook.DeletePersistent(TPersistent(DeletedItem)); //this notifies 
component tree




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).


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Component editors and related

2018-04-25 Thread Vojtěch Čihák via Lazarus

Hi,
 
ad 1: I never tried two level collection. Are they all published (both 
collections and their items)?
 
ad 2: You can do (in your component editor) something like:
 
var aHook: TPropertyEditorHook;
begin
  ...
  aHook:=nil;
      if not GetHook(aHook) then exit;
  ...
  //add or insert:
    AddedItem:=aComponent.Columns.Add;
    aHook.PersistentAdded(AddedItem, True);  //this notifies component tree
    aHook.SelectOnlyThis(AddedItem);   //this selects added object
  //deleting
   DeletedItem:=aComponent.Columns[aIndex];
   aHook.DeletePersistent(TPersistent(DeletedItem));   //this notifies 
component tree
 
V.   
 
__

Od: Werner Pamler via Lazarus 
Komu: Lazarus mailing list 
Datum: 25.04.2018 19:56
Předmět: [Lazarus] Component editors and related


Hi all,

currently I am porting those JVCL components which look interesting to 
me 
(https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/ <https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/>), 
but at the moment I am stuck with the component editor of the 
TJvOutlookBar. This is some kind of two-level vertical menu. The top 
level is a list of TJvOutlookBarPage items, and each page has a list of 
TJvOutlookbarButton items as second level. Both lists inherit from 
TCollection. My problem is that in the component tree of the object 
inspector I see only the page items, but not the button "sub-items". See 
attached screen shot of Lazarus and the Delphi version for comparison. 
How can I make the button subnodes appear in the component tree?


Another problem: The component comes with a ComponentEditor for the 
entire class, which looks similar to that of a TCollection, but contains 
a treeview to display the page-button relationships. After some 
twiddling around I was able to make this work in Lazarus, i.e. when I 
add nodes to the tree in the component editor the corresponding buttons 
or pages are added to the control on the form designer; and when I 
navigate in the component editor's tree the selected object follows in 
the component tree and in the object inspector. But the opposite 
direction does not work:  When I add a page or button in the object 
inspector (by using the Pages and Buttons collection property editors) 
the tree in the component editor is not updated. How can I do this?


Any hints greatly appreciated.
Werner




--

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Component editors and related

2018-04-25 Thread Werner Pamler via Lazarus

Hi all,

currently I am porting those JVCL components which look interesting to 
me 
(https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/), 
but at the moment I am stuck with the component editor of the 
TJvOutlookBar. This is some kind of two-level vertical menu. The top 
level is a list of TJvOutlookBarPage items, and each page has a list of 
TJvOutlookbarButton items as second level. Both lists inherit from 
TCollection. My problem is that in the component tree of the object 
inspector I see only the page items, but not the button "sub-items". See 
attached screen shot of Lazarus and the Delphi version for comparison. 
How can I make the button subnodes appear in the component tree?


Another problem: The component comes with a ComponentEditor for the 
entire class, which looks similar to that of a TCollection, but contains 
a treeview to display the page-button relationships. After some 
twiddling around I was able to make this work in Lazarus, i.e. when I 
add nodes to the tree in the component editor the corresponding buttons 
or pages are added to the control on the form designer; and when I 
navigate in the component editor's tree the selected object follows in 
the component tree and in the object inspector. But the opposite 
direction does not work:  When I add a page or button in the object 
inspector (by using the Pages and Buttons collection property editors) 
the tree in the component editor is not updated. How can I do this?


Any hints greatly appreciated.
Werner


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus