[Gambas-user] Re; Adding new components

Benoit Minisini gambas at ...1...
Tue Sep 25 14:52:03 CEST 2007


On mardi 25 septembre 2007, Gareth Bult wrote:
> Hi,
>
> I'm looking for a quick how to on the following;
>
> a. Setting the Icon for a gambas control.
> Essentially I have extended gb.db.form and added a component called
> "DataLink" I would like to embed an icon for this in the IDE, how / where
> do I put it ?

The icons are stored inside the /img/control directory of the IDE source code.

Of course, they should be stored outside of the IDE source code somewhere 
in /usr/share/gambas2. Maybe I will do that after the release candidate.

>
> b. For the above control, one of the fields is "type" and can have the
> value "MySQL,Postgress,SQLite etc.." How do I make the IDE display this as
> a combo as opposed to a string ?

Every property is described in the "_Properties" special constant of a 
control.

To see what I mean, open the following gambas source 
file: /trunk/gb.qt/share/gb.form.properties.h

You will see all the _Properties values of all controls defined in gb.qt (and 
gb.gtk).

The syntax of this string is the following:

<_Properties string> :=
"<property>,<property>,...,<property>"

<property> :=
<property name> |
<property name>{<property type>} |
<property name>=<default value> |
<property name>{<property type>}=<default value>

<property type> :=
Position |
Dimension |
Range:<minimum>;<maximum> |
Color |
Font |
<enumeration>

<enumeration> :=
<class name>.* |
<class name>.<constant>;<constant>;...;<constant>

'Position' & 'Dimension' are for the X,Y,W,H properties.

'Range' displays a spin box.

'Color' displays the color chooser, and 'Font' the font chooser.

Enumerations can be all public constants of a class, or some of them.

If no property type is specified, the datatype of the property value is used.

At the moment, the IDE does not support properties returning an object, except 
Font.

I hope this is more clear now :-)

Regards,

-- 
Benoit Minisini




More information about the User mailing list