Page 1 of 1

Using GUI and CUI together

Posted: Tue Oct 18, 2011 12:25 pm
by Antonio Linares
Thanks to Rafa Carmona, with some changes from my side, here you have an example of how to mix FWH GUI with CUI (character-based user interface):

You have to link the corresponding GT lib:
...
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\gtwvt.lib + >> b32.bc
...

guicui.prg

Code: Select all

#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
   
   HB_GTEXIT()

return nil   

#pragma BEGINDUMP

#include <hbapigt.h>

HB_FUNC( HB_GTEXIT )
{
   hb_gtExit();
}   

#pragma ENDDUMP
Image

Re: Using GUI and CUI together

Posted: Tue Oct 18, 2011 4:31 pm
by servulo
Hello Antonio, I care but when trying to compile this example with FWH 11.09 including the line:

hdirl echo%% \ gtwvt.lib +>> b32.bc

in buildx.bat

it does not recognize the functions of HG_GT

sorry my bad english...

Re: Using GUI and CUI together

Posted: Tue Oct 18, 2011 5:17 pm
by Antonio Linares
We have tested it with Harbour only, including in buildh.bat:

echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\gtwvt.lib + >> b32.bc <<--- this one

Re: Using GUI and CUI together

Posted: Tue Oct 18, 2011 7:11 pm
by servulo
Antonio, I tried compiling with FiveWin 11.09 and harbor 2.1 worked perfectly

Thank you for your attention ...