FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Create Dialog with Minimize,Restore/Maximize, & Close Button
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 06:28 AM

Hi,

How can I create a Dialog with Minimize,Restore/Maximize, and Close Button which looks similiar to a window thru a PRG code ( not with a resource editor ).

Regards

Anser

Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 10:50 AM

Any hint. please...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 11:41 AM
Hello Anserkk,

I not feel certain, if that is, what You want to do.
Drawing Your own Dialog-Header ?
Instead of text, You can use BMP's as well for the Buttons.



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: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 12:05 PM
Dear Mr.Uwe,

I want my Dialog to have the standard Minimize,Restore/Maximize and Close Button (similiar to the one when we use DEFINE WINDOW) and not the one which you have shown on the picture. My intention is that my user should be able to minimize my dialog.

From the picture which u have displayed, I understand that we can keep pictures and give fuctionalities similiar to Minimize and Maxmize, but the problem is that I am in a tight time schedule and have to give the app to my user within an hours time from now. It is already 5:33 pm here.

If I use window instead of a Dialog then the whole layout of the controls are scrambled as you know Dialog and Window uses different matrix

I tried the following, but did not work

Code (fw): Select all Collapse
*nStyle:=(WS_MINIMIZEBOX + WS_MAXIMIZEBOX)  // did not work
nStyle:=nOR(WS_MINIMIZEBOX + WS_MAXIMIZEBOX) // did not work 
nStyle:=nOR(WS_MINIMIZEBOX ,  WS_MAXIMIZEBOX) // did not work 
DEFINE DIALOG oDlg TITLE "My Dialog " FROM 1,1 to 35,95 TRANSPARENT STYLE nStyle


Thanks & Regards

Anser
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 12:14 PM
In my example above I used this syntax without problems :
( tested inside a resource and copied from there using STYLE with Resource-Syntax )

// ( example : no Dialog-Title )
// ----------------------------------
DEFINE DIALOG oDlg SIZE 400, 290 TRANSPARENT PIXEL ;
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_DLGFRAME

// ( example : Window-Style )
// --------------------------------
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | ;
WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX

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: 782
Joined: Wed Dec 19, 2007 07:50 AM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 04:31 PM
anserkk wrote:How can I create a Dialog with Minimize,Restore/Maximize, and Close Button which looks similiar to a window thru a PRG code ( not with a resource editor ).
Hello Anser:

Try this:
Code (fw): Select all Collapse
#Include "FiveWin.Ch"

Function Main()
   Local oDlg, oWnd

   DEFINE WINDOW oWnd FROM 0, 0 TO 400, 400 PIXEL
   DEFINE DIALOG oDlg FROM 0, 0 TO 400,400 PIXEL OF oWnd TRANSPARENT STYLE nOr( WS_VISIBLE, WS_CHILD )

   @ 10, 10 SAY "Hello" PIXEL

   ACTIVATE DIALOG oDlg NOWAIT VALID oWnd:End()
   ACTIVATE WINDOW oWnd ON RESIZE oDlg:SetSize( oWnd:nWidth, oWnd:nHeight )

Return Nil
Regards.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Thu Apr 09, 2009 06:32 PM
Anser,

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg TITLE "Dialog with Window style" STYLE WS_OVERLAPPEDWINDOW

   ACTIVATE DIALOG oDlg CENTERED

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Create Dialog with Minimize,Restore/Maximize, & Close Button
Posted: Mon Apr 13, 2009 06:31 AM

Dear Mr.Uwe,Mr.Manuel and Mr.Antonio,

Sorry for the delay in replying. I was out of my home town

All the solutions proposed by 3 of you are working fine. Thankyou very much

Regards

Anser

Continue the discussion