@ Say transparent on Windows

@ Say transparent on Windows

Postby TimStone » Fri Dec 28, 2007 7: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: @ Say transparent on Windows

Postby Enrico Maria Giordano » Fri Dec 28, 2007 10:27 pm

Code: Select all  Expand view
#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
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Workaround

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

Re: Workaround

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

Say

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

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

Re: Say

Postby Enrico Maria Giordano » 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:

Code: Select all  Expand view
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: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Say

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

Postby nageswaragunupudi » Sat Dec 29, 2007 1: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Dialog on window

Postby TimStone » Sat Dec 29, 2007 6: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

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

Reply

Postby TimStone » Sat Dec 29, 2007 9: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
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Reply

Postby patrickmast » Sun Dec 30, 2007 3: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
User avatar
patrickmast
 
Posts: 39
Joined: Tue Jan 24, 2006 6:16 pm

Postby nageswaragunupudi » Sun Dec 30, 2007 4: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests