Bostaurus

GTWVG com API Windows somente no Harbour.
No Harbouir 3.4 está sendo usado pointer, aonde no 3.2 é numérico.

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

Bostaurus

Mensagem por JoséQuintas »

Como resolver estes erros ao compilar bostaurus?
O último impede a criação
d:\temp\bostaurus\comp>HBMK2 *.c *.prg *.rc -m -n -w3 -es2 -workdir=c:\temp -compr -strip -mt -quiet -ge1 -Id:\cdrom\FONTES\build\
Harbour 3.4.0dev (a99df380e2) (2018-04-08 08:03)
Copyright (c) 1999-2018, https://github.com/JoseQuintas/harbour34/
Compiling 'h_BosTaurus.prg'...
Lines 945, Functions/Procedures 70
Generating C source output to 'c:\temp\h_BosTaurus.c'... Done.
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_DC_CREATE':
d:/temp/bostaurus/comp/c_BosTaurus.c:754:31: warning: implicit declaration of function 'HMG_parnl'; did you mean 'hb_parnl'? [-Wimplicit-function-declaration]
BT.hWnd = (HWND) HMG_parnl (2);
^~~~~~~~~
hb_parnl
d:/temp/bostaurus/comp/c_BosTaurus.c:782:4: warning: implicit declaration of function 'HMG_storvnl'; did you mean 'hb_storvnl'? [-Wimplicit-function-declaration]
HMG_storvnl ((LONG_PTR) BT.hWnd, -1, 2); // hWnd
^~~~~~~~~~~
hb_storvnl
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_DC_DELETE':
d:/temp/bostaurus/comp/c_BosTaurus.c:811:25: warning: implicit declaration of function 'HMG_parvnl'; did you mean 'hb_parvnl'? [-Wimplicit-function-declaration]
BT.hWnd = (HWND) HMG_parvnl (1, 2);
^~~~~~~~~~
hb_parvnl
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_SCR_GETDESKTOPHANDLE':
d:/temp/bostaurus/comp/c_BosTaurus.c:866:4: warning: implicit declaration of function 'HMG_retnl'; did you mean 'hb_retnl'? [-Wimplicit-function-declaration]
HMG_retnl ((LONG_PTR) hWnd);
^~~~~~~~~
hb_retnl
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_DRAW_HDC_TEXTOUT':
d:/temp/bostaurus/comp/c_BosTaurus.c:1357:29: warning: implicit declaration of function 'HMG_parc'; did you mean 'hb_parc'? [-Wimplicit-function-declaration]
Text = (TCHAR *) HMG_parc (4);
^~~~~~~~
hb_parc
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_REGIONCOMBINE':
d:/temp/bostaurus/comp/c_BosTaurus.c:3421:10: warning: implicit declaration of function 'HMG_stornl'; did you mean 'hb_stornl'? [-Wimplicit-function-declaration]
HMG_stornl ((LONG_PTR) hRgnDest, 1);
^~~~~~~~~~
hb_stornl
d:/temp/bostaurus/comp/c_BosTaurus.c: At top level:
d:/temp/bostaurus/comp/c_BosTaurus.c:3442:23: error: expected ')' before string constant
"Shell32.dll", // dll name
^~~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3485:23: error: expected ')' before string constant
"Shlwapi.dll",
^~~~~~~~~~~~~
In file included from d:/harbour/comp/mingw64/x86_64-w64-mingw32/include/shlobj.h:124:0,
from d:/temp/bostaurus/comp/c_BosTaurus.c:60:
d:/temp/bostaurus/comp/c_BosTaurus.c: In function 'HB_FUN_BT_DIRECTORYINFO':
d:/temp/bostaurus/comp/c_BosTaurus.c:3605:69: warning: implicit declaration of function 'HMG_ToUnicode'; did you mean 'ToUnicode'? [-Wimplicit-function-declaration]
hr = IShellFolder2_ParseDisplayName (psfDeskTop, NULL, NULL, HMG_ToUnicode(cPath), &chEaten, &pidlFolders, NULL);
^
d:/temp/bostaurus/comp/c_BosTaurus.c:3605:69: warning: passing argument 4 of 'psfDeskTop->lpVtbl->ParseDisplayName' makes pointer from integer without a cast [-Wint-conversion]
d:/temp/bostaurus/comp/c_BosTaurus.c:3605:69: note: expected 'LPWSTR {aka short unsigned int *}' but argument is of type 'int'
d:/temp/bostaurus/comp/c_BosTaurus.c:3613:12: warning: implicit declaration of function 'win_StrRetToBuf' [-Wimplicit-function-declaration]
win_StrRetToBuf(&strDispName, pidlItems, cParsingName, MAX_PATH);
^~~~~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3614:12: warning: implicit declaration of function 'HMG_storc'; did you mean 'hb_storc'? [-Wimplicit-function-declaration]
HMG_storc (cParsingName, 4);
^~~~~~~~~
hb_storc
d:/temp/bostaurus/comp/c_BosTaurus.c:3682:60: warning: implicit declaration of function 'HMG_WCHAR_TO_CHAR'; did you mean 'HB_CHAR_CR'? [-Wimplicit-function-declaration]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_NAME, HMG_WCHAR_TO_CHAR (cDisplayData) );
^~~~~~~~~~~~~~~~~
HB_CHAR_CR
d:/temp/bostaurus/comp/c_BosTaurus.c:3682:60: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3686:60: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_DATE, HMG_WCHAR_TO_CHAR (bt_SpaceToBlank(cDisplayData)) );
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3691:60: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_TYPE, HMG_WCHAR_TO_CHAR (bt_SpaceToBlank(cDisplayData)) );
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3695:60: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_SIZE, HMG_WCHAR_TO_CHAR (bt_SpaceToBlank(cDisplayData)) );
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3699:64: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_FULLNAME, HMG_WCHAR_TO_CHAR (cFullPath) );
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3701:73: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_INTERNALDATA_TYPE, HMG_WCHAR_TO_CHAR (cInternalType) ); // D+ | D- | F
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
d:/temp/bostaurus/comp/c_BosTaurus.c:3703:10: warning: implicit declaration of function 'bt_LocalDateTimeToDateTimeANSI'; did you mean 'LocalFileTimeToFileTime'? [-Wimplicit-function-declaration]
bt_LocalDateTimeToDateTimeANSI (cDateTime);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LocalFileTimeToFileTime
d:/temp/bostaurus/comp/c_BosTaurus.c:3704:73: warning: passing argument 3 of 'hb_arraySetC' makes pointer from integer without a cast [-Wint-conversion]
hb_arraySetC ( pSubarray, BT_DIRECTORYINFO_INTERNALDATA_DATE, HMG_WCHAR_TO_CHAR (cDateTime) ); // YYYY:MM:DD HH:MM:SS
^~~~~~~~~~~~~~~~~
In file included from d:/temp/bostaurus/comp/c_BosTaurus.c:67:0:
d:/harbour/include/hbapi.h:846:31: note: expected 'const char *' but argument is of type 'int'
extern HB_EXPORT HB_BOOL hb_arraySetC( PHB_ITEM pArray, HB_SIZE nIndex, const char * szText );
^~~~~~~~~~~~
hbmk2: Error: Running C/C++ compiler. 1
BosTaurus.zip
(32.38 KiB) Baixado 461 vezes
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/
Claudio Soto
Colaborador
Colaborador
Mensagens: 566
Registrado em: 27 Ago 2012 12:31
Localização: Uruguay
Contato:

Bostaurus

Mensagem por Claudio Soto »

Las definiciones que faltan estan en el archivo de cabecera
#include "HMG_UNICODE.h"
que debe ser llamado dentro del archivo
c_BosTaurus.c

el archivo de cabecera esta en la carpeta
C:\hmg.3.4.4\include
Saludos.
Dr. Claudio Soto
(Uruguay)
http://srvet.blogspot.com
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bostaurus

Mensagem por JoséQuintas »

Deu certo.
No final, só precisei substituir RGB() por wapi_RGB()

Só fiquei na dúvida sobre esta parte, se mantenho ou retiro:

#define COMPILE_HMG_UNICODE
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

Bostaurus

Mensagem por JoséQuintas »

Primeiro protótipo.
Mas para o teste em gtwvg, precisa de josequintas.hbc por causa do retângulo.
Só para compilar o test.prg, não pra Bostaurus

Nota: a intenção era que o texto ficasse dentro de cada retângulo, mas ao que parece ficou fora.
bostaurus.zip
(41.69 KiB) Baixado 500 vezes
bostaurus.png
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

Bostaurus

Mensagem por JoséQuintas »

Reduzi o tamanho da letra.
Mas fiquei sem entender se o texto está na janela de cima ou de baixo... rs

Nota importante:
Acontece o problema normal da WVG: o texto na janela comum tem prioridade sobre gráfico
Então, se mover janela, acontece o mesmo que com DrawText() ou DrawImage(), o que é imagem some.
Por isso não entendi se a parte gráfica está na janela normal, na janela de cada controle, ou encima de tudo.
bostaurus.png
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

Bostaurus

Mensagem por JoséQuintas »

Um dos exemplos da Bostaurus existente na OOHG, pasta samples\bostaurus:
oohg1.png
oohg2.png
oohg3.png
oohg4.png
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
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Quintas.

Aproveitando o seu exemplo consegui usar a bostaurus com a HwGui
HwGui / BosTaurus
HwGui / BosTaurus

Código: Selecionar todos

#include "hwgui.ch"
#include "bostaurus.ch"
#include "i_color.ch"

STATIC Thisform

FUNCTION TesteBos( ... )
RETURN _TesteBos( HB_AParams() )

FUNCTION _TesteBos(  )
LOCAL oDlg,  oButtonex1


   INIT DIALOG oDlg ;
               TITLE "Teste com BosTaurus" ;
               AT 0, 0 ;
               SIZE 887,460 ;
               FONT HFont():Add( 'Tahoma',0,-13,400,,,) ;
               NOEXIT  ;
               STYLE WS_POPUP + WS_CAPTION + WS_SYSMENU + DS_CENTER ;
               ON PAINT {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oDlg:handle) ), Proc_On_Paint( 1, __xhb_p2n(oDlg:handle) ) } 
        
    Thisform := oDlg

   @ 401,418 BUTTONEX oButtonex1 CAPTION "Sair"   SIZE 98,32 ;
        STYLE BS_CENTER +WS_TABSTOP  ;
        ON CLICK {|| oDlg:Close() }
  
   ACTIVATE DIALOG oDlg 


RETURN oDlg:lresult

PROCEDURE Proc_ON_PAINT( Cont, n_hWnd )

   LOCAL Width  := BT_ClientAreaWidth( n_hWnd )
   LOCAL Height := BT_ClientAreaHeight( n_hWnd )
   LOCAL hDC, BTstruct, nAlignText, nTypeText

   hDC = BT_CreateDC ( n_hWnd, BT_HDC_INVALIDCLIENTAREA, @BTstruct)

   DO CASE
   CASE cont = 1
      BT_DrawGradientFillHorizontal (hDC, 0,       0, Width/2, Height, BLACK, BLUE)
      BT_DrawGradientFillHorizontal (hDC, 0, Width/2, Width/2, Height, BLUE,  BLACK)

   CASE cont = 2
      BT_DrawGradientFillVertical (hDC,        0,   0, Width, Height/2, BLACK, RED)
      BT_DrawGradientFillVertical (hDC, Height/2,   0, Width, Height/2, RED,   BLACK)

   CASE cont = 3
      BT_DrawGradientFillVertical (hDC,        0,   0, Width, Height/2, RED,   GREEN)
      BT_DrawGradientFillVertical (hDC, Height/2,   0, Width, Height/2, GREEN, BLUE)

   CASE cont = 4
      BT_DrawGradientFillHorizontal (hDC, 0,       0, Width/2, Height, GREEN, BLUE)
      BT_DrawGradientFillHorizontal (hDC, 0, Width/2, Width/2, Height, BLUE,  RED)

   CASE cont = 5
      BT_DrawGradientFillVertical   (hDC,   0,       0,  Width,  Height, WHITE, BLACK)

   CASE cont = 6
      BT_DrawGradientFillHorizontal (hDC,   0,       0,  Width,  Height, {100,0,123}, BLACK)

   END CASE

   nTypeText  := BT_TEXT_TRANSPARENT + BT_TEXT_BOLD + BT_TEXT_ITALIC + BT_TEXT_UNDERLINE
   nAlignText := BT_TEXT_CENTER + BT_TEXT_BASELINE
   BT_DrawText (hDC, Height/2-3, Width/2+3, "The Power of HMG / HWGUI", "Comic Sans MS", 42, GRAY, BLACK, nTypeText, nAlignText ) // Shadow Effect
   BT_DrawText (hDC, Height/2, Width/2, "The Power of HMG / HWGUI", "Comic Sans MS", 42, YELLOW, BLACK, nTypeText, nAlignText )

   BT_DeleteDC (BTstruct)

   RETURN
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Créditos ao Dr Claudio Soto (código original)
2018-04-27 21_47_33-Teste com BosTaurus.png
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Bostaurus

Mensagem por JoséQuintas »

Muito legal.

Era nesse sentido que eu falava de acrescentar coisas na GTWVG.
A Bostaurus é um exemplo do que poderia ser acrescentado, e já ficar disponível pra todos, não apenas pra GTWVG.
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/
Claudio Soto
Colaborador
Colaborador
Mensagens: 566
Registrado em: 27 Ago 2012 12:31
Localização: Uruguay
Contato:

Bostaurus

Mensagem por Claudio Soto »

Muy bueno los ejemplos, esa era la idea original, que como la BT trabaja sólo con handle de Windows pudiese ser adaptada y ampliada fácilmente.
JoséQuintas escreveu: Só fiquei na dúvida sobre esta parte, se mantenho ou retiro:

#define COMPILE_HMG_UNICODE
Esto es para forzar a compilar en Unicode. Al estar en Unicode se puede trabajar con la misma lib tanto en ANSI como en Unicode únicamente cambiando el codepage de HB
Saludos.
Dr. Claudio Soto
(Uruguay)
http://srvet.blogspot.com
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Mais exemplos com HwGui

Janela Main e Dialog

Código: Selecionar todos

#include "hwgui.ch"
#include "bostaurus.ch"
#include "i_color.ch"

THREAD STATIC Thisform

FUNCTION MAIN

   TesteBosDialog()
   TesteBosMain()
   
RETURN Nil

FUNCTION TesteBosDialog()
LOCAL oDlg,  oButtonex1

   INIT DIALOG oWin ;
               TITLE "Teste com BosTaurus" ;
               AT 0, 0 ;
               SIZE 1024, 700 ;
               FONT HFont():Add( 'Tahoma', 0, -13, 400 ) ;
               NOEXIT  ;
               STYLE WS_POPUP + WS_CAPTION + WS_SYSMENU + DS_CENTER //; 
               //ON PAINT {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oWin:handle) ), Proc_On_Paint( 1, __xhb_p2n(oWin:handle) ) } 
  
   Thisform := oWin

   x1 := Int( oWin:nWidth / 2 ) - 100
   
   @ x1,oWin:nHeight - 85 BUTTONEX oButtonex1 ;
             CAPTION "Sair" ;
             SIZE 98,32 ;
             STYLE BS_CENTER + WS_TABSTOP ;
             ON CLICK {|| oWin:Close() }
  
   ACTIVATE DIALOG oWin ON ACTIVATE {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oWin:handle) ), ;
                                        Proc_On_Paint( 1, __xhb_p2n(oWin:handle) ) }
   
RETURN Nil

FUNCTION TesteBosMain()

   INIT WINDOW oWin ;
               MAIN ;
               TITLE "Teste com BosTaurus" ;
               AT 0, 0 ;
               SIZE hwg_GetDeskTopWidth(), hwg_GetDeskTopHeight() ;
               FONT HFont():Add( 'Tahoma', 0, -13, 400 ) ;
               STYLE WS_POPUP + WS_CAPTION + WS_SYSMENU 

   Thisform := oWin

   x1 := Int( oWin:nWidth / 2 ) - 100
   
   @ x1,oWin:nHeight - 110 BUTTONEX oButtonex1 ;
             CAPTION "Sair" ;
             SIZE 98,32 ;
             STYLE BS_CENTER + WS_TABSTOP ;
             ON CLICK {|| oWin:Close() }
   
   ACTIVATE WINDOW oWin MAXIMIZED CENTER ON ACTIVATE {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oWin:handle) ), ;
                                                         Proc_On_Paint( 1, __xhb_p2n(oWin:handle) ) }
RETURN Nil

PROCEDURE Proc_ON_PAINT( Cont, n_hWnd )

   LOCAL Width  := BT_ClientAreaWidth( n_hWnd )
   LOCAL Height := BT_ClientAreaHeight( n_hWnd )
   LOCAL hDC, BTstruct, nAlignText, nTypeText

   hDC = BT_CreateDC ( n_hWnd, BT_HDC_INVALIDCLIENTAREA, @BTstruct)

   DO CASE
   CASE cont = 1
      BT_DrawGradientFillHorizontal (hDC, 0,       0, Width/2, Height, BLACK, BLUE)
      BT_DrawGradientFillHorizontal (hDC, 0, Width/2, Width/2, Height, BLUE,  BLACK)

   CASE cont = 2
      BT_DrawGradientFillVertical (hDC,        0,   0, Width, Height/2, BLACK, RED)
      BT_DrawGradientFillVertical (hDC, Height/2,   0, Width, Height/2, RED,   BLACK)

   CASE cont = 3
      BT_DrawGradientFillVertical (hDC,        0,   0, Width, Height/2, RED,   GREEN)
      BT_DrawGradientFillVertical (hDC, Height/2,   0, Width, Height/2, GREEN, BLUE)

   CASE cont = 4
      BT_DrawGradientFillHorizontal (hDC, 0,       0, Width/2, Height, GREEN, BLUE)
      BT_DrawGradientFillHorizontal (hDC, 0, Width/2, Width/2, Height, BLUE,  RED)

   CASE cont = 5
      BT_DrawGradientFillVertical   (hDC,   0,       0,  Width,  Height, WHITE, BLACK)

   CASE cont = 6
      BT_DrawGradientFillHorizontal (hDC,   0,       0,  Width,  Height, {100,0,123}, BLACK)

   END CASE

   nTypeText  := BT_TEXT_TRANSPARENT + BT_TEXT_BOLD + BT_TEXT_ITALIC + BT_TEXT_UNDERLINE
   nAlignText := BT_TEXT_CENTER + BT_TEXT_BASELINE
   BT_DrawText (hDC, Height/2-3, Width/2+3, "The Power of BOSTAURUS / HWGUI", "Tahoma", 30, GRAY, BLACK, nTypeText, nAlignText ) // Shadow Effect
   BT_DrawText (hDC, Height/2, Width/2, "The Power of BOSTAURUS / HWGUI", "Tahoma", 30, YELLOW, BLACK, nTypeText, nAlignText )

   BT_DeleteDC (BTstruct)

   RETURN

#pragma BEGINDUMP

#include "windows.h"
#include "hbapi.h"

HB_FUNC (GETDESKTOPREALWIDTH) 
{
  RECT rect;
  SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );

  hb_retni(rect.right - rect.left);
}

HB_FUNC (GETDESKTOPREALHEIGHT) 
{
  RECT rect;
  SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );

  hb_retni(rect.bottom - rect.top);
}

#pragma ENDDUMP

►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Quintas,

Acontece o mesmo comportamento na HwGui quando minimiza/maximiza a janela a imagem bostaurus some. Na janela Dialog não acontece porque ela é modal.
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Resolvi:

ON SIZE {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oWin:handle) ), Proc_On_Paint( 1, __xhb_p2n(oWin:handle) ) } ;

Assim não some a janela.

Código: Selecionar todos

  INIT WINDOW oWin ;
               MAIN ;
               TITLE "Teste com BosTaurus" ;
               AT 0, 0 ;
               SIZE hwg_GetDeskTopWidth(), hwg_GetDeskTopHeight() ;
               FONT HFont():Add( 'Tahoma', 0, -13, 400 ) ;
               ON SIZE {|| BT_ClientAreaInvalidateAll( __xhb_p2n(oWin:handle) ), Proc_On_Paint( 1, __xhb_p2n(oWin:handle) ) } ;
               STYLE WS_CAPTION + WS_SYSMENU + WS_MAXIMIZEBOX
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Será que tem algo parecido como ON SIZE na GTWVG ? talvez resolva o problema de sumir a imagem
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Avatar do usuário
asimoes
Colaborador
Colaborador
Mensagens: 4919
Registrado em: 26 Abr 2007 16:48
Localização: RIO DE JANEIRO-RJ

Bostaurus

Mensagem por asimoes »

Tem muita diversão pro feriadão, rs.
2018-04-28 10_30_10-Greenshot.png
►Harbour 3.x | Minigui xx-x | HwGui◄
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)
Responder