[Gambas-devel] About property declaration in components

Benoit Minisini gambas at ...1...
Thu Aug 24 23:20:10 CEST 2006


On Thursday 24 August 2006 23:07, Laurent Carlier wrote:
> Le jeudi 24 août 2006 22:41, Benoit Minisini a écrit :
> > The way of declaring the list of the possible values of a property has
> > changed!
> >
> > The old way was:
> >
> > GB_PROPERTY("PropertyName", "i<Class,FirstValue,SecondValue...>",
> > PropertyFunction)
> >
> > Now, everything must be put in the "_Properties" string constant declared
> > in the class.
> >
> > The new syntax of this hidden property is:
> >
> > _Properties = "<PROP1>,<PROP2>,...,<PROPn>"
> >
> > <PROPi> =  "-<NAME>"
> >            or "<NAME>{<TYPE>}=<DEFAULT>"
> >
> > <NAME> is the name of the property.
> >
> > <DEFAULT> is the default value of the property. It must be preceded by an
> > equal sign.
> >
> > <TYPE> is the type of the property. It must be between { }. It is used by
> > the IDE property sheet.
> >
> > The <DEFAULT> and <TYPE> are optional.
> >
> > If <TYPE> is missing, then the type of the property is determined from
> > the Gambas property type declared with the GB_PROPERTY macro. The IDE
> > property sheet can deal with Font, Picture, String[] and all native types
> > properties at the moment.
> >
> > Otherwise, the syntax of <TYPE> is the following:
> >
> > - "<CLASS>.*" or "<CLASS>.<CONST1>;<CONST2>;...;<CONSTn>" for an integer
> > property that can take only one value among a predefined list of
> > constants.
> >
> > Note that in this case, the <DEFAULT> value must be the name of the
> > constant, and not its integer value.
> >
> > Or <TYPE> can be:
> >
> > - "Path" for a string property that is a file path.
> >
> > - "Color" for an integer property that is a color.
> >
> > - "Range:Min;Max" for an integer property whose value must be between Min
> > and Max.
> >
> > Other types will be implemented in the future.
> >
> > Regards,
>
> It should be good if "prelease" be available to move components to the new
> property style.
>
> Otherwise stuff like range seem to be nice :)
>
> Regards,
>

The old method is deprecated, but keep being understood by the IDE if the new 
method is not used.

Otherwise the next release will break many things in the gb.qt component, so 
the 1.9.40 could be considered as a "pre-release". :-)

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list