FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE: need help with append blank
Posts: 53
Joined: Wed Aug 06, 2008 05:27 PM
XBROWSE: need help with append blank
Posted: Sun Mar 15, 2009 01:39 AM

Hello, I try to understand where I made mistake. My FWH/xHarbour version is 8.07 and I want
to make modification in \fwh\samples\testxbr3.prg example. With one program line I try to append
new record:

[u:2oujfhxl]oBrw:bKeyDown = {|nKey| iif( nKey==VK_INSERT, (Dbappend(), oBrw:refresh(), oBrw:aCols[ 2 ]:Edit()), dbskip() ) }[/u:2oujfhxl]

When I press insert key, blue line of row selection stay on previous record, but record pointer (black triangle) goes to
lastrec().

Q: can I move blue row selector bar on new appended record?
Q: does refresh() must go to other part of program?

...
@ 0,0 XBROWSE oBrw ;
COLUMNS "State", "City", "First", "Married", "HireDate", "Age", "Salary", "Last" ;
JUSTIFY .f., AL_CENTER, .t. ;
OF ownd ;
ALIAS cAlias AUTOSORT FASTEDIT FOOTERS LINES CELL

oBrw:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS

--------------------------------------------------------------------------------------------------------------------------------------
oBrw:bKeyDown = {|nKey| iif( nKey==VK_INSERT, (Dbappend(), oBrw:refresh(), oBrw:aCols[ 2 ]:Edit()), dbskip() ) }
--------------------------------------------------------------------------------------------------------------------------------------
...

Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: XBROWSE: need help with append blank
Posted: Sun Mar 15, 2009 09:07 AM

Boris,

Try it this way:

oBrw:bKeyDown = {|nKey| iif( nKey==VK_INSERT, (Dbappend(), oBrw:GoBottom(), oBrw:aCols[ 2 ]:Edit()), dbskip() ) }

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 53
Joined: Wed Aug 06, 2008 05:27 PM
Re: XBROWSE: need help with append blank
Posted: Sun Mar 15, 2009 11:45 PM

Hello Antonio,
Thanks for your time and answer. I did't wrote that xbrowse have autosort on selected fields ( CheckCustCdx() ).
Please if you have some time, to put that line in [u:1m5bfjrn]\fwh\samples\testxbr3.prg (function RddBrwSelColsWin() )[/u:1m5bfjrn].
During xbrowse database is opened with index with tags. I try with few lines and examples, but without satisfied result.

Best regards

...

static function RddBrwSelColsWin

local oWnd, oBrw, oCol, cAlias := cGetNewAlias( "CUST" )
local oBrush, n

cFunc := ProcName( 0 )

USE CUSTOMER NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
SET ORDER TO TAG STATE
GO TOP
MakeTotal()

DEFINE BRUSH oBrush RESOURCE "STONE"
DEFINE WINDOW ownd MDICHILD OF WndMain() TITLE "RDD - Selected Cols"

@ 0,0 XBROWSE oBrw ;
COLUMNS "State", "City", "First", "Married", "HireDate", "Age", "Salary", "Last" ;
JUSTIFY .f., AL_CENTER, .t. ;
OF ownd ;
ALIAS cAlias AUTOSORT FASTEDIT FOOTERS LINES CELL

oBrw:bClrRowFocus    := { || { CLR_BLACK, RGB(185,220,255) } }
oBrw:nMarqueeStyle   := MARQSTYLE_HIGHLROWMS

*---------------------------------------------------------------------------------------------------------------
*   oBrw:bKeyDown = {|nKey| iif( nKey==VK_INSERT, (Dbappend(), oBrw:refresh(), oBrw:aCols[ 2 ]:Edit()), dbskip() ) }
*---------------------------------------------------------------------------------------------------------------
oBrw:bKeyDown = {|nKey| iif( nKey==VK_INSERT, (Dbappend(), oBrw:GoBottom(), oBrw:aCols[ 2 ]:Edit()), dbskip() ) }

...

Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
Posts: 53
Joined: Wed Aug 06, 2008 05:27 PM
Re: XBROWSE: need help with append blank (solved)
Posted: Mon Mar 16, 2009 10:10 PM

Hello,

I solved problem, thanks

Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: XBROWSE: need help with append blank
Posted: Mon Mar 16, 2009 11:36 PM

Hello Bosibila

please tell us how do you do solved?

Posts: 53
Joined: Wed Aug 06, 2008 05:27 PM
Re: XBROWSE: need help with append blank
Posted: Tue Mar 17, 2009 10:28 PM
Hello Daniel,

Here is my homework created from testxbr3.prg. Don't be scared when you see this code,
beacuse I'm new in FWH . When you start exe press Alt+P to enter xBrowse.

http://www.paradigma.hr/test/

Regards
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: XBROWSE: need help with append blank
Posted: Tue Mar 17, 2009 10:54 PM
Boris,

From your code:
Code (fw): Select all Collapse
   adr->(dbAppend())
   oBrw:nLen += 1
   oBrw:Refresh()
   oBrw:aCols[ 2 ]:Edit()

Thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion