FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Usando GUI y CUI juntos
Posts: 470
Joined: Fri Feb 05, 2010 11:30 AM
Re: Usando GUI y CUI juntos
Posted: Fri Aug 10, 2012 01: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.ar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Usando GUI y CUI juntos
Posted: Sat Aug 11, 2012 02:49 PM

Solo hemos conseguido hacerlo funcionar con Harbour

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: Mon Aug 13, 2012 08: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Usando GUI y CUI juntos
Posted: Mon Aug 13, 2012 09: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
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Usando GUI y CUI juntos
Posted: 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
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Usando GUI y CUI juntos
Posted: Tue Aug 14, 2012 01: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
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: Tue Aug 14, 2012 01: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Usando GUI y CUI juntos
Posted: Tue Aug 14, 2012 02:12 PM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: Tue Aug 14, 2012 04: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
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: Usando GUI y CUI juntos
Posted: Tue Aug 14, 2012 06: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(&quot;TESTANDO MODO CONSOLE&quot;,80)

  ShowTime( 0, MaxCol()-8,,&quot;W+/B&quot; ,.T. , .T. )


  @ 1, 2 SAY &quot;First.............:&quot;  GET cFirst    VALID TestValid()
  @ 3, 2 SAY &quot;Last.(F2-KEY TEST):&quot;  GET cLast     when  TestWhen()
  READ
  if lastkey()==27
     exit
  endif

  @ 13,01 to 17,08 double

  nOpc:=1

  @ 14, 2 prompt &quot;Browse&quot; message 'browse Test'
  @ 15, 2 prompt &quot;DBedit&quot; message 'dbedit Test'
  @ 16, 2 prompt &quot;Sair  &quot; 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-&gt;first  }))
     otbr:addcolumn(tbcolumnnew('(LAST)'  ,{|| customer-&gt;last   }))
     otbr:addcolumn(tbcolumnnew('(STREET)',{|| customer-&gt;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

Continue the discussion