Page 1 of 1

@ Say transparent on Windows

Posted: Fri Dec 28, 2007 7:29 pm
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

Re: @ Say transparent on Windows

Posted: Fri Dec 28, 2007 10:27 pm
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

Posted: Fri Dec 28, 2007 10:42 pm
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

Workaround

Posted: Sat Dec 29, 2007 12:11 am
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.

Re: Workaround

Posted: Sat Dec 29, 2007 12:13 am
by Enrico Maria Giordano
Honestly, I can't see so many differences between a series of @ SAY and a series of oWnd:Say().

EMG

Say

Posted: Sat Dec 29, 2007 12:57 am
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

Posted: Sat Dec 29, 2007 2:40 am
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

Re: Say

Posted: Sat Dec 29, 2007 12:08 pm
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

Re: Say

Posted: Sat Dec 29, 2007 12:11 pm
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

Posted: Sat Dec 29, 2007 1:59 pm
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?

Dialog on window

Posted: Sat Dec 29, 2007 6:23 pm
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 ...

Posted: Sat Dec 29, 2007 9:36 pm
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

Reply

Posted: Sat Dec 29, 2007 9:45 pm
by TimStone
Please check your email

Re: Reply

Posted: Sun Dec 30, 2007 3:36 pm
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

Posted: Sun Dec 30, 2007 4:03 pm
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 ?