[Gambas-user] Gambas Custom Controls - Property as Constant List

Benoît Minisini g4mba5 at gmail.com
Sat Dec 12 15:19:50 CET 2020


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,

-- 
Benoît Minisini


More information about the User mailing list