[Gambas-user] Developing a gambas component using gambas.

Benoit Minisini gambas at ...1...
Tue Oct 11 15:48:54 CEST 2005


On Tuesday 11 October 2005 08:59, Dani Santos wrote:
> Let's see. I may have no understood the previous Mail...
>
> El lun, 10-10-2005 a las 13:04 +0200, Benoit Minisini escribió:
> > On Monday 10 October 2005 08:40, Dani Santos wrote:
> > > Thanks Benoit. I thought that the creation of gambas-based components
> > > was more dynamic.
> >
> > More dynamic in which way?
>
> You say icons are hard-coded in the IDE 

Yes. This is bad design, but this is not important while only the IDE needs 
these icons.

> and that the component must be 
> inserted in the comp directory in the source tree.

Yes. Like drivers in the Linux kernel source tree.

>
> I thought that I could develop a component an add it to the code of my
> project as, for example, a form or a class (in the same way I did in
> VB), or compile it and add a Reference to the compiled component in my
> project so it can use it.
>
> In other words: let's suposse that I want a component which consists in
> a label that displays its text in red forecolor; let's suposse that it
> is of vital importance to me :-) , but a complete nonsense to other
> programmers. I thought that there was an easy way to make a component
> like that and add it to my project.
>

You make a component if you aim to share somethings between different gambas 
projects.

You can take all the classes of your component and put it in your project if 
you want. It will work the same, provided that there is no name clash.

The only difference is that a component has its own name space. Only the 
classes marked with the EXPORT keyword are in the global name space. All 
other classes are hidden.

> > > The component I am developing will reproduce one ActiveX Component that
> > > I used in my VB programmer days to easy the development of the
> > > applications but I'm not sure if it will be useful for other.
> >
> > What does your component do?
>
> In my VB programmer days, I developed VB applications against M$ Access
> Databases. Most of the forms of the applications I developed consisted
> in formularies that recolected data from the user and most of the
> controls of the applications had common needs; i mean:
>
> - TextBoxes that took only numeric values (integer or float).
> - TextBoxes that took only upper-case values.
> - TextBoxes that took only Valid DNI Numbers (Spanish Identification
> Cards).
> - TextBoxes with a search-button that showed a grid with posible values.
> - etc, etc.
>
> Those controls also had the same behaviour: "Enter" tabbed to the
> following control, if you clicked with the mouse on it, the whole text
> of the TextBox was selected, etc.
>
> It was the same code in the same events all the time so we developed a
> simple control that once it was correctly initilized it easied a lot the
> development of the application.
>
> That's what I'm doing just now (in a very alpha version ;) ).
>

That seems very useful to put that in a component (except the Spanish 
Identification Card that may be too specific). Send me your code when it is 
stable, and I will take some controls to put them in the gb.form component 
(for example, or in another one I don't know)

Anyway, I plan to make a 'per-user' component directory so that one can 
install gambas component without having to touch the one installed in the 
gambas installation directory.

The next IDE will be able to make RPMs from a component project, so that you 
can install a program like you want by installing only two RPMs (one for the 
project, and one for the component).

> > > I think I will follow programming my app without that component but I
> > > will code all the logic of the component into a class so it will be
> > > easy to create the component if people find it useful.
> > >
> > > Regards.
> >
> > Regards,
>
> I'm currently starting to develop an application that, firstly, will
> complement the application we use to control the library of the High
> School I work at (its a widows app)  and later substitute it (or so I
> hope ;) ).
>
>
> Regards and thank you very much for your interest.

Regards,

-- 
Benoit Minisini





More information about the User mailing list