Usando GUI y CUI juntos

Re: Usando GUI y CUI juntos

Postby TOTOVIOTTI » Fri Aug 10, 2012 1:37 pm

Ahhh, la GTWVW.LIB... pero ya la encontré y no la puedo hacer funcionar...
Alguna idea de como poder aplicar la GUICUI a xHarbour?
Univ@c I.S.I.
Desarrolladores de Software
http://www.elcolegioencasa.edu.ar
User avatar
TOTOVIOTTI
 
Posts: 419
Joined: Fri Feb 05, 2010 11:30 am
Location: San Francisco - Córdoba - Argentina

Re: Usando GUI y CUI juntos

Postby Antonio Linares » Sat Aug 11, 2012 2:49 pm

Solo hemos conseguido hacerlo funcionar con Harbour
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Usando GUI y CUI juntos

Postby MGA » Mon Aug 13, 2012 8:34 pm

Sr Antonio,

como ficaria:

READ
IF LASTKEY()==27
ENDIF

Testei e não funcionou!
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Usando GUI y CUI juntos

Postby Antonio Linares » Mon Aug 13, 2012 9:27 pm

SGS,

En modo consola ó en FWH ?

Puedes poner un ejemplo de que lo que estas probando ?

En FWH se usa bKeyDown, etc
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Usando GUI y CUI juntos

Postby MGA » Tue Aug 14, 2012 11:24 am

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
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Usando GUI y CUI juntos

Postby Antonio Linares » Tue Aug 14, 2012 12:00 pm

SGS,

Please remove this line from FiveWin.ch:


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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Usando GUI y CUI juntos

Postby MGA » Tue Aug 14, 2012 12:28 pm

Sr. Antonio,

Funcionou perfeitamente!!! :)

Agora estou testando:

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

e parece ter problemas tambem! :(
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Usando GUI y CUI juntos

Postby Antonio Linares » Tue Aug 14, 2012 1:42 pm

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Usando GUI y CUI juntos

Postby MGA » Tue Aug 14, 2012 1:57 pm

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 )
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Usando GUI y CUI juntos

Postby Antonio Linares » Tue Aug 14, 2012 2:12 pm

Tienes que quitar la función ReadVar() que está en FWH\source\function\VALBLANK.PRG
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Usando GUI y CUI juntos

Postby MGA » Tue Aug 14, 2012 4:40 pm

Sr. Antonio,

fiz assim:

Em guicui.prg

function readvar()
return nil

Funcionou perfeitamente :)

vou seguir com os testes!
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Usando GUI y CUI juntos

Postby 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
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 29 guests