[Gambas-user] ColumnView

Ron Onstenk ronstk at ...239...
Tue Jul 25 01:07:07 CEST 2006


On Tuesday 25 July 2006 00:29, Ron Onstenk wrote:
> On Tuesday 25 July 2006 00:03, javier romero wrote:
> > Hi,
> > 
> > In a proyect i have a columnView with 3 column and 4 "lines" and when opens the 
> > form i selected the first "Item" , i have a button to down the selection, 
> > i try to do that with ColumnView.MoveNext() and ColumnView.Current.MoveNext() 
> > and ColumnView.item.MovNext() but nothing happens, the current.key in all 
> > cases are the first selection, 
> > How i can move the selection to down or up selection or another selection?. 
> > (only itmes or lines, no columns)      
> > 
> > Thanks
> > Javier  
> > 
> 
 Not really clear what you do mean.
 
 You select the first item during open.
 Then press 'button to down'
 Should the highlight (selected) goes 1 down or do you wont the row
 with highlighted goes down?
 
 Columnview uses the Move***() functions to adjust a internal (row) pointer
 The item by that pointer is in .Item
 This Item is not the same as the .Current item.
 The highlight item is the same as the current item.
 
 If you use the Move***() functions then the invisible internal pointer
 is repositioned and not the .Current witch is visible by highlight.
  
 You can set the highlight on different row with

public sub ButtonUp_Click()
  Dim sKey AS String

  ' remove the highlight
  ColumnView.Item.Selected = false 

  ' do the reposition
  IF NOT ColumnView.MovePrevious() THEN
    ' is done, get the key
    sKey = ColumnView.Item.Key

    ' highlight the new item by key
    ColumnView[sKey].Selected = TRUE 
  ENDIF
End


public sub ButtonDown_Click()
  Dim sKey AS String

  ColumnView.Selected = false 
  IF NOT ColumnView.MoveNext() THEN
    sKey = ColumnView.Item.Key
    ColumnView[sKey].Selected = TRUE 
  ENDIF

end











More information about the User mailing list