O interesse em multithread foi despertado.
Vamos ver o que dá.
Desta vez apenas acrescentei exemplo.
Também entraram alterações hoje
Estão aí na lista.
Nota:
Wilfried entrou em contato por email, quer fazer testes em Linux e MacOs
Passei também o link do vídeo mostrando o aplicativo com GTWVG, FIVEWIN e HWGUI.
Isso é um pouco mais do que apenas usar hwgui com multithread.
hwgui e multithread
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
hwgui e multithread
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
hwgui e multithread
Pra quem ficou curioso:
Fonte relativamente simples
Algo extraordinário no fonte acima ? não
O outro fonte, dlgbrwdbf.prg, é um browse dbf simples em hwgui.
Pode até ser compilado sozinho, poderia ser qualquer fonte hwgui.
Peguei do exemplo ADO, que o Itamar complementou com DBF na época.
Fonte relativamente simples
Código: Selecionar todos
#include "hbgtinfo.ch"
#include "hwgui.ch"
FUNCTION Main()
LOCAL oDlg, nCont := 1
INIT DIALOG oDlg TITLE "ADO Example" ;
AT 200,0 SIZE 400,150
MENU OF oDlg
MENUITEM "&Exit" ACTION hwg_EndDialog()
MENUITEM "&Browse DBF" ACTION hb_ThreadStart( { || DoMt( nCont++ ) } )
ENDMENU
ACTIVATE DIALOG oDlg
hb_ThreadWaitForAll()
RETURN Nil
FUNCTION DoMt( nCont )
hb_gtReload( hb_gtInfo( HB_GTI_VERSION ) )
hwg_initProc() // init hwgui on thread
DlgBrwDbf( nCont )
RETURN Nil
O outro fonte, dlgbrwdbf.prg, é um browse dbf simples em hwgui.
Pode até ser compilado sozinho, poderia ser qualquer fonte hwgui.
Peguei do exemplo ADO, que o Itamar complementou com DBF na época.
Código: Selecionar todos
/*
* dlgbrwdbf.prg
* dbf browse
*/
#include "hwgui.ch"
FUNCTION DlgBrwDbf( nCont )
LOCAL oDlg, oBrowse, aList, aItem
SET EXCLUSIVE OFF
hb_Default( @nCont, 1 )
CreateDBF( "test" )
USE test
aList := { ;
{ "Name", { || field->Name } }, ;
{ "Adress", { || field->Address } } }
INIT DIALOG oDlg TITLE "DBF BROWSE " + Ltrim( Str( nCont ) ) AT 0,0 SIZE 1024,600
@ 20,10 BROWSE oBrowse DATABASE SIZE 780, 500 STYLE WS_BORDER + WS_VSCROLL + WS_HSCROLL
FOR EACH aItem IN aList
ADD COLUMN aItem[ 2 ] TO oBrowse HEADER aItem[ 1 ] LENGTH 30
NEXT
@ 500,540 BUTTON "Close" SIZE 180,36 ;
ON CLICK { || hwg_EndDialog() } // will close all
ACTIVATE DIALOG oDlg
CLOSE DATABASES
RETURN Nil
FUNCTION CreateDbf( cFileName )
LOCAL aList
IF hb_vfExists( cFileName + ".dbf" )
RETURN NIL
ENDIF
aList := { ;
{ "NAME", "C", 30, 0 }, ;
{ "ADDRESS", "C", 30, 0 } }
dbCreate( cFileName , aList )
USE ( cFileName )
APPEND BLANK
REPLACE field->name WITH "DBF_AAAA", field->address WITH "DBF_AAAA"
APPEND BLANK
REPLACE field->name WITH "DBF_BBBB", field->address WITH "DBF_BBBB"
APPEND BLANK
REPLACE field->name WITH "DBF_CCCC", field->address WITH "DBF_CCCC"
USE
RETURN NIL
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/