Recent

Author Topic: [Solved] Property editor not working  (Read 1770 times)

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
[Solved] Property editor not working
« on: August 03, 2019, 04:22:41 am »
Hi, in dev bgracontrols we have this new component, TBCComboBox, that is made with a TBCButton and a TListBox.

https://github.com/bgrabitmap/bgracontrols/blob/dev-bgracontrols/bccombobox.pas

I registered the property editors for the button and the listbox

Code: Pascal  [Select][+][-]
  1. procedure Register;
  2. begin
  3.   RegisterComponents('BGRA Controls', [TBCComboBox]);
  4.   RegisterPropertyEditor(TypeInfo(TListBox),
  5.     TBCComboBox, 'ListBox', TClassPropertyEditor);
  6.   RegisterPropertyEditor(TypeInfo(TBCButton),
  7.     TBCComboBox, 'Button', TClassPropertyEditor);
  8. end;

So now for example I can assign ListBox.Items from the object inspector, then at runtime these get loaded like a normal property does.

I can assign the style for the button too, but in this case then at runtime the default style is shown... what is missing in TBCButton to work like TListBox regarding loading and saving properties from the object inspector?
« Last Edit: August 03, 2019, 07:32:01 pm by lainz »

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Property editor not working
« Reply #1 on: August 03, 2019, 12:41:16 pm »
I don't know what exactly you want to achieve. But don't you register just the standard class property editor here? I think this is not even needed. I also see that "ListBox" and "Button" are public, but for streaming their properties they must be published.

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Property editor not working
« Reply #2 on: August 03, 2019, 07:31:47 pm »
Thanks.

The thing we wanted to achieve was to style the child button from the object inspector.

It was solved publishing the style properties of the Button, instead of publishing the button itself.

 

TinyPortal © 2005-2018