XBROWSE: need help with append blank

XBROWSE: need help with append blank

Postby bosibila » Sun Mar 15, 2009 1: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:

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

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)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: XBROWSE: need help with append blank

Postby Antonio Linares » Sun Mar 15, 2009 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: XBROWSE: need help with append blank

Postby bosibila » 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 \fwh\samples\testxbr3.prg (function RddBrwSelColsWin() ).
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)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: XBROWSE: need help with append blank (solved)

Postby bosibila » 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)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: XBROWSE: need help with append blank

Postby Daniel Garcia-Gil » Mon Mar 16, 2009 11:36 pm

Hello Bosibila

please tell us how do you do solved?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: XBROWSE: need help with append blank

Postby bosibila » 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)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: XBROWSE: need help with append blank

Postby Antonio Linares » Tue Mar 17, 2009 10:54 pm

Boris,

From your code:
Code: Select all  Expand view  RUN

   adr->(dbAppend())
   oBrw:nLen += 1
   oBrw:Refresh()
   oBrw:aCols[ 2 ]:Edit()
 

Thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests

cron