FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour @ Say transparent on Windows
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
@ Say transparent on Windows
Posted: Fri Dec 28, 2007 07:29 PM

I rarely use @ Say / @ Get, but I'm trying to do something on a Window.

I use the following line to display a string:

@ 40,285 SAY vDate OF oWndc PIXEL SIZE 315,20 CENTER COLOR CLR_BLACK UPDATE

I have to use the CLR_BLACK to see the text. However, I want to use a Brush on the window, and when I do, it shows a white background to the text.

This is not a problem in dialogs with resources, because all text is transparent. If I don't use the COLOR CLR_BLACK, nothing shows up.

So how do I get just the text, using the brush background, with an @ x,y SAY on a WIndow ? I've seen use of the TRANSPARENT command on a Dialog, but it won't parse on a window ...

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: @ Say transparent on Windows
Posted: Fri Dec 28, 2007 10:27 PM
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    LOCAL oSay, oBru

    DEFINE BRUSH oBru STYLE BORLAND

    DEFINE WINDOW oWnd BRUSH oBru

    ACTIVATE WINDOW oWnd;
             ON PAINT oWnd:Say( 100, 100, "This is a test", CLR_RED, , , .T., .T. )

    RETURN NIL


EMG
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
@ Say transparent on Windows
Posted: Fri Dec 28, 2007 10:42 PM

This is a problem that I have long thought could be easily solved by making all SAYs trasparent by default. I can't think of any reason why anyone would want them not transparent. If they were transparent then we wouldn't have to resort to all these workarounds.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Workaround
Posted: Sat Dec 29, 2007 12:11 AM

That code might work in a small sample, but to display a screen full of @ Say's makes it very awkward and hard to trace problems that might arise.

So at least I'm not totally out of the loop here ... and I agree with James.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Workaround
Posted: Sat Dec 29, 2007 12:13 AM

Honestly, I can't see so many differences between a series of @ SAY and a series of oWnd:Say().

EMG

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Say
Posted: Sat Dec 29, 2007 12:57 AM

When I put together code, its preferably in order, so the say would be one line, and the get right below it. It makes it easier to remember what each get is for, and it makes it easier to make quick formatting changes ( moving a say and get around on the window ).

Here I could have to put a group of say commands all into an activate statement ...

I guess I would consider that an issue when it doesn't have to be that way ( I would think ). I really don't see why we would want the say framed in a white background anyway ( or any color for that matter ).

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
@ Say transparent on Windows
Posted: Sat Dec 29, 2007 02:40 AM

Tim,

Have you tried just putting a non-modal dialog (without borders) on the window and putting the controls on it? You could use the same brush on the dialog as the window so it would be invisible.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Say
Posted: Sat Dec 29, 2007 12:08 PM
TimStone wrote:When I put together code, its preferably in order, so the say would be one line, and the get right below it. It makes it easier to remember what each get is for, and it makes it easier to make quick formatting changes ( moving a say and get around on the window ).

Here I could have to put a group of say commands all into an activate statement ...


Nope, you can just put a function call in the ACTIVATE statement:

ACTIVATE WINDOW oWnd; 
             ON PAINT MYPAINT()

STATIC FUNCTION MYPAINT()

    oWnd:Say( 100, 100, "This is a test 1", CLR_RED, , , .T., .T. )
    oWnd:Say( 120, 100, "This is a test 2", CLR_RED, , , .T., .T. )

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Say
Posted: Sat Dec 29, 2007 12:11 PM
TimStone wrote:I really don't see why we would want the say framed in a white background anyway ( or any color for that matter ).


I agree.

EMG
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
@ Say transparent on Windows
Posted: Sat Dec 29, 2007 01:59 PM

I guess most users of FWH would agree. Will Mr Antonio consider making Says transparent by default and with background color by choice?

Would such a change break the existing code of many programs or is it against windows default behaviour ?

Another simple doubt. When oSay:lTransparent works well on Dialog why does it not ( or why should it not ) work the same way on a Window?

Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Dialog on window
Posted: Sat Dec 29, 2007 06:23 PM

James,

That is exactly what I tried originally ( early thread ) but I couldn't get the dialog to position correctly.

There was a control at 10,10 on the window ( that only worked on windows ) and the dialog just wouldn't position around that ...

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
@ Say transparent on Windows
Posted: Sat Dec 29, 2007 09:36 PM

Tim,

>There was a control at 10,10 on the window ( that only worked on windows ) and the dialog just wouldn't position around that ...

What control? And what do you mean "around that?" Did you mean "next to?" Could we see a small sample showing the problem?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Reply
Posted: Sat Dec 29, 2007 09:45 PM

Please check your email

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 39
Joined: Tue Jan 24, 2006 06:16 PM
Re: Reply
Posted: Sun Dec 30, 2007 03:36 PM

Hey guys,

I vote for standard a "TRANSPARANT" command in the SAY command. So you simply need to add "TRANSPARANT" to all your SAY's. Its the most "backward" compatible solution I think.

Patrick

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
@ Say transparent on Windows
Posted: Sun Dec 30, 2007 04:03 PM

Well then we would like to have Says transparent both on dialogs and windows if TRANSPARENT clause is used in the command, without having to put oWnd;Says in the ON INIT clause.

Is that what all would like ?

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion