[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-devel
Subject:    [Gambas-devel] Wish: Columnview and other controls as array
From:       ron <ronstk () tiscali ! nl>
Date:       2006-05-13 16:22:44
Message-ID: 200605131822.44850.ronstk () tiscali ! nl
[Download RAW message or body]

From mail 2005-12-27 by Rohnny Stormo/Benoit Minisini
> > This was pitty and makes things more complex.
> >
> > Is it possible to get a couple of function added to the columnview in
> > later versions?
> > Columnview1.item[number].key
> > Columnview1.item[number].selected=true/False
> >
> > or something similar?
> >
> > Regards Rohnny
>
> You can't have two keys for an item, only one. If you want a number to be a
> key, just use it as key.
>
> MyColumnView.Add(number, text, picture...)
>
> What is the problem with that?
>
> --
> Benoit Minisini

How about next:

with MyColumnView
  .left=10
  .top=10
  [0,2].text="hello"  'This can not be done
  [3,2].text="gambas" 'this also not
  .border=border.sunken
end with


with MyColumnView
  .left=10
  .top=10
  MyColumnView[0,2].text="useless using with"
  MyColumnView[3,2].text="more useless for with"
  .border=border.sunken
end with

with MyColumnView
  with [3,2] 'alternative
    .xxx
    .Text="stupid way"
    .yyy
  end with
end with



With the .Item property you can do 
with MyColumnView
  .left=10
  .top=10
  .item[0,2].text="hello"
  .item[3,2].text="gambas2"
  .item[3].SubItem[4].text="gambas4"

  with .Item[3,1]
    .text="how nice"
  end with

  with .Item[1]
    with .SubItem[5]
      .text=Super"
    end with
  end with	

  .border=border.sunken
end with

The example Rohnny Stormo give was a bit wrong
> > Columnview1.item[number].key
> > Columnview1.item[number].selected=true/False
I think he means Columnview1.item[row,column]

This should be then for control objects being accessed as array
   <object>[x  ] equals to <object>.Item[x]
   <object>[x,y] equals to <object>.Item[x,y]
   <object>[key] equals to <object>.Item[key]


With MS-VB you have ListView(row) can also accessed by ListView.item(row)
For the columns
ListView(row).SubItem(column) can accessed by ListView.item(row).SubItem(column)


  vb.ListView.Item(row).SubItem(column).propertymethod
  vb.ListView(row).SubItem(column).propertymethod
  gb.Columnview1.Item[row,column].propertymethod
  gb.Columnview1[row,column].propertymethod
  
And using .Items instead .Item is more correct in my view.
It is a set of Items where .Item suggest you have only one item.

To keep it simple and compatible, allow [x,y] been prefixed with .Item
or just the other way, access the array content as .Item[row,col] and
allow for missing .Item as option.
 
Just my 3 cents

Ron
		


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Gambas-devel mailing list
Gambas-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic