[Gambas-user] Control arrays
Fabien BODARD
Gambasfr at ...11...
Mon Jul 21 17:53:48 CEST 2003
Le Lundi 21 Juillet 2003 04:55, Rob a écrit :
> On Sunday 20 July 2003 22:45, Nelson Ferraz wrote:
> > It would be interesting to treat containers as collections, allowing
> > constructs like:
> > FOR EACH f IN Form
> > PRINT (f.name)
> > NEXT
> > It doesn't seem to work, though.
>
> However, Form inherits Window which inherits Container, and Container has a
> "Children" property.... which I think you can iterate over.
>
> I wonder if I could include an "inherited members" section on each page....
> hmmm.
>
> Rob
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
Hi,
There is another way ...
With this :
Public Image1 as Collection[]
Public Const Zone_Size as Integer = 60
Public Sub New()
Dim i as integer
Dim j as integer
Dim obj as Image
For i = 0 to 2
For j = 0 to 2
Obj = New Image(Me) as "Image1"
Obj.Move (i * Zone_Size, j * Zone_Size, Zone_Size, Zone_Size)
Image1.Add(Obj)
Next
Next
end
So you can Manage the Image properties by :
Image1[3] .Picture = Picture["img/cross.png"]
And the events by :
Public Sub Image1_Click()
End
With gambas we can emulate the vb controle usual use.
Gambas is really today the beginning of a new powered basic implementation, in
the little world of the good programming linguages.
Fabien BODARD
More information about the User
mailing list