[Gambas-user] How do i use columnview.MoveBelow() ?

Benoit Minisini gambas at ...1...
Mon Mar 29 13:27:06 CEST 2004


On Sunday 28 March 2004 16:28, ron wrote:
> On Sunday 28 March 2004 11:21, Benoit Minisini wrote:
> > On Sunday 28 March 2004 05:20, ron wrote:
> > > I still can't get  it working
> > >
> > > in a list of 10 items the 4' is selected.
> > > I want in code move to the item below with
> > >
> > > ColumnView1.MoveBelow()
> > >
> > > but nothing happens
> > >
> > > Pleas help
> > >
> > > Ron
> >
> > The Move*() methods move the INTERNAL cursor of the control.
> >
> > So, to select the item below:
> >
> > ColumnView1.MoveCurrent()
> > ColumnView1.MoveBelow()
> > ColumnView1.Item.Selected = TRUE
> >
> > Regards,
>
> Arrrg, I got it partial now.
> My example works now after add the the item.selected=true
>
> But this is not as I expected, need or had in mind.
>
> In msVB the treeview is in that way better then QT version
> or you did not implement if it can done.

No, the QT TreeView is far better than the msVB one. And the way I implemented 
it is just different because I wanted to avoid creating useless objects for 
each tree node. Try to fill a treeview with thousands of nodes in Vb and in 
Gambas, and then compare.

>
> The internal cursor is at a node/leaf, I must know the key of the
> parent. in VB you can you use pKey= TreeView1.Parent.key
> Or if you are at the 3 level pKey=TV.Parent.Parent.Key
> Here the Parent delivers the .TreeViewItem virtual class
>
> In Gambas the .Current should refer to the selected and hightight
> node and .Item reflect the node of the internal pointer.
> It does that regarding the help browser.

Thsi is true. But when you use .Current, then the internal pointer is moved to 
the current node.

> With the move*() the internal pointer walks in the tree, also in the help
>
> Then I expected after the Move*() the .Item reflects that node and I
> can read the key/text of it and not I must use the .Item.Selected

It works like that!

>
> If this worked you can analize what is in the tree without disrupting
> the view the user had with the selected node.
> You can show in a textbox the key/text of the child nodes
>
> My point is, that I  must use the item.select to get the node data
> I moved to, and the user cursor follows that.
>
> Is there a way the .Item follows the internal pointer without the
>  .Selected is set ?

I really don't understand your point.

>
> In VB the .Parent gives a tree part where the parent is like the root
> .Children[1] does the same for that child i.e. .Children[1].Key.
>
>
> I'm a bit sad now. :(
>
> Ron
>

Gambas thinks are not exactly like VB things! :-)

- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list