Time from start: 0 hours 0 mins 12 secs
Error occurred at: 02/08/13, 09:58:05
Error description: Error BASE/1004 Class: 'NIL' has no exported method: NLASTKEY
Args:
[ 1] = U
Stack Calls
===========
Called from: => NLASTKEY( 0 )
Called from: xbrowse.prg => TXBRWCOLUMN:POSTEDIT( 11018 )
Called from: xbrowse.prg => (b)TXBRWCOLUMN:SHOWBTNLIST( 10927 )
Called from: window.prg => TWINDOW:LOSTFOCUS( 2909 )
Called from: control.prg => (b)TCONTROL:TCONTROL( 186 )
Called from: => TCONTROL:LOSTFOCUS( 0 )
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:LOSTFOCUS( 297 )
Called from: control.prg => TLISTBOX:KILLFOCUS( 1063 )
Called from: control.prg => TCONTROL:HANDLEEVENT( 1674 )
Called from: .\source\classes\LISTBOX.PRG => TLISTBOX:HANDLEEVENT( 568 )
Called from: window.prg => _FWH( 3187 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: dialog.prg => TDIALOG:ACTIVATE( 269 )
Called from: test2.prg => TESTEDIT( 182 )
the code of the TEST
- Code: Select all Expand view
- #include "FiveWin.ch"
#include "Report.ch"
#include "xBrowse.ch"
#include "constant.ch"
#define MARQSTYLE_HIGHLWIN7 7
REQUEST DBFCDX
REQUEST DBFFPT
External ordkeyno, ordkeycount,ordcreate,ordkeygoto
static nTotaleImponibile
static nTotaleIva
static nTotale
static oSay1, oSay2, oSay3
Function TestInvoice()
Local oFrmInvoice
Local nBottom := 42.3
Local nRight := 110
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
Local oFont := TFont():New( GetDefaultFontName(), 0, GetDefaultFontHeight(),, )
Local oFontTotal := TFont():New( GetDefaultFontName(), 0, -25,, )
nTotale:=0
nTotaleIva:=0
nTotaleImponibile :=0
RddSetDefault( "DBFCDX" )
// APRO L'ARCHIVIO RIGHE
if ! Db_OpenNoIndex("PARFAT","PF")
return nil
endif
Define DIALOG oFrmInvoice TITLE "Test Invoice " ;
SIZE nWidth, nHeight TRANSPARENT FONT oFont
@ 25, 3 FOLDEREX oFld1 Items "&Righe Documento";
SIZE oFrmInvoice:nwidth-440,230 PIXEL;
OF oFrmInvoice
@ 1, 1 XBROWSE oBrw SIZE oFld1:aDialogs[1]:nwidth-5,oFld1:aDialogs[1]:nbottom-35 PIXEL OF oFld1:aDialogs[1] ALIAS "PF";
COLUMNS 'PF->codice','PF->Voce','PF->Quantita',;
' PF->unita','PF->Prezzo','PF->Sconti','PF->Iva','pf->importo' ;
COLSIZES 90,140,50,60,40,80,90,90 ;
HEADERS i18n("Codice"),i18n("Descrizione"), i18n("Quantità"),;
i18n("Unità di misura"),i18n("Prezzo"),i18n("Sconti"),i18n("Iva"),i18n("Importo") ;
PICTURES ,,'@ 9999',,'@ €99,999.99',,'99.99 %','@ €99,999.99' ;
CELL LINES FOOTERS NOBORDER FASTEDIT
oBrw:lColDividerComplete := .t.
oBrw:lRecordSelector := .F.
oBrw:lVScroll := .F.
oBrw:lHScroll := .F.
oBrw:CreateFromCode()
oBrw:nHeaderHeight := 20
oBrw:nRowHeight := 20
oBrw:nStretchCol := STRETCHCOL_WIDEST
oBrw:MakeTotals()
oBrw:RefreshFooters()
WITH OBJECT oBrw
WITH OBJECT oBrw:aCols[1]
* :addbmpfile( ".\bitmaps\search.bmp" )
*:lBtnTransparent := .t.
:nBtnBmp := 1
:nEditType := EDIT_BUTTON
:bEditBlock :={||Sel_products(oBrw)}
END
WITH OBJECT oBrw:aCols[2]
:nEditType := EDIT_GET
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[3]
:nEditType := EDIT_GET
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[5]
:nEditType := EDIT_GET
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[4]
* :addbmpfile( ".\bitmaps\search.bmp" )
* :lBtnTransparent := .t.
* :nBtnBmp := 1
:nEditType := EDIT_LISTBOX
:aEditListTxt:={"pz.","gr","kg","mm" }
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
END
WITH OBJECT oBrw:aCols[7]
* :addbmpfile( ".\bitmaps\search.bmp" )
* :lBtnTransparent := .t.
:nBtnBmp := 1
:nEditType := EDIT_LISTBOX
:aEditListTxt:={"20","12","8","4" }
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
END
WITH OBJECT oBrw:aCols[8]
:bStrData :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
:addbmpfile( ".\bitmaps\cassa16.bmp" )
:nDataStrAlign := AL_RIGHT
:cEditPicture := '99,999.99'
:lTotal := .t.
:nTotal :=0
:nFooterType := AGGR_SUM
:nFootStrAlign := AL_RIGHT
:nFootBmpNo := 1 // Footer BMP
END
END
@ 275, 315 SAY "Imponibile" OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL
@ 282, 315 SAY "Iva " OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL
@ 291, 315 SAY "Totale Documento " OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL
@ 260, 380 SAY oSay1 PROMPT nTotaleImponibile OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL FONT oFontTotal
@ 278, 380 SAY oSay2 PROMPT nTotaleIva OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL FONT oFontTotal
@ 295, 380 SAY oSay3 PROMPT nTotalE OF oFrmInvoice COLOR 0, 16777215 SIZE 80, 12 PIXEL FONT oFontTotal
@ 260, 15 button "Manual" OF oFrmInvoice SIZE 80, 12 PIXEL action NewItem(oBrw)
@ 280, 15 button "Products" OF oFrmInvoice SIZE 80, 12 PIXEL action Sel_Products(oBrw)
@ 295, 15 button "Del row" OF oFrmInvoice SIZE 80, 12 PIXEL action Del_row(oBrw)
ACTIVATE DIALOG oFrmInvoice CENTERED
Return NIL
Function NewItem(oBrw)
PF->(DbAppend())
Replace PF->Quantita With 1
PF->(DbCommit())
WITH OBJECT oBrw
WITH OBJECT oBrw:aCols[1]
:nEditType := EDIT_BUTTON
:bEditBlock :={||Sel_products(oBrw)}
END
WITH OBJECT oBrw:aCols[3]
:nEditType := EDIT_GET
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[5]
:nEditType := EDIT_GET
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[4]
:nEditType := EDIT_LISTBOX
:aEditListTxt:={"pz.","gr","kg","mm" }
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[7]
:nBtnBmp := 1
:nEditType := EDIT_LISTBOX
:aEditListTxt:={"20","12","8","4" }
:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( DBRLOCK(), FieldPut( o:nCreationOrder, v ), DBUNLOCK() ), ) }
:bEditBlock :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
END
WITH OBJECT oBrw:aCols[8]
:bStrData :={||Calcolo_Riga( PF->QUANTITA,PF->PREZZO,VAL(PF->IVA),PF->SCONTI,oBrw)}
:addbmpfile( ".\bitmaps\cassa16.bmp" )
:nDataStrAlign := AL_RIGHT
:cEditPicture := '99,999.99'
:lTotal := .t.
:nTotal :=0
:nFooterType := AGGR_SUM
:nFootStrAlign := AL_RIGHT
:nFootBmpNo := 1 // Footer BMP
END
END
oBrw:SetFocus()
oBrw:Refresh()
Return NIL
Function Sel_Products(oBrw)
// Sele_Prd(oBrw)
Return NIL
Function Del_row(oBrw)
local nRecord := PF->(Recno())
local nNext
* oApp():nEdit ++
IF PF->(OrdKeyCount()) > 0
if msgYesNo( i18n("¿ E' sicuro di voler cancellare questo record ?") + CRLF + ;
(trim(PF->VOCE)))
PF->(DbSkip())
nNext := PF->(Recno())
PF->(DbGoto(nRecord))
PF->(DbDelete())
PF->(DbPack())
PF->(DbGoto(nNext))
if PF->(EOF()) .or. nNext == nRecord
PF->(DbGoBottom())
endif
endif
else
MsgInfo("Non c'è nessun record da cancellare")
endif
* if oCont != nil
* RefreshCont(oCont,"RU")
* endif
oBrw:MakeTotals()
oBrw:RefreshFooters()
oBrw:Refresh(.t.)
oBrw:SetFocus(.t.)
*oApp():nEdit --
Return NIL
// Functions
/*
FUNCTION Calcolo_Riga(quantita,unitario,Iva,Sconti,oBrw)
Local nImporto := 0
Local nImponibile := 0
Local nTotaleNetto := 0
Local nTotaleRiga := 0
Local nSconto := 0
_TOTIMPONIBLE := nTotaleImponibile
_TOTIVA := nTotaleIva
_TOTGENERALE := nTotale
nImporto:=quantita*unitario
nImponibile:=(nImporto/100)*Iva
nTotaleNetto:=nImponibile+nImporto
nSconto:=(nTotaleNetto*(val(Sconti)/100))
nTotaleRiga := nTotaleNetto - nSconto
PF->IMPORTO:= nTotaleRiga
nTotaleImponibile:= _TOTIMPONIBLE + nImponibile
nTotaleIva := _TOTIVA + nTotaleIva
nTotale := _TOTGENERALE + nTotaleRiga
oSay1:refresh()
oSay2:refresh()
oSay3:refresh()
* oBrw:refresh()
oBrw:MakeTotals()
oBrw:RefreshFooters()
nmsgbox( nTotaleImponibile , nTotaleRiga )
RETURN NIL
*/
Function Calcolo_Riga( quant,unitario,iva,sconti,oBrw)
Local nImporto := 0
Local nImponibile := 0
Local nNetto := 0
Local nTotaleRiga := 0
Local nSconto := 0
nOldTotale := nTotale
nOldTotaleIva := nTotaleIva
nOldTotaleImponibile := nTotaleImponibile
nImporto:=quant*unitario
nImponibile:= ((nImporto/100)*iva)
nNetto:=nImponibile+nImporto
nSconto:=nNetto*(val(sconti)/100)
nTotaleRiga := nNetto-nSconto
Pf->Importo:= nTotaleRiga
oBrw:MakeTotals()
oBrw:RefreshFooters()
* oBrw:Refresh(.t.)
nTotale:=nOldTotale +nTotaleRiga
nTotaleImponibile:=nOldTotaleImponibile+ nImponibile
nTotaleIva:=nOldTotaleIva +0
oSay1:refresh()
oSay2:refresh()
oSay3:refresh()
Return nTotaleRiga
function Db_OpenNoIndex(cDbf,cAlias)
if file( cDbf + ".dbf" )
USE &(cDbf+".dbf") ;
ALIAS &(cAlias) NEW
else
MsgStop( i18n( "Non si è trovato l'archivio dei dati." ) + CRLF + ;
i18N( "Per favore controlla la configurazone") + CRLF + ;
i18N( "e indicizza gli archivi dell'applicazione." ) )
return .f.
return .f.
END if
if NetErr()
msgStop( i18n( "Errore nell'aprire un archivio" ) + CRLF + ;
i18n( "Per favore caricare di nuovo l'applicazione." ) )
DbCloseAll()
return .f.
endif
return .t.
//-----------------------------------------------------------------//
#pragma BEGINDUMP
#include "Windows.h"
#include "hbapi.h"
HB_FUNC( ROUNDBOX )
{
HDC hDC = ( HDC ) hb_parni( 1 );
HBRUSH hBrush = ( HBRUSH ) GetStockObject( 5 );
HBRUSH hOldBrush = ( HBRUSH ) SelectObject( hDC, hBrush );
HPEN hPen, hOldPen ;
if( hb_pcount() > 8 )
hPen = CreatePen( PS_SOLID, hb_parnl( 9 ), ( COLORREF ) hb_parnl( 8 ) );
else
hPen = CreatePen( PS_SOLID, 1, ( COLORREF ) hb_parnl( 8 ) );
hOldPen = ( HPEN ) SelectObject( hDC, hPen );
hb_retl( RoundRect( hDC ,
hb_parni( 2 ),
hb_parni( 3 ),
hb_parni( 4 ),
hb_parni( 5 ),
hb_parni( 6 ),
hb_parni( 7 ) ) );
SelectObject( hDC, hOldBrush );
DeleteObject( hBrush );
SelectObject( hDC, hOldPen );
DeleteObject( hPen );
}
HB_FUNC( GETDEFAULTFONTNAME )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retc( lf.lfFaceName );
}
HB_FUNC( GETDEFAULTFONTHEIGHT )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retni( lf.lfHeight );
}
HB_FUNC( GETDEFAULTFONTWIDTH )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retni( lf.lfWidth );
}
HB_FUNC( GETDEFAULTFONTITALIC )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retl( (BOOL) lf.lfItalic );
}
HB_FUNC( GETDEFAULTFONTUNDERLINE )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retl( (BOOL) lf.lfUnderline );
}
HB_FUNC( GETDEFAULTFONTBOLD )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retl( (BOOL) ( lf.lfWeight == 700 ) );
}
HB_FUNC( GETDEFAULTFONTSTRIKEOUT )
{
LOGFONT lf;
GetObject( ( HFONT ) GetStockObject( DEFAULT_GUI_FONT ) , sizeof( LOGFONT ), &lf );
hb_retl( (BOOL) lf.lfStrikeOut );
}
#pragma ENDDUMP
//#end of file