Page 2 of 2

Re: Usando GUI y CUI juntos

PostPosted: Fri Aug 10, 2012 1:37 pm
by TOTOVIOTTI
Ahhh, la GTWVW.LIB... pero ya la encontré y no la puedo hacer funcionar...
Alguna idea de como poder aplicar la GUICUI a xHarbour?

Re: Usando GUI y CUI juntos

PostPosted: Sat Aug 11, 2012 2:49 pm
by Antonio Linares
Solo hemos conseguido hacerlo funcionar con Harbour

Re: Usando GUI y CUI juntos

PostPosted: Mon Aug 13, 2012 8:34 pm
by MGA
Sr Antonio,

como ficaria:

READ
IF LASTKEY()==27
ENDIF

Testei e não funcionou!

Re: Usando GUI y CUI juntos

PostPosted: Mon Aug 13, 2012 9:27 pm
by Antonio Linares
SGS,

En modo consola ó en FWH ?

Puedes poner un ejemplo de que lo que estas probando ?

En FWH se usa bKeyDown, etc

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 11:24 am
by MGA
Sr. Antonio em modo console, ex:

#include "FiveWin.ch"
#include "hbgtinfo.ch"
#include "std.ch"

REQUEST HB_GT_WVT

function Main()

local oWnd

DEFINE WINDOW oWnd TITLE "Main FWH Window"

ACTIVATE WINDOW oWnd ;
ON INIT Child( oWnd ) ;
ON CLICK Child( oWnd )

return nil

function Child( oWnd )

local cFirst := Space( 10 ), cLast := Space( 10 ), GetList := {}
local pGT := hb_gtCreate( 'WVT' )

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. )

SetMode( 25, 80 )
SET COLOR TO "W+/B"
CLS

@ 1, 2 SAY "First:" GET cFirst
@ 3, 3 SAY "Last:" GET cLast // VALID ( ReadExit(), .T. )

READ
IF LASTKEY()==27
ALERT("TESTE TECLA ESC")
ENDIF

HB_GTEXIT()

return nil

#pragma BEGINDUMP

#include <hbapigt.h>

HB_FUNC( HB_GTEXIT )
{
hb_gtExit();
}

#pragma ENDDUMP

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 12:00 pm
by Antonio Linares
SGS,

Please remove this line from FiveWin.ch:


#xtranslate LastKey( => _LastKey( // to avoid conflicts with Harbour functions

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 12:28 pm
by MGA
Sr. Antonio,

Funcionou perfeitamente!!! :)

Agora estou testando:

@ 14, 2 prompt "teste1"
@ 15, 2 prompt "teste2"
menu to nopcao

e parece ter problemas tambem! :(

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 1:42 pm
by Antonio Linares
Try to remove all these lines from FiveWin.ch

#xtranslate SetCursor( => WSetCursor( // to avoid conflicts with Harbour functions
#xtranslate __Keyboard( => ___Keyboard( // to avoid conflicts with Harbour functions
#xtranslate LastKey( => _LastKey( // to avoid conflicts with Harbour functions

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 1:57 pm
by MGA
Sr. Antonio:

fivewin.ch
...
/*
#xtranslate SetCursor( => WSetCursor( // to avoid conflicts with Harbour functions
#xtranslate __Keyboard( => ___Keyboard( // to avoid conflicts with Harbour functions
#xtranslate LastKey( => _LastKey( // to avoid conflicts with Harbour functions
*/
...

e tambem:

/*
#xcommand @ <nRow>, <nCol> PROMPT <*u*> =>
#xcommand MENU TO <u> =>
*/





Error occurred at: 08/14/12, 10:49:25
Error description: Error BASE/1004 No exported method: LFOCUSED
Args:
[ 1] = N 0

Stack Calls
===========
Called from: => LFOCUSED( 0 )
Called from: .\source\function\VALBLANK.PRG => (b)READVAR( 37 )
Called from: => ASCAN( 0 )
Called from: .\source\function\VALBLANK.PRG => READVAR( 37 )
Called from: ../../../menuto.prg => __MENUTO( 0 )
Called from: guicui.prg => CHILD( 76 )
Called from: guicui.prg => (b)MAIN( 17 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 465 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 656 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1407 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 980 )
Called from: guicui.prg => MAIN( 20 )

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 2:12 pm
by Antonio Linares
Tienes que quitar la función ReadVar() que está en FWH\source\function\VALBLANK.PRG

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 4:40 pm
by MGA
Sr. Antonio,

fiz assim:

Em guicui.prg

function readvar()
return nil

Funcionou perfeitamente :)

vou seguir com os testes!

Re: Usando GUI y CUI juntos

PostPosted: Tue Aug 14, 2012 6:16 pm
by MGA
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