"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby JC » 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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby JC » 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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby Antonio Linares » Thu Aug 28, 2008 11:37 am

Júlio,

Here you have a working example :-)

test.prg
Code: Select all  Expand view  RUN
#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
Code: Select all  Expand view  RUN
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
}

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby JC » 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:
Code: Select all  Expand view  RUN
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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby Antonio Linares » 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:
Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby JC » 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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Postby Antonio Linares » Thu Aug 28, 2008 4:02 pm

Júlio,

No, not yet
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 43 guests