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

Bruce Steers bsteers4 at gmail.com
Mon Aug 15 10:13:06 CEST 2022

On Wed, 10 Aug 2022 at 15:26, Benoit Minisini <
benoit.minisini at gambas-basic.org> wrote:


> > Could you implement Array type? like my first idea of using the existing
> > String[] editor to edit then converting the strings to respective types?
> > And possibly a more complicated Color[] type to set multiple colors?
> > Dang, in my head this just got a lot more complicated :-\
> >
> >
> > Many thanks
> > BruceS
> >
> 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:
> 1) An IDE internal string representation of the property.
> 2) A method in the Gambas component that converts that string into the
> real object, making that internal string representation part of the
> public API.
> 3) The corresponding property editor in the IDE.
> 4) The code that deals with the property kind in the form loading
> routine, saving routine, setting and getting property routines.
> If you don't understand, look how the Font property kind is handled.
> Implementing all that is not a five minutes job (hopefully the brush
> editor already exists in some way for the Report forms), and I usually
> do it when it's really useful. Anyway I can't do it now.

I had a better idea (much simpler)

There i have added a popup menu to the lstValue listbox that lets you run
various choosers for colors (string or integer) , fonts,  pictures and
file/dir paths. (all i could think of would be useful)

It seemed a much easier solution and fixes my needs :)

Not sure if popup menu was the best way to implement it but works cool,

Only downside is you cannot see the actual colors just the strings but
that's okay.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220815/7a30ff02/attachment.htm>

More information about the User mailing list