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

Bruce Steers bsteers4 at gmail.com
Wed Aug 10 14:13:48 CEST 2022


On Wed, 10 Aug 2022 at 11:53, Bruce Steers <bsteers4 at gmail.com> wrote:

> You know how you can put the following in a custom control..
>
> *Public Const _Properties As String = "*,StringArray"*
>
> *Property StringArray As String[] Use $aStringArray*
>
> Then in the IDE form designer you'll get the StringArray property and get
> an editor to insert strings to the list.
>
> If i use ANY other type like Integer[] or Float[] then it does not work
> the same. i just get a combobox with "none" to select, and if i do select
> none i then have to manually edit the .form file to remove the def as it
> raises an error.
>
> Could the form designer also handle other types?
> Integer[] and Float[] shouldn't be too hard to handle.
> The existing string[] editor could be used then the items converted to
> their respective type array.
>
> Would open up a few things for me.
>
> I'm trying to add gradients to a control and want to handle the Colors[]
> and StopPoints[] in the IDE
>
> Can some method be added to a Custom control class that the IDE can use to
> pop up our own editor window ?
> Something like this maybe?..
>
> *Public Const _Properties As String = "*,IntegerArray{IntList()}"*
>
> *Private Sub IntList() As Integer[]*
>
> *  FGetIntegers.ShowModal()*
>
> *  Return FGetIntegers.List*
>
> *End*
>
> then FIntegers pops open my own list editor
>
> Is something like this already possible ?
>
> Respects
> BruceS
>

I'm thinking my second idea of letting us create a custom property editor
window that could return any type required would be a lot more useful than
just making Integer[] Float[] also work in the form designer.
Possibly even less code as you'd just have to check for () in the
_Properties def "*, MyPropertyName{type_is_method()}" then set the property
edit button in the IDE to run the method and pass it's return data straight
to the property.

Hmm, When i put it that way it does sound like a fairly simple addition.  I
might just have a browse through the IDE code and see if i can find the way.

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220810/b24bbd37/attachment.htm>


More information about the User mailing list