Create Dialog with Minimize,Restore/Maximize, & Close Button

Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby anserkk » Thu Apr 09, 2009 6: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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby anserkk » Thu Apr 09, 2009 10:50 am

Any hint. please...
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby ukoenig » 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.

Image

Regards
Uwe :lol:
Last edited by ukoenig on Thu Apr 09, 2009 2:23 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: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby anserkk » 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: Select all  Expand view
*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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby ukoenig » 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 :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: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby mmercado » Thu Apr 09, 2009 4: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: Select all  Expand view
#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
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby Antonio Linares » Thu Apr 09, 2009 6:32 pm

Anser,

Code: Select all  Expand view

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

Re: Create Dialog with Minimize,Restore/Maximize, & Close Button

Postby anserkk » Mon Apr 13, 2009 6: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
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 79 guests