[Gambas-user] TableView Update

ron ronstk at ...239...
Tue Feb 24 19:19:07 CET 2004


On Tuesday 24 February 2004 17:49, Benoit Minisini wrote:
> On Tuesday 24 February 2004 12:11, ron wrote:
> > On Monday 23 February 2004 22:15, Charlie Reinl wrote:
> > > Salut,

snip away

> > *************************************************************************
> > ' * !! this one was the missing part, I had empty table after the window
> > ' * that was hiding the table was moved away.
> > '
> > *************************************************************************
> > public sub tableview1_data(row as integer, column as integer)
> > 	' in the database manager the data is taken from the dataabase table
> > 	' by asking the record for row and the field for the column
> > 	' her i now get it from my array grid tblcols[]
> > 	tableview.data.text = tblcols[column][row]
> > 	' tableview.data.forecolor = tblcolor[column][row]
> > end
> >
> > ' routine to store and update data
> > public sub UpdateData( row as integer, column as integer, text as string)
> > 	tblcols[column][row] = text ' this set data for tableview refreshing
> > 	tableview[row,column].data.text = text 'this update screen
>
> tableview[row,column].Refresh should work better!
>
> Regards,

First a little update, :(

public sub UpdateData( row as integer, column as integer, text as string)
	tblcols[column][row] = text ' this set data for tableview refreshing
	tableview.moveto(-1,-1)  ' !!!!!! this is very importand !!!!!!!!
	tableview[row,column].data.text = text 'this update screen
end


As I found the tableview[row,column].Refresh starts the tableview_data events
Then the data must come out of the array. Setting with .data.text makes the
change direct visible without a refresh. 
The only requirement is to invalidate the row/col address and reselecting it 
before you write data. It is not posible to rewrite several times to the same 
[row,column].data cell. 
You did it this way in the GDM without refresh. I have stolen it ;)

Writing the data with tblvw[x,y].data.text looks to me not persistent. 
The visual data content and backcolor was lost after moving other windows over 
it and using the events with a array was needed and my solution to use.

In my case the refreshing of the tableview makes the whole table flickering.
QT send only events for the cells that need an refresh and that is less than
the whole tableview in one refresh.

If I remember well the .Refresh was also quickly scrolling the Tableview grid.
The tblvw[row,column].Refresh did't look working (i will retry it).

May be my fault but this way was working well ;)





More information about the User mailing list