FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Expand a dialog
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Expand a dialog
Posted: Wed Jul 15, 2015 09:17 AM
Hi,
is it possible to expand a dialog during execution?
In Button Action for instance?
Many thanks
Marco

Code (fw): Select all Collapse
#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
Marco Boschi
info@marcoboschi.it
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Expand a dialog
Posted: Wed Jul 15, 2015 10:03 AM

Marco,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Expand a dialog
Posted: 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 :-)
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: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Expand a dialog
Posted: Wed Jul 15, 2015 10:56 AM

Ok
Thanks
Marco

Marco Boschi
info@marcoboschi.it
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Expand a dialog
Posted: 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
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Expand a dialog
Posted: 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 (fw): Select all Collapse
#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 (fw): Select all Collapse
// 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
}
Marco Boschi
info@marcoboschi.it
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Expand a dialog
Posted: 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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Expand a dialog
Posted: Wed Jul 15, 2015 02: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
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Expand a dialog
Posted: Wed Jul 15, 2015 02: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:

Marco Boschi
info@marcoboschi.it

Continue the discussion