FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Tue Mar 19, 2013 10:38 AM
Hello ( Daniel ),

is it possible, to keep a TTITLE transparent on windws resize ?



On Window-resize, the area from startup is used. Refresh doesn't help.



Best 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.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Possible to keep TTITLE transparent on Window-resize ?
Posted: Wed Mar 20, 2013 11:27 AM

Uwe,

I think it should be enough to do a:

oTitle:hBackBrush = nil
oTitle:Refresh()

but the problem is that hBackBrush is declared as PROTECTED, so the above may fail, unless you remove PROTECTED from such DATA.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to keep TTITLE transparent on Window-resize ?
Posted: Wed Mar 20, 2013 01:12 PM
Antonio,

thank You very much

Removing PROTECT from DATA works perfect

Results on Wnd-resize :





Best 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.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Possible to keep TTITLE transparent on Window-resize ?
Posted: Wed Mar 20, 2013 01:27 PM

Uwe

I am following this thread with interest. I have many Mdi and MdiChilds with lots of controls and I would like to find an easy way to be able to re-size the window and have the controls ( buttons, folders, etc ) "magically" :D resize ??

Also .. I like your Mdi title concept of being able to over-lay bitmaps on a painted background.

Thanks
Rick Llipkin

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to keep TTITLE transparent on Window-resize ?
Posted: Wed Mar 20, 2013 03:14 PM
Rick,

Also I would like to know,
if there is any solution, to do the same with a DIALOG transparent,
showing the Window-brush / Image ?


Best 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.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Wed Mar 20, 2013 03:55 PM
Uwe

I did a Dialog with transparent text and controls some years ago.. here is the code... Don't know if it will help you ?

Rick Lipkin

Code (fw): Select all Collapse
    SetDlgGradient()  // turns off and setgradient

     yLOGIN := WNetGetUser()      // FiveWin function
     yLOGIN := substr(UPPER( yLOGIN )+space(8),1,8)

     oSAY := NIL
     cSAY := NIL

     cWELCOME := "WELCOME to the PMO Strategic Projects Vital Signs Application"
     cSAY  := "The System could not resolve your UserID "
     cSAY1 := yLOGIN
     cSAY2 := "You now have a choice to Add yourself as a"
     cSAY3 := "Project Manager or enter the program as Read Only?"

     nOK   := 0

     DEFINE BRUSH oBru FILENAME ( cDEFA+"\PMO.BMP" )

     DEFINE DIALOG oDLG1 ;
        TITLE "WELCOME" ;
        SIZE 700, 400 BRUSH oBRU TRANSPARENT

        @ 0, 2 SAY cWELCOME OF oDlg1 COLOR "W+/W"
         oDlg1:aControls[ 1 ]:lTransparent = .t.
        @ 1, 2 SAY cSAY OF oDlg1 COLOR "W+/W"
         oDlg1:aControls[ 2 ]:lTransparent = .t.
        @ 1.5,2 SAY cSAY1 OF oDlg1 COLOR "W+/W"
         oDlg1:aControls[ 3 ]:lTransparent = .t.
        @ 2,2 SAY cSAY2 OF oDlg1 COLOR "W+/W"
         oDlg1:aControls[ 4 ]:lTransparent = .t.
        @ 2.5,2 SAY cSAY3 OF oDlg1 COLOR "W+/W"
         oDlg1:aControls[ 5 ]:lTransparent = .t.

        @ 50, 10 BTNBMP oBtn1 RESOURCE "YES" ;
         SIZE 145, 15 OF oDlg1 ;
         ACTION( oDlg1:End(), nOK := 1 )
         oBtn1:lTransparent := .T.

        @ 70, 10 BTNBMP oBtn2 RESOURCE "PMGR" ;
         SIZE 145, 15 OF oDlg1;
         ACTION( IF( _Addum( oDlg1, "UNKNOWN" ),nOK := 4 , nOK := 2 ))
         oBtn2:lTransparent := .T.

        @ 90, 10 BTNBMP oBtn3 RESOURCE "CANCEL" ;
         SIZE 145, 15 OF oDlg1 ;
         ACTION( oDlg1:END(), nOK := 3)
         oBtn3:lTransparent := .T.

     ACTIVATE DIALOG oDlg1 CENTERED

     LightGreyGrad()


Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Wed Mar 20, 2013 04:13 PM

Rick,

I don't mean the controls to be painted transüarent on a dialog-brush.
I want to show the dialog be painted transparent itself, related to the window-brush.
The next question would be, how controls are painted on this ( maybe possible ) transparent dialog.
Will they still be transparent, using thw window-brush ?
Some month ago, I remember tested a solution with Mr. Rao, using a Main-window and a child.
The child captured the area from the main-window and used it as a brush. It looked like transparent.
Maybe the same logic is needed.

Best 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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Wed Mar 20, 2013 04:39 PM
Also I would like to know,
if there is any solution, to do the same with a DIALOG transparent,
showing the Window-brush / Image ?


Please try:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local cFileJpg    := "penguins.jpg"
   local oWnd, oBar, oBrush

   DEFINE BRUSH oBrush FILE cFileJpg RESIZE
   DEFINE WINDOW oWnd MDI BRUSH oBrush
   DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007
   DEFINE BUTTON OF oBar PROMPT "TranspDlg" ACTION TranspDlg()
   SET MESSAGE OF oWnd TO '' 2007

   ACTIVATE WINDOW oWnd
   RELEASE BRUSH oBrush

return nil

static function TranspDlg()

   local oDlg, oFont

   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-30 BOLD

   DEFINE DIALOG oDlg SIZE 300,200 PIXEL ;
      TITLE "Transparent Dialog" ;
      COLOR CLR_HRED,RGB(1,1,1) OF WndMain()

   @ 40,00 SAY "TRANSPARENT DIALOG" SIZE 150,40 PIXEL OF oDlg ;
      FONT oFont TRANSPARENT CENTER

   oDlg:nSeeThroClr := RGB(1,1,1)

   ACTIVATE DIALOG oDlg CENTERED IN PARENT NOMODAL ;
      VALID ( oFont:End(), .t. )


return nil


Result:
Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Wed Mar 20, 2013 05:20 PM
Mr. Rao,

THANK YOU VERY MUCH !

exactly what I've been looking for.
It works on RESIZE without any problems.

Using a dialog without border, it can be a frame / group of any controls
displayed transparent on the main-window.





Add these lines to the dialog to connect to the window on a defined position

WndMain():bMoved := {|| WndMain():CoorsUpdate(), ;
oDlg:Move( WndMain():nTop + 10, WndMain():nLeft + 10, oDlg:nWidth, oDlg:nHeight, .f. ) }

WndMain():bResized := {|| oDlg:Move( WndMain():nTop + 10, WndMain():nLeft + 10, oDlg:nWidth, oDlg:nHeight, .f. ) }




Best 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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?
Posted: Thu Mar 21, 2013 02:49 AM
Uwe

By setting oBrw:lTransparent := .t., you can make the browse also transparent. You may find it interesting to try.

Some month ago, I remember tested a solution with Mr. Rao, using a Main-window and a child.


The approach I suggested above is different from that approach. You may search through the forums and apply that logic to dialogs also.

There is a problem with the approach adopted above. ( setting oDlg:nSeethroClr ).
If the user clicks on a transparent area in the dialog, the click goes to the background window but not to the dialog / control. This is windows' behavior.

This is not the problem with the approach I suggested long back.

You may try both and choose.

Mr. Rick
When you set DIALOG as TRANSPARENT, there is no need again to set each SAY's lTransparent to .t.. That happens automatically.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion