[Gambas-user] Custom controls, Non-String arrays in the IDE

Benoit Minisini benoit.minisini at gambas-basic.org
Wed Aug 17 14:18:34 CEST 2022


Le 17/08/2022 à 13:42, Bruce Steers a écrit :
> 
>             Let's put the usefullness of flashy gradient buttons aside.
>             What you
>             would need is actually a brush, not a gradient. The gradient
>             is just a
>             particular case of a brush.
> 
>             And editing a brush (or any other complex property) in the
>             form editor
>             needs:
> 
> 
> oh my god you're right. and right about the ReportBrush too.
> Sorry i didn't get it at first.
> 
> I can just use a string value set to use {ReportBrush} type and there is 
> everything i needed in a string that I can easily work with. don't even 
> need to add gb.report.
> 
> Awesome :)
> Respects.
> BruceS
> 

It's not enough. The problem is that you must understand how property 
values are stored in and retrieved from form files.

"ReportBrush" is not just the way the property is chosen in the form 
editor, it's also which code is generated in the form file to initialize 
the property. You can't reuse it directly.

For complex objects like brushes, you usually need an equivalent object 
in the component. For example, properties with "ReportBrush" kind uses 
the 'ReportBrush[]' array method of the gb.report(2) component.

That logic is located in the 'CControl.GetEachProperty()' method.

Regards,

-- 
Benoît Minisini.


More information about the User mailing list