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

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

Postby JC » Wed Aug 27, 2008 5:48 pm

Dear Antonio and friends!

* New: REDEFINE SAY ... TRANSPARENT already available. No need to declare a variable to hold the SAY object to set its transparency.

My syntax is here:
Code: Select all  Expand view
REDEFINE SAY PROMPT "Test oSay Transparent" ID 4001 OF oDlg FONT ( TFont():new( "Tahoma", 0, 25,, .T. ) ) TRANSPARENT

But, still not work!
Last edited by JC on Thu Aug 28, 2008 4:26 pm, edited 2 times in total.
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

Redefine SAY transparent

Postby ukoenig » Wed Aug 27, 2008 6:10 pm

Hello JC,

i couldn't detect any problem.

As you can see : a transparent SAY on Gradient-background.
Value 0.50 is a GET

The say-text is directly written inside the resource. !!!!

I didn't use REDEFINE SAY

Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Wed Aug 27, 2008 6:24 pm

Uwe, this is my REDEFINE SAY into our application:

Image

It's on top of a bitmap image from resource!
Not works!
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

Transparent SAY

Postby ukoenig » Wed Aug 27, 2008 6:29 pm

Hello JC,

I understand.
This is complete different ( Text on BMP ).
I will give you a source-sample for this in this topic.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Transparent SAY

Postby JC » Wed Aug 27, 2008 6:31 pm

ukoenig wrote:Hello JC,

I understand.
This is complete different ( Text on BMP ).
I will give you a source-sample for this in this topic.

Regards
Uwe :lol:


Uew, please send me on julio.mferreira@gmail.com! And thanks!
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 » Wed Aug 27, 2008 6:32 pm

Júlio,

Are you using a BRUSH from a bitmap for the Dialog ?
regards, saludos

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

Postby JC » Wed Aug 27, 2008 6:37 pm

Antonio Linares wrote:Júlio,

Are you using a BRUSH from a bitmap for the Dialog ?


Antonio, not! I'm using this way:
Code: Select all  Expand view
TBitmap():redefine( nId, cResName,, oDlg,,,, lStretch,,,,,, lTransparent )
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 » Wed Aug 27, 2008 6:39 pm

Júlio,

Then try to use:

oBitmap:Say( nRow, nCol, cText, ... )

METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel,;
lTransparent, nAlign )
regards, saludos

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

Postby JC » Wed Aug 27, 2008 6:47 pm

Antonio Linares wrote:Júlio,

Then try to use:

oBitmap:Say( nRow, nCol, cText, ... )

METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel,;
lTransparent, nAlign )


Antonio,

I tried with this implementation, but not works!
Code: Select all  Expand view
       oBitmap := TBitmap():redefine( 100, "IMG_BARRA_TOP",, oDlg )
       oBitmap:say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )


This the result image:
Image
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 » Wed Aug 27, 2008 6:50 pm

Julio,

You have to do that call from the ON INIT of the dialog:

ACTIVATE DIALOG oDlg ;
ON INIT oBitmap:Say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )
regards, saludos

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

Postby Antonio Linares » Wed Aug 27, 2008 6:51 pm

And remove the SAY control ! ("text") :-)
regards, saludos

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

Postby Antonio Linares » Wed Aug 27, 2008 6:52 pm

In fact, it should be used from the ON PAINT, to properly refresh:

ACTIVATE DIALOG oDlg ;
ON PAINT oBitmap:Say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )
regards, saludos

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

Postby JC » Wed Aug 27, 2008 6:59 pm

Antonio,

My code:

Code: Select all  Expand view
DEFINE DIALOG oDlg RESOURCE "DEFAULT_FORM" OF oWnd ICON oIcon

       oBitmap := TBitmap():redefine( 100, "IMG_BARRA_TOP",, oDlg )
       
       ...

ACTIVATE DIALOG oDlg CENTER ON PAINT ( oBitmap:say( 2, 2, "Cadastro Plano de Contas",,,,, .T. ) )

Sorry, but still not work!

We using the class TSSay with syntax REDEFINE SENSITIVE SAY ... TRANSPARENT and this works fine!
I really want to use the native class of FWH with transparency! It's very better than!
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

Text-Writing on BMP

Postby ukoenig » Wed Aug 27, 2008 7:03 pm

Hello JC,

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

Here is just a quick sample, how i use text-writing on BMP's from Resource on any places.
The BMP-resource is filled with a brush or color, then a text is painted.
I use it for my Title-paintings.
Maybe you can find some informations on it.

The resource < Blanc > is a small BMP inside the resource, used as container. ID 100 is your BMP with the original size.
POSLEFT defines the needed left-position of the text.
The top-position of the text is calculated from the font- and BMP-height,
to center the text vertical.

Code: Select all  Expand view

REDEFINE BITMAP oBmp1  ID 100 ADJUST RESOURCE "Blanc"  OF oDlg1
oBmp1:bPainted := { |hDC|OnPaint( oDlg1,hDC,oBMP1, "Your Text", oFont, POSLEFT ) }

//----------------------------------------------------------------//

FUNCTION ONPAINT(oDlg1,hDC,oBmp,cText, oBFont,nPOSLEFT )
LOCAL hOldFont, oNewbrush, hBitmap, aRect, nTOP, nLEFT

hOldFont := SelectObject( hDC, oBFont:hFont )

// find the text-length

nTXTLG :=  GettextWidth( hDC, cText )

nBMPLONG  := oBmp:Super:nWidth()
nBMPHIGHT := oBmp:Super:nHeight()
nFONTHIGHT := oBfont:nInpHeight * -1

// The text-pos is calculated

nLEFT := 5

IF nPOSLEFT = 0
   // Center-position in BMP if POSLEFT = 0
   nLEFT := (nBMPLONG - nTXTLG) / 2 
ELSE
   // defined left-position
   nLEFT := nPOSLEFT 
ENDIF

nNEWHIGHT := nFONTHIGHT

// Text-top-position is calculated.

nTOP := (nBMPHIGHT - nNEWHIGHT) / 2

aRect := GETCLIENTRECT( oBmp:hWnd )

oBmp:oBrush := oNewbrush

SetTextColor( hDC,nColor)
SetBkMode( oBmp:hDC, 0 )

// Fills your BMP with a brush

FillRect( hDC, aRect, oBmp:oBrush:hBrush )

IF nPOSLEFT > 0
     TextOut( hDC, nTOP, nLEFT, cText )
ELSE
     TextOut( hDC, nTOP, nLEFT, cText )
ENDIF
SelectObject( hDC, hOldFont )

RETURN NIL



Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby James Bott » Wed Aug 27, 2008 11:10 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 100 guests