Clipper On Line • Ver Tópico - Testes fora do normal

Testes fora do normal

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

 

Testes fora do normal

Mensagempor JoséQuintas » 05 Nov 2021 20:34

#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, multithread, dbfcdx, ADO+MySql, PNotepad
"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 de usuário

JoséQuintas
Membro Master

Membro Master
 
Mensagens: 18156
Data de registro: 26 Fev 2007 11:59
Cidade/Estado: São Paulo-SP
Curtiu: 15 vezes
Mens.Curtidas: 1215 vezes

Testes fora do normal

Mensagempor JoséQuintas » 05 Nov 2021 20:47

Nem com herança a HMAINWINDOW.
E nem removendo multithread.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg, multithread, dbfcdx, ADO+MySql, PNotepad
"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 de usuário

JoséQuintas
Membro Master

Membro Master
 
Mensagens: 18156
Data de registro: 26 Fev 2007 11:59
Cidade/Estado: São Paulo-SP
Curtiu: 15 vezes
Mens.Curtidas: 1215 vezes

Testes fora do normal

Mensagempor Fernando queiroz » 05 Nov 2021 20:50

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
Fernando queiroz
Usuário Nível 4

Usuário Nível 4
 
Mensagens: 737
Data de registro: 12 Nov 2014 23:41
Cidade/Estado: Porto Alegre/RS
Curtiu: 12 vezes
Mens.Curtidas: 58 vezes

Testes fora do normal

Mensagempor JoséQuintas » 05 Nov 2021 22:06

Vou deixar isso no meu teste, pra não esquecer.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg, multithread, dbfcdx, ADO+MySql, PNotepad
"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 de usuário

JoséQuintas
Membro Master

Membro Master
 
Mensagens: 18156
Data de registro: 26 Fev 2007 11:59
Cidade/Estado: São Paulo-SP
Curtiu: 15 vezes
Mens.Curtidas: 1215 vezes




Retornar para HwGui

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 4 visitantes


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro