Page 1 of 1

Grid & SoftSeek

Posted: Sat Jun 05, 2010 12:20 am
by Czarny_Pijar
SEEK with SOFTSEEK clause
moves the pointer in the database
to the last record displayed in the grid,

see the program and the picture below.

Re: Grid & SoftSeek

Posted: Sat Jun 05, 2010 2:09 am
by Roberto Lopez
Czarny_Pijar wrote:SEEK with SOFTSEEK clause
moves the pointer in the database
to the last record displayed in the grid,

see the program and the picture below.
Maybe I'm missing something, but it works just as it should for me.

Grid moves the record pointer in its workarea.

Re: Grid & SoftSeek

Posted: Sat Jun 05, 2010 8:52 am
by Czarny_Pijar
Let's start again in the different way.
Now in the demo we have 2 child forms, first with the grid, second without the grid, both performing SOFTSEEK.
I expect in both forms the results of SOFTSEEK to be the same, but the grid is responsible for the differences.

The modified demo attached below.
==========================
BTW, another minor bug in the IDE occurs. How to get:

1 Run IDE
2 Open any project
3 Click 'New Project' in the IDE
4 Click 'Cancel' in the resulting dialog box
5 Click 'New Form' in the IDE

Looks like the option 'New Project' forced to close the current project, no mercy.

Re: Grid & SoftSeek

Posted: Sat Jun 05, 2010 1:33 pm
by Roberto Lopez
Czarny_Pijar wrote:Let's start again in the different way.
Now in the demo we have 2 child forms, first with the grid, second without the grid, both performing SOFTSEEK.
I expect in both forms the results of SOFTSEEK to be the same, but the grid is responsible for the differences.
Each time that the operating system needs to repaint a specific region of a grid, it sends a message that is processed by HMG.

According to the logical row of the cell that needs be repainted, HMG moves the record pointer to such row to pick the required value to update the cell.

This process in initiated automatically by the operating system according its own needs, so, there is no way to modify this process.

Of course, HMG could backup the record position, move it to do the update and the restore it to its original position, but, such process could slow down grid a lot.

The bottom line is that there is no way to predict where the record pointer is at a specific moment, because it is moved according to the region of the window that the operating system needs to repaint in a specific situation.

This is the reason because I've added the 'recno' property. Via this property you can know the record number of the selected row, in the case that you need it to do something with it.

If you don't like this way, you could still using browse control and setting browsesync to 'on'.

Re: Grid & SoftSeek

Posted: Wed Jun 09, 2010 7:25 am
by Czarny_Pijar
Roberto Lopez wrote:If you don't like this way, you could still using browse control and setting browsesync to 'on'.
:? I was close to give up the grid in favour of browse, but...

I've finally spotted the quirk: :)
I have to move the command 'grid.value' to the bottom, in order do NOT interfere with the data related to the current pointer of the database.

BTW, the other HMG-apprentices, beware: grid.value and grid.OnChange are not what they seems to be, at least for me ;)

Re: Grid & SoftSeek

Posted: Wed Jun 09, 2010 8:11 am
by mol
I've gave up with grid in few situations.
Browse looks to work properly in every situation.
I'll use it when grid becomes fully stable.
Regards, Marek

PS. Of course, I'll still test it :)

Re: Grid & SoftSeek

Posted: Thu Jun 17, 2010 7:08 pm
by mol
I'm building my own billing system.
I've wanted to use grid to display classical 1 to n relation: a bill and its content.

Two grids: first with headers of bills, second - with content of bills.

Everything looks OK when bill has more than 1 position.
When the bill has only one position, grid of content doesn't refresh...

What's going on?
I've missed something?

I'll prepare a little sample tomorrow.

Best regards, Marek