Window and TRANSPARENT

Window and TRANSPARENT

Postby anserkk » Sat Jan 31, 2009 10:47 am

Hi all,

I am getting error when I try to use the TRANSPARENT clause while DEFINING a WINDOW.

When I checked the Source I understand that TRANSPARENT facility is available only for DIALOG's and NOT for WINDOW's. Is it true ?

One more doubt. Is it possible to have the Minimise, Restore & CLose buttons for a DIALOG on the Title Bar(Similiar to a Window), so that I can use the DIALOG with a NOWAIT command and make the DIALOG behave like a normal WINDOW

My requirement is to have a window with Transparent facility :D

Or is it advisable to use a Window and then using the array aControls to change all controls of the Window to Transparent ?

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Window and TRANSPARENT

Postby ukoenig » Sat Jan 31, 2009 11:53 am

Hello Anser.

The TRANSPARENT clause works with Dialogs.

For the Dialog-Buttons, check the Settings of the dialog-resource :

Image

Your questions comes parallel with my work I'm doing in the moment ( different tests ).
I can put a complete basic-structure, how to handle all setting, starting with a window
including a buttonbar in both windows and dialog and folder-setting for dialog
with the different background-settings in this place, if it is useful for You ?
I must know, if You want to use Resources. Maybe what kind of Backgrounds
do You want to use ?

Image

Regards
Uwe :lol:
Last edited by ukoenig on Sun Feb 01, 2009 10:44 am, 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: Window and TRANSPARENT

Postby anserkk » Sun Feb 01, 2009 9:03 am

Dear Mr.Uwe,

Thankyou for providing the info, that it is possible to have minimise and retore buttons on a Dialog. Till now I have not seriously used any resource editors. I plan to use resource editor like ResEd along with Pelles Resource compiler for designing screens with many complicated controls on it

Mostly I define windows and dialogs programattically. Do u know the syntax to diplay minimise and restore button on a dialog? .

I am definitely interested in the sample which u have specified in u'r post. If u don't mind please share it.

Regards

Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Window and TRANSPARENT

Postby Antonio Linares » Sun Feb 01, 2009 10:40 am

Anser,

> Do u know the syntax to diplay minimise and restore button on a dialog ?

Try this:
Code: Select all  Expand view
   DEFINE DIALOG oDlg FROM 10, 10 TO 20, 40 ;
      TITLE "Dialog" STYLE nOr( WS_VISIBLE, WS_OVERLAPPEDWINDOW )

   ACTIVATE DIALOG oDlg

Please notice that WS_OVERLAPPEDWINDOW is defined this way:
Code: Select all  Expand view
#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + WS_MAXIMIZEBOX)

So you can select the styles to use
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Window and TRANSPARENT

Postby ukoenig » Sun Feb 01, 2009 10:48 am

The modified dialog-sample : testdlg5.prg

Image

Code: Select all  Expand view

function startDia()

local i,cVar:="lalalalala",cVar1:="hoplalalalala"
local nStyle :=nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
WS_MINIMIZEBOX, WS_MAXIMIZEBOX )

DEFINE DIALOG oDlg FROM 1,10 TO 24,60 STYLE nSTYLE
...
...
...



Image

Code: Select all  Expand view

// ----- Disable   EXIT-BUTTON and Move Dialog to Position Top / Left------
...
...
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ), DisableX(oDlg, .T ) )

// -------------------------------------

FUNCTION DisableX(oDlg, lDisable)

LOCAL hMenu  := 0
LOCAL nCount := 0

IF lDisable
   hMenu  = GetSystemMenu(oWin:hWnd, .F.)
   nCount = GetMItemCount(hMenu)
   IF oWin:ClassName() = "TDIALOG"
      RemoveMenu(hMenu, 1, nOR( 1024, 2) )
   ELSE
      RemoveMenu(hMenu, nCount - 1, nOR( 1024, 2) )
      RemoveMenu(hMenu, nCount - 2, nOR( 1024, 2) )
   ENDIF     
   DrawMenuBar( oWin:hWnd )
ELSE
   GetSystemMenu( oWin:hWnd, .T. )
   DrawMenuBar( oWin:hWnd )
ENDIF

RETURN nil



Regards
Uwe :lol:
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: Window and TRANSPARENT

Postby anserkk » Mon Feb 02, 2009 5:22 am

Thankyou Mr.Antonio and Mr.Uwe,

Its a very good example.

Regards

Anser :D
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests