FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour "REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 11:05 AM

James,

FWH uses a Windows standard control ("static") for the SAYs. This way standard static controls can be used from the resources editors.

I guess that TSSay implements a user defined control to solve those limitations.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 11:33 AM
James Bott wrote:Uwe,

>Like Antonio told you : You have to use ONPAINT, to solve your problem.

I think what JC is saying is that the 3rd-party product, sensitive SAY, does work without being called from ON PAINT, so it is techinically possible. He hopes that Antonio can achive the same with the native FW SAY. I hope so too.

James


Dear James,

That's it! With native say control, if works, is too much complicated!
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 11:36 AM
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 11:37 AM
JĂșlio,

Here you have a working example :-)

test.prg
#include "FiveWin.ch" 

function Main() 

   local oDlg, oBmp, oFont 

   DEFINE FONT oFont NAME "Verdana" SIZE 0, -16 BOLD

   DEFINE DIALOG oDlg RESOURCE "Test" COLOR "N/B"
   
   REDEFINE BITMAP oBmp ID 100 OF oDlg FILENAME "test.bmp"
   
   oBmp:bPainted = { | hDC | oBmp:Say( 12, 20, "Cadastro Plano de Contas",,, oFont, .T., .T. ) }

   ACTIVATE DIALOG oDlg CENTERED
   
   oFont:End()

return nil

test.rc
test DIALOG 98, 55, 185, 147
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 8, "MS Sans Serif"
{
 CONTROL "", 100, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, 0, -1, 185, 29
 DEFPUSHBUTTON "OK", 1, 67, 128, 50, 14
}

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 11:57 AM
Antonio, James, Uwe and friends!

It's works now! With very much strength!! :-)

This is my generic user function:
FUNCTION aplImage( oDlg, nId, cResNome, lTransparente, lStretch, cLabel )

LOCAL oBitmap

DEFAULT lTransparente := .F.            , ;
        cResNome      := "IMG_BARRA_TOP", ;
        nId           := 100            , ;
        lStretch      := .F.            , ;
        cLabel        := NIL


oBitmap := TBitmap():redefine( nId, cResNome,, oDlg,,,, lStretch,,,,,, lTransparente )

IF !empty( cLabel )
   oBitmap:bPainted = {|hDC| oBitmap:say( 12, 20, cLabel,,, TFont():new( "Tahoma", 0, 25,, .T. ), .T., .T. ) }
ENDIF

RETURN( oBitmap )
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 12:05 PM
Julio,

You have to modify your function as you are creating fonts and you are not releasing them:
FUNCTION aplImage( oDlg, nId, cResNome, lTransparente, lStretch, cLabel ) 

LOCAL oBitmap 

static oFont

DEFAULT lTransparente := .F.            , ; 
        cResNome      := "IMG_BARRA_TOP", ; 
        nId           := 100            , ; 
        lStretch      := .F.            , ; 
        cLabel        := NIL 

oBitmap := TBitmap():redefine( nId, cResNome,, oDlg,,,, lStretch,,,,,, lTransparente ) 

IF ! Empty( cLabel ) 
   if oFont == nil
      oFont = TFont():new( "Tahoma", 0, 25,, .T. )
   endif
   oBitmap:bPainted = {|hDC| oBitmap:Say( 12, 20, cLabel,,, oFont, .T., .T. ) } 
ENDIF 

RETURN oBitmap
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 12:44 PM
Thank you Linares!

I have changed my source!

Antonio, no have a way for redefine the say with this syntax and with the same effect of a bPainted call?

REDEFINE SAY ... TRANPARENT
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Thu Aug 28, 2008 04:02 PM

JĂșlio,

No, not yet

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion