Developing a gambas component using gambas.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Developing a gambas component using gambas.

jose.santos-2
Hi all.

I'm trying to make a gambas component using gambas (C/C+ is too much to
me).

I followed J.L. Redrejo advices and donloaded the gambas-gb-form source
code to see how is it built. I have made several progress but I've got
some questions to make:

- ¿How do I asign the icon that is shown in the gambas-toolbox to my
gambas component?
- ¿How can I have a preview of the control I'm making in design-time? I
mean with this that I only see a slashed rectangle, but I don't see the
components it is made with. For instance, if I use the gb.form component
in a application and I put a ColorChooser component in a form, I can see
how it is perfectly with all it's controls, but not so with my
component.

Finally, this is the script I use to add my component to the list of
components of gambas. It's only for the test phase. ¿Is it correct? ¿Is
there a betterway?
daniel@programador:~/srcGambas/gb.dycontrols$ cat instala-componente.sh
#!/bin/sh

case $1 in
   -a)
      cp -vf gb.dycontrols/gb.dycontrols.* /usr/lib/gambas2
      chmod 644 /usr/lib/gambas2/gb.dycontrols.component
      chmod 755 /usr/lib/gambas2/gb.dycontrols.gambas
      cp -vf
gb.dycontrols/.info /usr/share/gambas2/info/gb.dycontrols.info
      cp -vf
gb.dycontrols/.list /usr/share/gambas2/info/gb.dycontrols.list
      break;;
   -d)
      rm -vf /usr/lib/gambas2/gb.dycontrols.component
      rm -vf /usr/lib/gambas2/gb.dycontrols.gambas
      rm -vf /usr/share/gambas2/info/gb.dycontrols.info
      rm -vf /usr/share/gambas2/info/gb.dycontrols.list
      break;;
esac

NOTES:
- You must be logged as root to use the script:
- ./instala-componente.sh -a -> Installs the component.
- ./instala-componente.sh -d -> Removes the component.


Regards.



--
José Daniel Santos Delgado
Programador del IESO Quercus (Malpartida de Plasencia)
http://iesoquercus.juntaextremadura.net/dani/
Tfno: 927010850         Fax: 927010851



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Developing a gambas component using gambas.

Benoît Minisini
On Tuesday 04 October 2005 13:01, Dani Santos wrote:
> Hi all.

Hi,

>
> I'm trying to make a gambas component using gambas (C/C+ is too much to
> me).

So you should write this mail on the devel mailing-list...

>
> I followed J.L. Redrejo advices and donloaded the gambas-gb-form source
> code to see how is it built. I have made several progress but I've got
> some questions to make:
>
> - ¿How do I asign the icon that is shown in the gambas-toolbox to my
> gambas component?

The icons are hard-coded in the IDE at the moment. They should be put outside,
in a directory like /usr/share/gambas2/controls for example.

> - ¿How can I have a preview of the control I'm making in design-time? I
> mean with this that I only see a slashed rectangle, but I don't see the
> components it is made with. For instance, if I use the gb.form component
> in a application and I put a ColorChooser component in a form, I can see
> how it is perfectly with all it's controls, but not so with my
> component.

You can see a preview only if the IDE uses the component the control belongs
to. Otherwise, you only see a dashed frame. So if your component is not
gb.qt, gb.form or gb.qt.ext, you will never see it!

I'm thinking about a way to specify a standard gb.qt control for drawing the
real control, with a "_DrawWith" property or something like that.

>
> Finally, this is the script I use to add my component to the list of
> components of gambas. It's only for the test phase. ¿Is it correct? ¿Is
> there a betterway?
> daniel@programador:~/srcGambas/gb.dycontrols$ cat instala-componente.sh
> #!/bin/sh
>
> case $1 in
>    -a)
>       cp -vf gb.dycontrols/gb.dycontrols.* /usr/lib/gambas2
>       chmod 644 /usr/lib/gambas2/gb.dycontrols.component
>       chmod 755 /usr/lib/gambas2/gb.dycontrols.gambas
>       cp -vf
> gb.dycontrols/.info /usr/share/gambas2/info/gb.dycontrols.info
>       cp -vf
> gb.dycontrols/.list /usr/share/gambas2/info/gb.dycontrols.list
>       break;;
>    -d)
>       rm -vf /usr/lib/gambas2/gb.dycontrols.component
>       rm -vf /usr/lib/gambas2/gb.dycontrols.gambas
>       rm -vf /usr/share/gambas2/info/gb.dycontrols.info
>       rm -vf /usr/share/gambas2/info/gb.dycontrols.list
>       break;;
> esac
>
> NOTES:
> - You must be logged as root to use the script:
> - ./instala-componente.sh -a -> Installs the component.
> - ./instala-componente.sh -d -> Removes the component.
>

You can't do that. Components written in Gambas must be inserted into the
'comp' directory inside the source tree, and you must update the ORDER file
in it, to tell which order must be used when compiling these components.

So when your component is finished, send it me and I will add it into the main
source tree. Like other components written in C/C++.

I didn't have the time to document all that yet... Sorry :-)

>
> Regards.

Regards,

--
Benoit Minisini



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Developing a gambas component using gambas.

jose.santos-2
Thanks Benoit. I thought that the creation of gambas-based components
was more dynamic.

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.

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.




El mié, 05-10-2005 a las 21:45 +0200, Benoit Minisini escribió:

> On Tuesday 04 October 2005 13:01, Dani Santos wrote:
> > Hi all.
>
> Hi,
>
> >
> > I'm trying to make a gambas component using gambas (C/C+ is too much to
> > me).
>
> So you should write this mail on the devel mailing-list...
>
> >
> > I followed J.L. Redrejo advices and donloaded the gambas-gb-form source
> > code to see how is it built. I have made several progress but I've got
> > some questions to make:
> >
> > - ¿How do I asign the icon that is shown in the gambas-toolbox to my
> > gambas component?
>
> The icons are hard-coded in the IDE at the moment. They should be put outside,
> in a directory like /usr/share/gambas2/controls for example.
>
> > - ¿How can I have a preview of the control I'm making in design-time? I
> > mean with this that I only see a slashed rectangle, but I don't see the
> > components it is made with. For instance, if I use the gb.form component
> > in a application and I put a ColorChooser component in a form, I can see
> > how it is perfectly with all it's controls, but not so with my
> > component.
>
> You can see a preview only if the IDE uses the component the control belongs
> to. Otherwise, you only see a dashed frame. So if your component is not
> gb.qt, gb.form or gb.qt.ext, you will never see it!
>
> I'm thinking about a way to specify a standard gb.qt control for drawing the
> real control, with a "_DrawWith" property or something like that.
>
> >
> > Finally, this is the script I use to add my component to the list of
> > components of gambas. It's only for the test phase. ¿Is it correct? ¿Is
> > there a betterway?
> > daniel@programador:~/srcGambas/gb.dycontrols$ cat instala-componente.sh
> > #!/bin/sh
> >
> > case $1 in
> >    -a)
> >       cp -vf gb.dycontrols/gb.dycontrols.* /usr/lib/gambas2
> >       chmod 644 /usr/lib/gambas2/gb.dycontrols.component
> >       chmod 755 /usr/lib/gambas2/gb.dycontrols.gambas
> >       cp -vf
> > gb.dycontrols/.info /usr/share/gambas2/info/gb.dycontrols.info
> >       cp -vf
> > gb.dycontrols/.list /usr/share/gambas2/info/gb.dycontrols.list
> >       break;;
> >    -d)
> >       rm -vf /usr/lib/gambas2/gb.dycontrols.component
> >       rm -vf /usr/lib/gambas2/gb.dycontrols.gambas
> >       rm -vf /usr/share/gambas2/info/gb.dycontrols.info
> >       rm -vf /usr/share/gambas2/info/gb.dycontrols.list
> >       break;;
> > esac
> >
> > NOTES:
> > - You must be logged as root to use the script:
> > - ./instala-componente.sh -a -> Installs the component.
> > - ./instala-componente.sh -d -> Removes the component.
> >
>
> You can't do that. Components written in Gambas must be inserted into the
> 'comp' directory inside the source tree, and you must update the ORDER file
> in it, to tell which order must be used when compiling these components.
>
> So when your component is finished, send it me and I will add it into the main
> source tree. Like other components written in C/C++.
>
> I didn't have the time to document all that yet... Sorry :-)
>
> >
> > Regards.
>
> Regards,
>
--
José Daniel Santos Delgado
Programador del IESO Quercus (Malpartida de Plasencia)
http://iesoquercus.juntaextremadura.net/dani/
Tfno: 927010850         Fax: 927010851



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Developing a gambas component using gambas.

Benoît Minisini
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?

>
> 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?

>
> 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,

--
Benoit Minisini



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Developing a gambas component using gambas.

jose.santos-2
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 and that the component must be
inserted in the comp directory in the 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.


>
> >
> > 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 ;) ).




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

--
José Daniel Santos Delgado
Programador del IESO Quercus (Malpartida de Plasencia)
http://iesoquercus.juntaextremadura.net/dani/
Tfno: 927010850         Fax: 927010851



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Developing a gambas component using gambas.

Benoît Minisini
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



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...