by MGA » Tue Aug 14, 2012 6:16 pm
Com ajuda do Sr. Antonio, fiz umas alterações:
// Add this line in buildh.bat
// echo %hdirl%\%GT%.lib + >> b32.bc
// echo %hdirl%\gtwvt.lib + >> b32.bc
#include "FiveWin.ch"
#include "hbgtinfo.ch"
#include "std.ch"
REQUEST HB_GT_WVT
STATIC OWND,OBAR
function Main()
DEFINE WINDOW oWnd TITLE "Main FWH Window - GUI y CUI juntos"
define buttonbar oBar size 94,64 3D of oWnd 2007
define button prompt "Console" of oBar border group action( Child( oWnd ))
define button prompt "Sair" of oBar border group action( oWnd:End() )
ACTIVATE WINDOW oWnd maximized
return nil
function Child( oWnd )
local cFirst := Space( 10 ), cLast := Space( 10 ), GetList := {}
local pGT := hb_gtCreate( 'WVT' ), nopc:=1, otbr
if !File('CUSTOMER.DBF')
MsgStop('Customer.dbf nao encontrado!','Atencao!')
return
endif
use customer.dbf alias customer
oWnd:Disable()
hb_gtSelect( pGT )
HB_GtInfo( HB_GTI_CODEPAGE, "ES850C" )
Hb_GtInfo( HB_GTI_FONTNAME, 'Lucida Console')
hb_gtInfo( HB_GTI_WINTITLE, "opciones CONSOLA en Windows" )
// HB_GtInfo( HB_GTI_CLOSABLE, .T. )
HB_GtInfo( HB_GTI_CLOSABLE, .f. ) //BOTAO DE FECHAMENTO NEUTRALIZADO
hb_gtInfo( HB_GTI_ICONFILE, "face.ico" )
hb_gtInfo( HB_GTI_WINTITLE, "GUICUI Test" )
// HB_GtInfo( HB_GTI_RESIZABLE, .F. ) REDIMENCIONAR TELA
// HB_GtInfo( HB_GTI_MAXIMIZED, .T. ) MAXIMIZAR TELA
SetMode( 25, 80 )
Set MESSAGE TO 23 CENTER
SetKey( -1, {|| ALERT("TEST F2") } )
DO WHILE .T.
SET COLOR TO "W+/B"
CLS
@ 00,00 SAY PADR("TESTANDO MODO CONSOLE",80)
ShowTime( 0, MaxCol()-8,,"W+/B" ,.T. , .T. )
@ 1, 2 SAY "First.............:" GET cFirst VALID TestValid()
@ 3, 2 SAY "Last.(F2-KEY TEST):" GET cLast when TestWhen()
READ
if lastkey()==27
exit
endif
@ 13,01 to 17,08 double
nOpc:=1
@ 14, 2 prompt "Browse" message 'browse Test'
@ 15, 2 prompt "DBedit" message 'dbedit Test'
@ 16, 2 prompt "Sair " message 'sair'
menu to nOpc
if nOpc=1
@ 11,14 to 21,71 double
otbr:=tbrowsedb(12,15,20,70)
otbr:addcolumn(tbcolumnnew('(FIRST)' ,{|| customer->first }))
otbr:addcolumn(tbcolumnnew('(LAST)' ,{|| customer->last }))
otbr:addcolumn(tbcolumnnew('(STREET)',{|| customer->street }))
do while .t.
do while !oTbr:stabilize(); end
nKey := inkey(0)
do case
case teclas(nkey,otbr)
loop
case nKey == 27
exit
endcase
enddo
elseif nOpc=2
dbedit()
else
exit
endif
enddo
HB_GTEXIT()
oWnd:Enable()
return nil
/*********************************/
static function Teclas(nKey,oTbr)
/*
*/
if nKey == 5
oTbr:up()
elseif nKey == 24
oTbr:down()
elseif nKey == 19
oTbr:left()
elseif nKey == 4
oTbr:right()
elseif nKey == 18
oTbr:pageup()
elseif nKey == 3
oTbr:pagedown()
elseif nKey == 1
oTbr:gotop()
elseif nKey == 6
oTbr:gobottom()
else
return(.f.)
endif
return(.t.)
/*****************************************/
static function TestValid()
/*
*/
Alert("Valid test")
return(.t.)
/*****************************************/
static function TestWhen()
/*
*/
Alert("When test")
return(.t.)
/*****************************************/
function ReadVar()
/*
*/
return nil
#pragma BEGINDUMP
#include <hbapigt.h>
HB_FUNC( HB_GTEXIT )
{
hb_gtExit();
}
#pragma ENDDUMP