FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Tue Sep 27, 2011 02:30 PM
This is the sample that I found in the forum
Code (fw): Select all Collapse
#include "fivewin.ch"
#include "xbrowse.ch"
function main()
   local aData := {}
   local oWnd, oBrw, oBar

   define dialog oWnd size 600, 300

   @ 12,15 xbrowse oBrw of oWnd ;
      header 'one','two','tipo', "cuatro" ;
      columns 1, 2, 3, 4 ;
      colsizes 50,70,50,70 ;
      pictures '999','mmm dd, yyyy', "9999.99" ;
      SIZE 300, 300 PIXEL ;
      array aData lines cell fastedit footers

   WITH OBJECT oBrw
      :bClrStd    := { || If( oBrw:KeyNo() % 2 == 0, ;
                         { CLR_BLACK, RGB( 224, 236, 255 ) }, ;
                         { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
   END

   AEval( oBrw:aCols, { |o| o:nEditType := EDIT_GET } )

   WITH OBJECT oBrw:tipo
      :nEditType        := EDIT_LISTBOX
      :aEditListBound   := ;
      :aEditListTxt     := { "NOV", "NTO", "TOR", "VAC", "VAQ", "TM ", "TH " }
   END
   WITH OBJECT oBrw:cuatro
      :nTotal        := 0
      :lTotal        := .t.
   END

   WITH OBJECT oBrw
      :bClrStd    := { || If( oBrw:KeyNo() % 2 == 0, ;
                         { CLR_BLACK, RGB( 224, 236, 255 ) }, ;
                         { CLR_BLACK, RGB( 189, 211, 253 ) } ) }
 
      :MakeTotals()
   END

   oBrw:CreateFromCode()
   
   AAdd( oBrw:aArrayData, { 1, date()+1, "NOV", 0 } )
   AAdd( oBrw:aArrayData, { 2, date()+2, "NOV", 0 } )
   AAdd( oBrw:aArrayData, { 3, date()+3, "NOV", 0 } )
   AAdd( oBrw:aArrayData, { 4, date()+4, "NOV", 0 } )
 
   activate dialog oWnd on init ( oWnd:Resize() )
return nil






If you change LISTBOX "Tipo" have this error :


Application
===========
Path and name: C:\FWMY\x_list1.exe (32 bits)
Size: 1,986,560 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 09/27/11, 16:27:16
Error description: Error BASE/1004 Class: 'NIL' has no exported method: NLASTKEY
Args:
[ 1] = U

Stack Calls
===========
Called from: => NLASTKEY(0)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:POSTEDIT(10883)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN:SHOWBTNLIST(10792)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LOSTFOCUS(2935)
Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL:TCONTROL(188)
Called from: => TCONTROL:LOSTFOCUS(0)
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:LOSTFOCUS(305)
Called from: .\source\classes\CONTROL.PRG => TLISTBOX:KILLFOCUS(1071)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1683)
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:HANDLEEVENT(576)
Called from: .\source\classes\WINDOW.PRG => _FWH(3443)
Called from: => DIALOGBOXINDIRECT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(277)
Called from: x_list1.prg => MAIN(56)


Regards MAurizio
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FW 11.08 Xbrowse with EDIT_LISTBOX error
Posted: Wed Sep 28, 2011 01:12 PM

Antonio,
the same error in FW 11.09

Maurizio

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Thu Sep 29, 2011 04:41 PM

Antonio ,
have you tried the sample ?

Maurizio

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Thu Sep 29, 2011 04:56 PM

It looks like a SysRefresh() is missing somewhere and nLastKey is not being processed....

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Fri Sep 30, 2011 08:21 AM

Bayron ,
the problem is METHOD Postedit is executed twice i dont know way
The second time ::oEditLbx is nil , so a workaround is :
change
if xValue != nil
with
if xValue != nil .and. ::oEditLbx != nil

case ::nEditType == EDIT_LISTBOX
if xValue != nil .and. ::oEditLbx != nil
Eval( ::bOnPostEdit, Self, xValue, ::oEditLbx:nLastKey )
nLastKey := ::oEditLbx:nLastKey
lGoNext := ( nLastKey == VK_RETURN )
endif

But I expect a better solution by the authors

Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Fri Sep 30, 2011 10:42 AM
Maurizio wrote:Bayron ,
the problem is METHOD Postedit is executed twice i dont know way
The second time ::oEditLbx is nil , so a workaround is :
change
if xValue != nil
with
if xValue != nil .and. ::oEditLbx != nil

case ::nEditType == EDIT_LISTBOX
if xValue != nil .and. ::oEditLbx != nil
Eval( ::bOnPostEdit, Self, xValue, ::nLastKey )
nLastKey := ::nLastKey
lGoNext := ( nLastKey == VK_RETURN )
endif

But I expect a better solution by the authors

Maurizio

Yes, this is a workaround.
We shall try to find and implement a proper fix.
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Thu Dec 22, 2011 04:43 PM

Hello Rao or Antonio ,
this problem has been solved?
MAurizio

Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: FW 11.08 / 11.09 Xbrowse with EDIT_LISTBOX error
Posted: Fri Mar 30, 2012 04:20 AM

I'm using FWH11.8 and am having this problem too. Is Maurizio's workaround the only solution so far?

TIA

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion