[Gambas-user] IDE feature request: viewing collection-like objects

Benoît Minisini gambas at ...1...
Sat Mar 10 18:33:29 CET 2012


Le 05/03/2012 04:25, Ian Haywood a écrit :
> Benoit,
>
> some time also we had a discussion about Collection semantics. In Gambas
> setting the member of a Collection to NULL is the same as deleting it. I
> am not trying to re-open this debate, I accept the decision and have
> written a class with the semantics Richard and I want: it can have NULL
> members, see cRow attached.

I hope so. Between you writing a one-hundred lines class and me having 
to rewrite the IDE, the components, and my job's big project, the choice 
was fast. :-)

> (It also has some database stuff which is very specific to our
> application. please ignore that)
> It uses _get and _put so it works like a Collection
>
> Problem is, in the IDE it's an object and it is not possible to see the
> members like a Collection.
>
> So to my question: is it possible to extend the IDE so that when
> displaying an object that overrides _get, _put and _next it displays it
> like a Collection does?
>
> Ian
>

I think it would be possible even if it is some work.

I would have to assume that:

- If there is a _get() method that takes an integer, and if there is a 
Count property, then I can display the object like an array.

- If there is a _get() method that takes a string, if there is a Count 
property, and if there is a Keys property that returns all keys in the 
object, OR both a _next() method and a Key property that returns the key 
of the last read value, then I can display the object like a collection.

What do you think about that?

-- 
Benoît Minisini




More information about the User mailing list