txbrowse refresh()
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
txbrowse refresh()
Hi,
In twbrowse I used obrw:upstable() + obrw:refresh() after adding or deleting a record.
What do I need to do with txbrowse? If I use obrw:refresh(), the browse is not correct refreshed after adding or deleting a record.
obrw:upstable() does not exist in txbrowse.
Thanks
Marc
In twbrowse I used obrw:upstable() + obrw:refresh() after adding or deleting a record.
What do I need to do with txbrowse? If I use obrw:refresh(), the browse is not correct refreshed after adding or deleting a record.
obrw:upstable() does not exist in txbrowse.
Thanks
Marc
Marc,
i had this problem a few time ago when i start use TXBROWSE.
After the "delete" of one record, I solve the problem moving my .dbf one record below and up with "skip" and "skip -1". Only after this i note that oBRW:refresh() works fine.
Instead, after "append" command i did not have problems. Check your index files too, because their corruption can cause a wrong refresh() after the append command.
Best regards
i had this problem a few time ago when i start use TXBROWSE.
After the "delete" of one record, I solve the problem moving my .dbf one record below and up with "skip" and "skip -1". Only after this i note that oBRW:refresh() works fine.
Instead, after "append" command i did not have problems. Check your index files too, because their corruption can cause a wrong refresh() after the append command.
Best regards
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Marc,
>With the appand it didn't work. The index-file is not corrupted. I test it with a database with only about 20 records.
Should the appended record be visible in the browse (considering the index)? Is there data in the appended record (perhaps it is visible, but there is no data to see)?
Regards,
James
>With the appand it didn't work. The index-file is not corrupted. I test it with a database with only about 20 records.
Should the appended record be visible in the browse (considering the index)? Is there data in the appended record (perhaps it is visible, but there is no data to see)?
Regards,
James
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
James,
The appended record should be visible and is visible. The problem is that after the append it is added in the browse and is selected, but if you scroll up or down the data of those field change to the data that is now there.
Also scrolling up after appending a new record, the browse doesn't go completely up anymore but stops at the top record in the database. And this is not the top op the browse. Scrolling completely down, and than up, the problem is solved.
Regards,
Marc
The appended record should be visible and is visible. The problem is that after the append it is added in the browse and is selected, but if you scroll up or down the data of those field change to the data that is now there.
Also scrolling up after appending a new record, the browse doesn't go completely up anymore but stops at the top record in the database. And this is not the top op the browse. Scrolling completely down, and than up, the problem is solved.
Regards,
Marc
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
James,
It did't work.
Here is an example. You must press 'ADD' a couple op times and then scroll the browse. You will notice the problem.
Regards,
Marc
It did't work.
Here is an example. You must press 'ADD' a couple op times and then scroll the browse. You will notice the problem.
Code: Select all
#INCLUDE "FiveWin.ch"
#include "xbrowse.ch"
FUNCTION test()
local oDlg
local oCol
local vgetlist
local dbstructuur:={}
aadd(dbstructuur, { 'NAME','C',16,0})
dbcreate('TEST',dbstructuur)
use test new EXCLUSIVE
index on upper(name) tag tmp
DEFINE DIALOG oDlg RESOURCE "TEST"
vGetlist := TXBrowse():New( oDlg )
REDEFINE BUTTON ID 100 OF oDlg ACTION addname(vgetlist)
oCol := vGetlist:AddCol()
oCol:bStrData := { || test->name}
oCol:cHeader := 'NAME'
oCol:nWidth := 100
oCol:lAllowSizing := .f.
vGetlist:lAllowRowSizing := .f.
vGetlist:nRowHeight := 20
vGetlist:nMarqueeStyle := MARQSTYLE_HIGHLCELL
vGetlist:nColDividerStyle := LINESTYLE_LIGHTGRAY
vGetlist:nRowDividerStyle := LINESTYLE_LIGHTGRAY
vGetlist:SetRDD()
vGetlist:CreateFromResource( 101 )
ACTIVATE DIALOG oDlg CENTERED
RETURN nil
FUNCTION addname(vgetlist)
appe blank
repl name with str(HB_RANDOMINT(1,10000) ,5,0)
vgetlist:refresh()
RETURN nil
Code: Select all
TEST DIALOG 6, -35, 489, 395
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "TXBrowse test"
FONT 8, "MS Sans Serif"
{
CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 8, 27, 340, 357
GROUPBOX "Name", 11, 3, 11, 352, 381, BS_GROUPBOX
PUSHBUTTON "ADD", 100, 377, 25, 92, 19
}
Marc
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Dear Marc & James,
I am using FWH 8.08 and I confirm a refresh problem with the above provided sample.
Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data.
Regards
Anser
I am using FWH 8.08 and I confirm a refresh problem with the above provided sample.
Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data.
Regards
Anser
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Anser and Marc,
>Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data.
I have retested it and I still do not see a problem. I added 30 or 40 new records and never saw a problem.
What do you mean by the "whole data?"
I am wondering if you mean that sometimes the entire browse window is not filled with data? If this is what you mean, it is not a bug. The currently highlighted record is where the new record will be displayed. Sometimes if the new record is near the end of the file there will not be enough trailing records to fill the browse.
For example, if the currently hightlighted record is the 2nd row in the browse, and you add a new record that becomes the 3rd to the last record in the index, then only 4 records will be displayed (regardless of how many more there are in the file), one record before and two records after.
If you want a full screen of data, then you will have to program this into the append record routine. You will have to figure out how close to the end of the index the new record is, and move to the appropriate record needed to fill the browse. You will also have to figure out which row the new record is, and change the browse pointer to that row (this is oBrw:nAt, I think). And you will have to figure out how to do this if the file doesn't contain enough records to fill the browse. And you have to figure out if neither of the above applies and then do nothing.
Personally, I think the current behavior is acceptable.
Regards,
James
>Try to add more records using the button, you will find that sometimes the xBrowse is not refreshed properly to display whole data, you will need to move thru records either thru mouse scroll wheel or keyboard to view some of the data.
I have retested it and I still do not see a problem. I added 30 or 40 new records and never saw a problem.
What do you mean by the "whole data?"
I am wondering if you mean that sometimes the entire browse window is not filled with data? If this is what you mean, it is not a bug. The currently highlighted record is where the new record will be displayed. Sometimes if the new record is near the end of the file there will not be enough trailing records to fill the browse.
For example, if the currently hightlighted record is the 2nd row in the browse, and you add a new record that becomes the 3rd to the last record in the index, then only 4 records will be displayed (regardless of how many more there are in the file), one record before and two records after.
If you want a full screen of data, then you will have to program this into the append record routine. You will have to figure out how close to the end of the index the new record is, and move to the appropriate record needed to fill the browse. You will also have to figure out which row the new record is, and change the browse pointer to that row (this is oBrw:nAt, I think). And you will have to figure out how to do this if the file doesn't contain enough records to fill the browse. And you have to figure out if neither of the above applies and then do nothing.
Personally, I think the current behavior is acceptable.
Regards,
James
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
What would help is if someone would modify the example so that it added a fixed sequence of numbers so that the same record values are added each time in order. Then you can describe how to recreate the problem step by step, e.g.
"Press the Add button 7 times, then scroll up to the top and one more past the top and you will see..."
A few screenshots would also help.
Otherwise I am having a difficult time seeing what others are saying is wrong.
Regards,
James
"Press the Add button 7 times, then scroll up to the top and one more past the top and you will see..."
A few screenshots would also help.
Otherwise I am having a difficult time seeing what others are saying is wrong.
Regards,
James
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
James,
Here is an AVI-file of the txbrowse problem.
http://www.vms.be/FWTest/txbrowse.avi
Regards,
Marc
Here is an AVI-file of the txbrowse problem.
http://www.vms.be/FWTest/txbrowse.avi
Regards,
Marc
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: