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

Claus Dietrich claus.dietrich at freenet.de
Sat Dec 12 15:12:20 CET 2020


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_.

Have a good weekend.

Claus


Am 11.12.20 um 23:08 schrieb Gianluigi:
>
>
> Il giorno ven 11 dic 2020 alle ore 22:39 Claus Dietrich
> <claus.dietrich at freenet.de <mailto:claus.dietrich at freenet.de>> ha scritto:
>
>     Hi
>
>     I recently wrote a number of custom user controls (visible in the
>     IDE) and bumbed into the problem, that I couldn't make the IDE to
>     offer a list of declared constants (here "StyleStrokes" and
>     "StyleScale") under a custom control property (here "Style").
>
>     As I didn't clearly understand the chapter "/Constant lists/" in
>     the wiki, my temporary solution consists of a range definition
>     (Style{Range:1;2}=1).
>
>     Name of my Custom Control Class: Knob
>
>     Export
>     ....
>     Public Const StyleStrokes As Integer = 1
>     Public Const StyleScale As Integer = 2
>     ...
>     Public Const _Properties As String = "*,....,Style{Range:1;2}=1"
>
>     Any attempt failed to get a combo with said constants and I
>     particularly didn't know how to read the sentence in the wiki
>     saying "..... you can specify a class instead ....". What you mean
>     by "can" and does it have to be a separate class? Any detail for
>     the required syntax and instructions beyond the wiki would be much
>     appreciated.
>
>     Best regards
>
>     Claus
>
>
> Hello,
>
> You can check out this thread:
> https://lists.gambas-basic.org/pipermail/user/2020-September/070075.html
>
> Regards & Good Night
> Gianluigi
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201212/f8c82e1d/attachment.htm>


More information about the User mailing list