if I have to add a record in a dbf using TBROWSE() and hybride mode of xbase, I simulated the insertion by going to the end of the browse and creating a space (simulating a fake new line using SCROLL() for example) by to allow the GETs to compile them.
if the data was confirmed, then I would append the record by recording the information and position myself on the entered record.
if I canceled the operation, I would position myself on the previously saved record and restore the screen using RESTSCREEN to return to the previous situation
in Gui mode how should I behave to get the same result?
how do you manage the insertion of a new record directly on the browse?
dcbrowse - insert row (new record)
Re: dcbrowse - insert row (new record)
Look at the Cell editing sample in \exp20\samples\browse\celledit.prg
The eXpress train is coming - and it has more cars.
Re: dcbrowse - insert row (new record)
but CellEdit example creates a new record (append) ?
I do not think there is the possibility to add a new record but only to edit the existing one
I do not think there is the possibility to add a new record but only to edit the existing one
Re: dcbrowse - insert row (new record)
The append feature of cell-editing only works with arrays.
If you want to add a new record, then I suggest that you use the ::hitBottomBlock callback of the XbpBrowse() class to add the record.
DC_XbpBrowse is derived from XbpBrowse so it follows all rules of XbpBrowse class.
Look at the Alaska documentation for XbpBrowse
If you want to add a new record, then I suggest that you use the ::hitBottomBlock callback of the XbpBrowse() class to add the record.
DC_XbpBrowse is derived from XbpBrowse so it follows all rules of XbpBrowse class.
Look at the Alaska documentation for XbpBrowse
The eXpress train is coming - and it has more cars.
Re: dcbrowse - insert row (new record)
I started to experiment with the technique of inserting a new record and position myself at the bottom of the browse:
//----------------
DBAPPEND()
oBrowse:goBottom()
oBrowse:forceStable()
AEval( oBrowse:aColumns, {|o| o:DataArea:setCell( oBrowse:RowPos, NIL ) } ) // clear data ROW
oBrowse:deHilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
// editing of new record
//
//
// if CANCEL
DBDELETE()
oBrowse:goBottom()
oBrowse:forceStable()
oBrowse:hilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
// if CONFIRM
oBrowse:hilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
I don't like this way of working so much because I have to insert a physical record and delete it if the user abandons the insertion
first chance
I would like to make a fake refresh of the records up to simulate the insertion and possibly return to the previous situation
second chance
save the screen (GraSaveScreen()) and restore it but I'm afraid to mishandle the coordinates of the browse rows
//----------------
DBAPPEND()
oBrowse:goBottom()
oBrowse:forceStable()
AEval( oBrowse:aColumns, {|o| o:DataArea:setCell( oBrowse:RowPos, NIL ) } ) // clear data ROW
oBrowse:deHilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
// editing of new record
//
//
// if CANCEL
DBDELETE()
oBrowse:goBottom()
oBrowse:forceStable()
oBrowse:hilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
// if CONFIRM
oBrowse:hilite()
AEval( oBrowse:aColumns, {|o| o:Redraw() } ) // redraw columns
I don't like this way of working so much because I have to insert a physical record and delete it if the user abandons the insertion
first chance
I would like to make a fake refresh of the records up to simulate the insertion and possibly return to the previous situation
second chance
save the screen (GraSaveScreen()) and restore it but I'm afraid to mishandle the coordinates of the browse rows
Re: dcbrowse - insert row (new record)
could I be of help using the quickbrowse (DCQUICKBROWSE) instead DCBROWSE?
I could think of positioning myself on the last record of the database and then have a vertical pan up - another feature of xbpquickbrowse, correct ?
I have to understand, however, how the pan function is carried out (\XPPW32\SOURCE\SYS\Source\UI\BROWSE\xbp_qbrw.prg is the correct source ?)
I played on some controls ... see attached example - first problem: I can't position myself correctly in the empty line
- second problem: I can't create a new GetList by overlapping the browse below
I could think of positioning myself on the last record of the database and then have a vertical pan up - another feature of xbpquickbrowse, correct ?
I have to understand, however, how the pan function is carried out (\XPPW32\SOURCE\SYS\Source\UI\BROWSE\xbp_qbrw.prg is the correct source ?)
I played on some controls ... see attached example - first problem: I can't position myself correctly in the empty line
- second problem: I can't create a new GetList by overlapping the browse below
Re: dcbrowse - insert row (new record)
I will take a closer look at what you're trying to do, but just one first impression: If you want to have a control to be redrawn (without re-reading the data), just use the method "invalidateRect". oBrowse:InvalidateRect() will repaint the browse without re-reading the data (oBrowse:RefreshAll()), and without flickering.
I don't know exactly what you mean with "vertical pan up", but I suppose it's something like "Up" and "Down" (or GoBottom) you also have in DCBROWSE/XbpBrowse, no matter which datasource is connected.
I don't know exactly what you mean with "vertical pan up", but I suppose it's something like "Up" and "Down" (or GoBottom) you also have in DCBROWSE/XbpBrowse, no matter which datasource is connected.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: dcbrowse - insert row (new record)
I solved the problem in this way, using DCBROWSE instead DCQUICKBROWSE (not recommended by Roger) :
- go to the bottom of the db
- perform :forceStable()
- redisplay all content of browse shifting up by 1 all values
- clear current row
- perform my GETs using new DCREAD loop
- refresh all browse using :forceStable()
- redisplay row cursor of browse
- return to browse
- go to the bottom of the db
- perform :forceStable()
- redisplay all content of browse shifting up by 1 all values
- clear current row
- perform my GETs using new DCREAD loop
- refresh all browse using :forceStable()
- redisplay row cursor of browse
- return to browse
do you give me your opinion on any mistakes I made?Tom, Roger