[Gambas-devel] gb.form.mda-0.2.tar.gz

Benoit Minisini gambas at ...1...
Tue Aug 1 19:15:43 CEST 2006


On Tuesday 01 August 2006 18:46, Ron Onstenk wrote:
> On Tuesday 01 August 2006 13:38, Fabien Bodard wrote:
> > it is very confusing as ron talk about an object and .container is not an
> > object but a parent clas that give to an object some properties.
>
> Explain?
> I did mean 'Container' and not '.container', that are different things.
>
> A Frame ('gb.qt.Frame') inherits the 'gb.qt.Container' and there is no
> Frame.container but there is a Frame.Children and this in the help lead to
>
> Container.Children (gb.qt)
> Syntax
> PROPERTY READ Children AS .ContainerChildren

I don't know what you are looking for. The Children property is just for 
enumerating the controls that are children of a container.

>
> So the named 'Frame.Children' is in real 'Frame.container' and is actual
> 'gb.qt.Container.Children' Looks to me as name mangle and very confussing.

"gb.qt.Frame" or "gb.qt.Container": all this notation means nothing in Gambas. 
A component is not a name space. 

There is only one name space for classes in Gambas, the "global" name space. 

I said "global", because actually there is a "private" class name space too 
for components written in Gambas.

All classes declared with "EXPORT" in a component written in Gambas are 
inserted into the global name space. The other classes are invisible for the 
other components and for the project using these components.

I think you are mixing up many things in your head :-) Class names, method 
names, component names...

>
> My code idea is next example:
>
> Sub Add(hForm as form,bResize as boolean)
>   ' add Feditor as hForm in next sub in container with buttons and more.
>
>   MyWin = New Container(Scrollview1)
>   MyTitle = New Label(MyWin)
>   MySubForm = New Form(MyWin)
>
>   ' the hForm should be placed in the place of MySubForm
>   ' How? The help does not tell it for Reparent
>
>   ' Control.Reparent (gb.qt)
>   ' What is Control?

As written in the help, Control is the class that every control (i.e. widget) 
inherits.

As Form inherits Container, that inherits Control, forms have a Reparent 
method too.

>   ' Here the reason I talk about 'Object'
>
>   ' The help should say <Object>.Reparent (gb.qt) 

No. Reparent is a method of the Control class, so it is named 
'Control.Reparent'.

>   while 
>   ' the object is the thingy (object) having .Reparent and that is Form
>   ' in this case but could also be 'ListView' and that is well known as
>   ' Control and 'Form' is the container for those controls.
>
>   ' Beside of that in the help "This class inherits Window" and not
>   ' "This class inherits Control" so .Reparent can't on a Form or
>   ' Control.Reparent is wrong and should be <thingy>.Reparent
>   ' Fabian does not understand the object as pointer to thingy :) (smile)

If A inherits B, and B inherits C, then A has all the methods of B *and* C. 
Inheritance is a transitive relation in OOP.

>
>   ' Roulette to get the correct one
>   hForm.Reparent(hForm as MySubForm,0, myTitle.Height)
>   ' or
>   hForm.Reparent(MySubForm as hForm,0, myTitle.Height)
>   ' or
>   MySubForm.Reparent(hForm as MySubForm,0, myTitle.Height)
>   ' or
>   MySubForm.Reparent(MySubForm as hForm,0, myTitle.Height)
>
>   ' add buttons and etc
>   ....
>   ' place all at right place and size
>   ....
>   'done
> END
>
> Anyway the help say for Container 'This class is not creat(e)able '
> and then I can't use it. :(
>
>
> I give up, Benoit please tell me what should I use as container.

What you want: Panel, ScrollView, HBox... I suggest you look in the 
gb.form.mdi source code. If you open it in the IDE, you can use the FMain 
form as test, and follow the execution of gb.form.mdi classes step by step.

>
>
> Ron
>
> PS
> I wish we had a object hierarchy of the controls
> http://doc.trolltech.com/3.3/classchart.html
> http://doc.trolltech.com/extras/qt41-class-chart.pdf
> ftp://ftp.trolltech.com/qt/pdf/qt33-class-chart.pdf
>
> Same for the Database Component.
> http://www.info-3000.com/access/daoreferencecomplete.php
> Just to get the idea.
>

I had this idea too.

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list