[Gambas-user] Re; Adding new components

Gareth Bult gareth at ...1689...
Tue Sep 25 17:38:27 CEST 2007


Ok,

Clear yes, working no.

It "seems" that I can only use pre-programmed constants and now user-defined constants .. ?

This works;

PUBLIC CONST _Properties AS String = "*,Host,Type{Select.None;Select.Single;Select.Multiple}=None,User,Password,Database"

This does not;

PUBLIC CONST _Properties AS String = "*,Host,Type{DataTypes.None;MYSQL;ODBC}=None,User,Password,Database"

With DataTypes.class as;

PUBLIC CONST MYSQL AS String = "mysql"
PUBLIC CONST ODBC AS String = "odbc"

What am I doing wrong ?

Gareth.

--
Managing Director, Encryptec Limited
Tel: 0845 25 77033, Mob: 07891 389657
Email: gareth at ...1689... 
Statements made are at all times subject to Encryptec's Terms and Conditions of Business, which are available upon request.

----- Original Message -----
From: "Benoit Minisini" <gambas at ...1...>
To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
Sent: Tuesday, September 25, 2007 1:52:03 PM (GMT) Europe/London
Subject: Re: [Gambas-user] Re; Adding new components

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list