Page 1 of 1

xBrowse not showing at all with MinGw and Harbour

Posted: Wed Oct 26, 2011 3:55 pm
by concentra
I am triing to program a browse using xBrowse without success.
The window shows up empty with no messages at all.
I was unable to figure out what am I doing wrong...
I am using FiveWin with MinGw and Harbour.
I made a small self contained sample of what I am coding.
Could someone inspect the code above and point what's wrong ?

Code: Select all

Function Main()

   #include "fivewin.ch"
   #include "xbrowse.ch"

   DBCREATE( "BTESTE.DBF", { { "CODIGO"    , "C", 08, 00 },;
                             { "DESCRICAO" , "C", 40, 00 } } )

   USE BTESTE.DBF EXCLUSIVE ALIAS BTESTE

   FOR I:=1 TO 200
     BTESTE->( DBAPPEND() )
     BTESTE->CODIGO     := STRZERO(I,8)
     BTESTE->DESCRICAO  := REPLICATE("X",MOD(I,39)+1)
   NEXT

   BTESTE -> ( DBGOTOP() )

   oDLG := TWINDOW():NEW( 0, 0, 50, 100 ,"xBrowse Test" )

   @ 0,0 XBROWSE oBRW ALIAS "BTESTE" OF oDLG

   ADD COLUMN TO oBRW TITLE "CODIGO"    DATA BTESTE->CODIGO    SIZE  80
   ADD COLUMN TO oBRW TITLE "DESCRICAO" DATA BTESTE->DESCRICAO SIZE 320

   ACTIVATE WINDOW oDLG

   CLOSE DATABASES

RETURN

Re: xBrowse not showing at all with MinGw and Harbour

Posted: Thu Oct 27, 2011 4:41 am
by anserkk
You missed the code :)

Code: Select all

oBrw:CreateFromCode()

Code: Select all

#include "fivewin.ch"
#include "xbrowse.ch"
Function Main()
   DBCREATE( "BTESTE.DBF", { { "CODIGO"    , "C", 08, 00 },;
                             { "DESCRICAO" , "C", 40, 00 } } )

   USE BTESTE.DBF EXCLUSIVE ALIAS BTESTE

   FOR I:=1 TO 200
     BTESTE->( DBAPPEND() )
     BTESTE->CODIGO     := STRZERO(I,8)
     BTESTE->DESCRICAO  := REPLICATE("X",MOD(I,39)+1)
   NEXT

   BTESTE -> ( DBGOTOP() )

   oDLG := TWINDOW():NEW( 0, 0, 50, 100 ,"xBrowse Test" )

   @ 0,0 XBROWSE oBRW ALIAS "BTESTE" OF oDLG SIZE 0,0

   ADD COLUMN TO oBRW TITLE "CODIGO"    DATA BTESTE->CODIGO    SIZE  80
   ADD COLUMN TO oBRW TITLE "DESCRICAO" DATA BTESTE->DESCRICAO SIZE 320
   
   oBrw:CreateFromCode()

   ACTIVATE WINDOW oDLG

   CLOSE DATABASES

RETURN
Regards
Anser

Re: xBrowse not showing at all with MinGw and Harbour

Posted: Thu Oct 27, 2011 9:11 am
by concentra
Very thanks Anser !
Thats it.