[Gambas-devel] About Gambas components

ron ronstk at ...124...
Tue May 9 05:15:07 CEST 2006


On Saturday 06 May 2006 15:11, fabien Bodard wrote:
> Hi,
> 
> This a purpose about the gambas compenent localisation.
> 
> I think it will be interesting and usefull to have the possibility to the 
> interpreter to use components contained in a userspace folder 
> like /home/user/.gambas/libs for exemple. This way programs can have 
> components flexibilities but not the need to be installed in root. This way i 
> can debug gambas components more easily. I think maybe this component need to 
> have a spécific implementation in the userspace naming.. Because of the risk 
> to have double in names. So for user components mabe the usin of a new 
> userspacekey will be usefull... or better the need of use of the libname.
> 
> This way beginners can make there own components, but not implements them in 
> the project tree if a component is good and usefull then it can be 
> implemented in it.
> 
> MyLibName.Class.Property
> 
> I now this is more long to type but ... in a short time we will have problem 
> with classes names.
> 
> Regards,
> Fabien Bodard
> 
> 
First of all, I agree with meanng of above message. (if it counts anyway :) )

I have seen that problem already with the SDL Component.
There have been and/or is a gb.sdl.Timer. gb.qt.Timer and gb.Timer.
The last one is a kind of control in lib 'gb' where the data types are. ??
 
What you mean Fabien with 'userspacekey' is simple the 'namespace'.
It is used at many places in programming so if we start with something 
like this let call it 'namespace'.

So it is not new as idea but it is late for gambas to implement.
As I have seen is gambas flexible enough but it will be a major
change so it will be gambas3 when implement, i gues, is done and 
gambas2 isn't released yet :)
Poor Benoit, he will do all on his own without public CVS or SVN

Some stuf from my mind now based on my history with VB.
You may skip but...

public sub dosomething( sText as string, tbx as TextBox)

The Textbox is the standard textbox from VB or gb.(qt|gtk)
The namespace in case of VB is mscomctl, for gambas gb.qt or gb.gtk
  public sub dosomething( sText as string, tbx as mscomctl.TextBox)
  public sub dosomething( sText as string, tbx as gb.qt.TextBox)
  public sub dosomething( sText as string, tbx as gb.gtk.TextBox)
and in future (?)
  public sub dosomething( sText as string, tbx as gb.ncurses.TextBox)
  public sub dosomething( sText as string, tbx as gb.tk.TextBox)
  public sub dosomething( sText as string, tbx as gb.wm.TextBox)

For gambas fabianscontrols.lib
  public sub dosomething( sText as string, tbx as gb.fabianscontrols.TextBox)

Using a extern component as i.e fabianscontrols.ocx with VB. Then you do
  public sub dosomething( sText as string, tbx as fabianscontrols.TextBox)

Of course in the ocx is a userfriendly name for the namespace instead of 
the stupid long ocx file name :)
This is all stored in the registry in the typelib/interface section.
together with the stuf from the *.info files as gambas is using.

The first thing that should be posible is using the dotted component
identification usable in the editor (with completion) and interpreter.
That means I must be able to make a function like:

  function ronlikegambas(tv as gb.qt.TreeView, dia as gb.qt.kde.Dialog) as gb.db.Result
instead of 
  function ronlikegambas(tv as TreeView, dia as Dialog) as Result

At this moment making usercontrols into gb.form with common used names for
such control is not posible by naming collision with other components libraries.
Every item in a component library must have a *global* unique name for gambas.
Once a class(TextBox) exist no one can make it in his own component.

note: 
from help 'gb.qt.kde.dialog implements Dialog in gb.gtk'
I remember it was 'gb.qt.kde.dialog' re-implements Dialog in 'gb.qt'
This gb.qt.dialog however is not mentioned now.

To make it more unique the component lib name must be add.
And even then it can happen you give your mail component th name gb.mail 
and i give it the same name without knowwing you have it already.
That is the reason for the CLSID that MS is using. 
No bad at all, because this CLSID is when proper created realy 
unique, the MAC of the network card is part of it.

In that way is VB not so crazy as many people say.

The question is now, is gambas strong enough to add namespace prefix to the
class/object names like gb.qt.TextBox and gb.form.SidePanel or in short 
qt.TextBox and gtk.ListBox ?
For the places it is not given the current components are searched in order
to get the correct one. This ordering does not exists at the moment,
as the user can not influence them now.

The order for gb.mail, as previous given, is in Fabians case his gb.mail 
then my gb.mail and I can swap those to get my gb.mail.
this is because my send method is better then his and by higher priority
in the order my modified gb.mail.send is used and other not implemented
functions are then from gb.mail from Fabien.


I say cheese :)

Ron





More information about the Devel mailing list