Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby ukoenig » Tue Mar 19, 2013 10:38 am

Hello ( Daniel ),

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

Image

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

Image

Best regards
Uwe :?:
Last edited by ukoenig on Wed Mar 20, 2013 3:44 pm, edited 1 time in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to keep TTITLE transparent on Window-resize ?

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Possible to keep TTITLE transparent on Window-resize ?

Postby ukoenig » Wed Mar 20, 2013 1:12 pm

Antonio,

thank You very much

Removing PROTECT from DATA works perfect

Results on Wnd-resize :

Image

Image

Best Regards
Uwe :o
Last edited by ukoenig on Wed Mar 20, 2013 3:37 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to keep TTITLE transparent on Window-resize ?

Postby Rick Lipkin » Wed Mar 20, 2013 1: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
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Possible to keep TTITLE transparent on Window-resize ?

Postby ukoenig » Wed Mar 20, 2013 3: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 ?

Image
Best Regards
Uwe :?:
Last edited by ukoenig on Mon Apr 28, 2014 7:24 pm, edited 3 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby Rick Lipkin » Wed Mar 20, 2013 3: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: Select all  Expand view

    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()

 


Image
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby ukoenig » Wed Mar 20, 2013 4: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby nageswaragunupudi » Wed Mar 20, 2013 4: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: Select all  Expand view
#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:
Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby ukoenig » Wed Mar 20, 2013 5: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.

Image

Image

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. ) }


Image

Best Regards
Uwe :o
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to keep TTITLE / DIALOG transp. on Wnd-resize ?

Postby nageswaragunupudi » Thu Mar 21, 2013 2: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
User avatar
nageswaragunupudi
 
Posts: 10248
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 93 guests