Expand a dialog

Expand a dialog

Postby MarcoBoschi » Wed Jul 15, 2015 9:17 am

Hi,
is it possible to expand a dialog during execution?
In Button Action for instance?
Many thanks
Marco

Code: Select all  Expand view

#include "fivewin.ch"

FUNCTION MAIN
LOCAL oDlg
LOCAL oBut

DEFINE DIALOG oDlg FROM 100 , 100 TO 200 , 400 PIXEL

@ 2 , 1 BUTTON oBut ACTION MsgInfo( "Code for expand dialog to 300 , 500 ?" )

ACTIVATE DIALOG oDlg


RETURN NIL
 
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Expand a dialog

Postby Antonio Linares » Wed Jul 15, 2015 10:03 am

Marco,

@ 2 , 1 BUTTON oBut ACTION oDlg:SetSize( 300, 500 )
regards, saludos

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

Re: Expand a dialog

Postby ukoenig » Wed Jul 15, 2015 10:36 am

Marco,

optional You can use MOVE to RESIZE and CENTER

ACTION oDlg:Move( ( GetSysMetrics(1) / 2 ) - 250, ( GetSysMetrics(0) / 2 ) - 150, 300, 500, .t. )

// Top, Left, Width, Height
// oDlg:Move( 50, 100, 200, 300, .t. )

best 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: Expand a dialog

Postby MarcoBoschi » Wed Jul 15, 2015 10:56 am

Ok
Thanks
Marco
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Expand a dialog

Postby Antonio Linares » Wed Jul 15, 2015 11:33 am

To center it you may also use:

oDlg:Center( [ oWnd ] )

Where oWnd is an optional parameter to be used as the window to center the dialog at
regards, saludos

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

Re: Expand a dialog

Postby MarcoBoschi » Wed Jul 15, 2015 11:55 am

Antonio, Uwe,
this is a little example program that looks more like what I have to get
When the focus is in the first GET oget1 the dialog has to be small
When the focus pass to the second GET oget2 the dialog has to expand
I think this little sample works but does not exist the refresh.
Users must be able to see a dialog of another app
Code: Select all  Expand view
#include "fivewin.ch"

FUNCTION MAIN
LOCAL oDlg
LOCAL oGet1, cGet1 := SPACE( 10 )
LOCAL oget2, cget2 := SPACE( 10 )


DEFINE DIALOG oDlg RESOURCE "DIALOGO"

REDEFINE GET oGet1 VAR cGet1  OF oDlg VALID big_dlg( oDlg )
REDEFINE GET oGet2 VAR cGet2  OF oDlg VALID small_dlg( oDlg )

ACTIVATE DIALOG oDlg ON INIT  small_dlg( oDlg )


RETURN NIL


FUNCTION SMALL_DLG( oDlg )

oDlg:setsize( 500 , 200 )
RETURN .T.


FUNCTION BIG_DLG( oDlg )

oDlg:setsize( 500 , 800 )
RETURN .T.
 


Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

DIALOGO DIALOGEX DISCARDABLE 6, 18, 363, 299
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 0, 0, 1
{
  CONTROL "", 101, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 7, 6, 94, 12
  CONTROL "", 102, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 5, 176, 94, 12
}
 
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Expand a dialog

Postby Antonio Linares » Wed Jul 15, 2015 12:04 pm

Marco,

Do you mean that it is not properly painted ?

Try a oDlg:Refresh() after oDlg:ReSize( ... )
regards, saludos

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

Re: Expand a dialog

Postby Enrico Maria Giordano » Wed Jul 15, 2015 2:13 pm

Marco,

MarcoBoschi wrote:When the focus is in the first GET oget1 the dialog has to be small
When the focus pass to the second GET oget2 the dialog has to expand


The first thing you should ask yourself is why to create such a monster. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Expand a dialog

Postby MarcoBoschi » Wed Jul 15, 2015 2:38 pm

Enrico,
do you think is so funny?
It is a simple request of a customer and try to understand what I can do.
That's all!
:roll:
User avatar
MarcoBoschi
 
Posts: 1015
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 95 guests