[Gambas-user] Gambas Custom Controls - Property as Constant List
Claus Dietrich
claus.dietrich at freenet.de
Sat Dec 12 16:02:38 CET 2020
That's it - works perfect and many thanks for the valuable background on
private and public constants!
Regards, Claus
Am 12.12.20 um 15:19 schrieb Benoît Minisini:
> Le 12/12/2020 à 15:12, Claus Dietrich a écrit :
>> Hi Gianluigi
>>
>> Many thanks, but there seems to be a misunderstanding. My subject is
>> about the general basics of self-made IDE custom controls and how a
>> list of constants can be used to determine one of its properties in
>> the IDE property-list.
>>
>> Meanwhile I managed to get things work with a trial-and-error
>> approach but it is not what I am looking for:
>>
>> 'Gambas class file "Knob"
>> Export
>> ....
>> Public Const StyleStrokes As Integer = 1
>> Public Const StyleScale As Integer = 2
>> ...
>> Public Const _Properties As String =
>> "*,....,*Style{Knob.*}=StyleStrokes" *
>>
>> With this the property "Style" offers both constants (StyleStrokes
>> and StyleScale) in a combo for selection. I have no idea how Gambas
>> figures out the right list items with this method and doesn't grab
>> other constants defined in the class. This somehow contradicts with
>> the wiki (https://gambaswiki.org/wiki/dev/gambas) and I still don't
>> know how to specify _individual constants_.
>
> '{Knob.*}' gets all the -public- constants of the classes. Every
> private symbol disappears at runtime (except in debugging information
> for the debugger), only public symbols remain in the executable.
>
> To get constants explictly, use '{Knob.Constant1;Constant2;...}'
>
> You can look at the Gambas source code of the GUI controls to get some
> examples.
>
> Regards,
>
More information about the User
mailing list