Testes fora do normal

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Testes fora do normal

Mensagem por JoséQuintas »

Código: Selecionar todos

#include "hbclass.ch"
#include "hbgtinfo.ch"
#include "hwgui.ch"
#define ZE_HSTYLE_OWNER 1
#define ZE_BACKCOLOR    2

#define HB_GTI_EXTENDED                   1000
#define HB_GTI_NOTIFIERBLOCKGUI           ( HB_GTI_EXTENDED + 10 )

//ANNOUNCE HB_GTSYS
REQUEST HB_GT_WVG_DEFAULT

THREAD STATIC MainWVT

FUNCTION Main
   hb_ThreadStart( { || Main2() } )
   hb_ThreadWaitForAll()
   RETURN Nil


FUNCTION Main2()

   LOCAL nKey := 0, cCaption, nRow, nCol, oBtn, bCode, nGt

   hb_gtReload( "WVG" )
   SetMode(40,100)
   SetColor( "W/B" )
   CLS
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Hello"
   ? "Press <ESC> key to terminate program"
   nGt := Maingt()
   nRow := 10
   nCol := 10
   FOR EACH cCaption IN { "Consulta", "Altera", "Exclui", "Inclui", "Primeiro", "Último", "Anterior", "Seguinte", "Sair" }
      bCode := { || Nil }
      @ nCol, nRow OWNERBUTTON oBtn SIZE 55,55 ;
         ON CLICK bCode ;
         TEXT cCaption COORDINATES 5,35, 5, 40 ;
         Tooltip cCaption
      oBtn:aStyle := ze_Style( ZE_HSTYLE_OWNER )
      nCol += 60
   NEXT

   DO WHILE nKey != 27
      nKey := Inkey(1)
   ENDDO
   (nGt)

   RETURN Nil

//PROCEDURE HB_GTSYS
//   REQUEST HB_GT_WVG_DEFAULT
//   RETURN

FUNCTION AppUserName(); RETURN ""
FUNCTION AppVersaoExe(); RETURN ""

FUNCTION MainGT()

   IF Empty( MainWVT )
      MainWVT := HGT():New()
      MainWVT:Handle := hb_gtInfo( HB_GTI_WINHANDLE )
      hb_gtInfo( HB_GTI_NOTIFIERBLOCKGUI, { | nEvent, ... | MainWVT:OnEvent( nEvent, ... ) } )
      //MainWVT:IsGT := .T.
   ENDIF

   RETURN MainWVT

FUNCTION ze_Style( nStyle )

   LOCAL xValue

   DO CASE
   CASE nStyle == ZE_HSTYLE_OWNER
      xValue := { ;
         HStyle():New( { ze_Style( ZE_BACKCOLOR ) }, 1 ), ;   /* normal color */
         HStyle():New( { ze_Style( ZE_BACKCOLOR ) }, 1,, 3, 0 ), ;       /* click color */
         HStyle():New( { 16759929, 16771062 }, 1,, 2, 12164479 ) } /* over color */
   CASE nStyle == ZE_BACKCOLOR
      xValue := 15790720
   ENDCASE

   RETURN xValue

CLASS HGT INHERIT HWindow
METHOD New() INLINE ::Super:New() , ::Handle := hb_gtInfo(HB_GTI_WINHANDLE), Self
ENDCLASS

FUNCTION HB_GT_GUI; RETURN Nil
FUNCTION HB_GT_GUI_DEFAULT; RETURN Nil
Necessita compilar com hbmk2 test hwgui.hbc gtwvg.hb -w0
hwgui.png
Quase deu certo.
O exemplo original testhgt fazia herança com HMAINWINDOW e não HWINDOW.
No exemplo atual da HWGUI eram outros buttons, aqui é com owner button.
Ao clicar em qualquer button, todos os buttons somem, assim como acontece com alguns buttons do exemplo na hwgui.

É um teste totalmente fora do padrão.
"Talvez" o problema seja o tipo de janela ::oParent, que não serve pra "segurar" esses controles.
E a main servia.

Foi um teste, pensando na possibilidade de trocar wvg por hwgui mais rápido.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, 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/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Testes fora do normal

Mensagem por JoséQuintas »

Nem com herança a HMAINWINDOW.
E nem removendo multithread.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, 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/
Fernando queiroz
Usuário Nível 4
Usuário Nível 4
Mensagens: 779
Registrado em: 13 Nov 2014 00:41
Localização: Porto Alegre/RS

Testes fora do normal

Mensagem por Fernando queiroz »

pode tambem colocar o FONT ai fica com o tamanho certo nos TEXT
EX:

@ 4,32 OWNERBUTTON oButton1_1 OF oPanel1;
ON CLICK {|| lAbreCadastros:=.F., oPanel1:Hide( ), ProdutosClass():new(oServer):Produtos_Manutencao()} ;
SIZE 80,60 FLAT ;
TEXT 'Produtos' COLOR 16777215 FONT HFont():Add( '',0,-10,400,,,);
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource("product-256-30") ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Cadastro de Produtos'
oButton1_1:aStyle := OwnerbuttonStyle
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Testes fora do normal

Mensagem por JoséQuintas »

Vou deixar isso no meu teste, pra não esquecer.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, 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/
Responder