Page 3 of 3
Re: Row Refresh in a BROWSE
Posted: Tue Jun 30, 2020 5:36 pm
by mol
franco wrote: ↑Tue Jun 30, 2020 5:11 pm
Mol, I use for grid line number
formname.gridname.recno for grid record
formname.gridname.recno() for table record
not sure if it works for browse.
Not. In this way it doesn't work.
I investigated BROWSE control sources and I prepared function for refresh current row.
But, the problem is with numeric columns - they are empty after refreshing, so I decided to convert it to string by hb_ntos
Code: Select all
PROCEDURE RefreshBrowseLine(cForm, cBrowse)
LOCAL i, iMax
LOCAL cField, xValue
local aStruc
local h
nIdx := GetControlIndex ( cBrowse, cForm )
h := GetControlHandle ( cBrowse, cForm )
nRow := LISTVIEW_GETFIRSTITEM ( h) // this function returns current screen row number
aStruc := _HMG_SYSDATA [ 31 ] [nIdx] // array conainig FIELDS parameter
iMax := LEN(aStruc)
FOR i := 1 TO iMax
cField := aStruc[ i ]
xValue := &cField
if valtype(xValue) == "N"
xValue := hb_ntos(xValue)
endif
SetProperty( cForm, cBrowse, "CELL", nRow, i, xValue )
NEXT i
RETURN
Re: Row Refresh in a BROWSE
Posted: Tue Jun 30, 2020 7:25 pm
by Red2
Hi Marek,
Thank you very much for sharing your expertise and the fine work on your procedure!
Works great! Now there is an
HMG procedure that updates just the current row of a simple HMG BROWSE.
Unfortunately when I run it in
HMG-Extended (Harbour MiniGUI Extended Edition 20.05 (Update 2)) I get "
Error BASE/1068 Argument error: array access".
The "Program Error" message suggests that it happens on this line:
Code: Select all
aStruc:= _HMG_SYSDATA [ 31 ] [ nIdx ] // array containig FIELD names
Sorry, but I have yet to get HMG-Extended's debugger to work for me otherwise I would give more specifics.
Again, all of your generous help is greatly appreciated!
Warmest Regards,
Red2
Re: Row Refresh in a BROWSE
Posted: Tue Jun 30, 2020 8:11 pm
by AUGE_OHR
hi,
mol wrote: ↑Tue Jun 30, 2020 9:15 am
"VALUE" property of BROWSE return record number in database, not row numer of BROWSE.
hm ... but i can "edit" it by DblClick this Way
Code: Select all
PROCEDURE EditDetail( cBroMacro, cWorkArea, cDbf, lEdit )
...
#IFDEF Use_DataBrowse // BROWSE
nRecno := GetProperty( cBroMacro, "BrowserView", "Value" )
#ELSE // GRID
nRecno := GetProperty( cBroMacro, "BrowserView", "RecNo" )
#ENDIF
The following data are available at ‘OnDblClick’ procedure:
- This.CellRowIndex
- This.CellColIndex
- This.CellRow
- This.CellCol
- This.CellWidth
- This.CellHeight
---
you are right that my Code only work on 1st Page ... but fail on 2nd Page of BROWSE ... hm
it seem that no more of "This" are implement in BROWSE like in GRID
only work on 1st Page of BROWSE ... hm
Re: Row Refresh in a BROWSE
Posted: Tue Jun 30, 2020 8:31 pm
by AUGE_OHR
hi,
Red2 wrote: ↑Tue Jun 30, 2020 7:25 pm
Unfortunately when I run it in
HMG-Extended (Harbour MiniGUI Extended Edition 20.05 (Update 2)) I get "
Error BASE/1068 Argument error: array access".
The "Program Error" message suggests that it happens on this line:
Code: Select all
aStruc:= _HMG_SYSDATA [ 31 ] [ nIdx ] // array containig FIELD names
when create BROWSE you have
so you can pass "aFeld"
Code: Select all
RefreshBrowseLine(cForm, cBrowse, aFeld)
---
_HMG_SYSDATA does not exist in Extended Version
- BROWSE_HMG_EXT.JPG (194.41 KiB) Viewed 1622 times
HMG
Code: Select all
aStruc := _HMG_SYSDATA [ 31 ] [nIdx] // array conainig FIELDS parameter
Extended Version
Code: Select all
aStruc := _HMG_aControlRangeMin [nIdx] // extended Version
Re: Row Refresh in a BROWSE
Posted: Wed Jul 01, 2020 3:55 pm
by franco
I use table and ntx index. I wonder if this works different then idx or sql.
Re: Row Refresh in a BROWSE
Posted: Wed Jul 01, 2020 8:39 pm
by mol
Remember that my solution is only for BROWSE, not for GRID