ola Antonio Linares,
Alterei o metro.ch assim:
// FiveWin - Windows 8 Metro look
#ifndef _METRO_CH
#define _METRO_CH
//----------------------------------------------------------------------------//
#xcommand DEFINE METRO <oMtr> ;
[ BACKGROUND <cFileName> ] ;
[ BTNSIZE <nBtnWidth>, <nBtnHeight> ] ;
[ TITLE <cTitle> ] ;
=> ;
<oMtr> := TMetro():New( <cTitle>, <nBtnWidth>, <nBtnHeight>, <cFileName> )
xcommand DEFINE METROBUTTON [<oBtn>] ;
[ PROMPT <cPrompt> ] ;
[ COLOR <nClrText>, <nClrPane> ] ;
[ IMAGE <cImgName> ] ;
[ OF <oMetro> ] ;
[ <large: LARGE> ] ;
[ ACTION <uAction,...> ] ;
=> ;
[ <oBtn> := ] <oMetro>:AddButton( <cPrompt>, <nClrText>, <nClrPane>,;
<.large.>, <cImgName>, [{| Self |<uAction>}] )
#xcommand ACTIVATE METRO <oMtr> => <oMtr>:Activate()
//----------------------------------------------------------------------------//
#endif
alterei o metro.prg assim:
DEFINE METRO oMetro ;
TITLE "My FWH Metro app" ;
BACKGROUND "..\bitmaps\hires\earth.bmp"
DBSELECTAREA( 1 )
NET_USE ("F_REG.DBF", 3,.T.)
while ! Eof()
DEFINE METROBUTTON oBtn OF oMetro ;
PROMPT FieldGet( 1 ) COLOR CLR_WHITE, RGB( 2, 174, 224 ) ; // 1 primer campo
IMAGE "..\bitmaps\metro\files.bmp" ;
ACTION ShowRecords( ::Cargo )
oBtn:Cargo = RecNo()
DbSkip()
end
DEFINE METROBUTTON OF oMetro ;
PROMPT "Exit" COLOR CLR_WHITE, RGB( 2, 174, 224 ) ;
IMAGE "..\bitmaps\metro\exit.bmp" ;
ACTION If( MsgYesNo( "Want to exit ?" ), oMetro:End(),)
ACTIVATE METRO oMetro
dá error: Error description: Error description: Error BASE/1005 Class: 'NIL' has no property: CARGO
se retirar : oBtn:Cargo = RecNo() mostra bem os metrobutton mas quando clico num dá erro:
Error BASE/1003 Variable does not exist: SELF
Gracias