@ Say transparent on Windows

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

@ Say transparent on Windows

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: @ Say transparent on Windows

Post by Enrico Maria Giordano »

Code: Select all

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

Post by James Bott »

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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Workaround

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Workaround

Post by Enrico Maria Giordano »

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

EMG
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Say

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Say

Post by Enrico Maria Giordano »

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:

Code: Select all

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Say

Post by Enrico Maria Giordano »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Dialog on window

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Reply

Post by TimStone »

Please check your email
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
patrickmast
Posts: 39
Joined: Tue Jan 24, 2006 6:16 pm
Contact:

Re: Reply

Post by patrickmast »

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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

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
Post Reply