FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Resize dialogs from resources
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Resize dialogs from resources
Posted: Mon Jun 28, 2010 04:25 PM

I have a bunch of dialogs in my program made from B toolshop. No childs, no mdi etc. Each dialog stands alone. When the user resets their screen resoliution some of my dialogs are to big for the screen. Is there a way to resize them base on screen resolution. A function that can be called on on init() or any suggestions welcome.

Thanks as always for the help.

Thank you

Harvey
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Resize dialogs from resources
Posted: Mon Jun 28, 2010 04:41 PM
Dear Hag,

This is my code to resize dialog from resource.
Code (fw): Select all Collapse
DEFINE DIALOG oDlg RESOURCE 'TEST'
...
ACTIVATE DIALOG oDlg CENTER RESIZE16 ;
         ON INIT (oDlg:Move( MEMVAR->TopWin , MEMVAR->LeftWin , oDlg:nWidth , oDlg:nHeight - 120 , .T. ))
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Resize dialogs from resources
Posted: Mon Jun 28, 2010 05:29 PM

looks easy enough. I'll give it a try and let u know. Thanks.

Thank you

Harvey
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Resize dialogs from resources
Posted: Mon Jun 28, 2010 06:01 PM

Dutch:

how do you get the values of topwin and leftwin?

Thank you

Harvey
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Resize dialogs from resources
Posted: Tue Jun 29, 2010 02:43 AM
Dear Hag,

- TopWin is the point after the Menu
Code (fw): Select all Collapse
MEMVAR->TopWin := (GetSysMetrics( 4 )+GetSysMetrics( 15 ))

- LeftWin is your own define, it may be 0. I use to specific at 80 after TOutlook.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Resize dialogs from resources
Posted: Tue Jun 29, 2010 09:08 AM
Hello Dutch,

I think only resizing doesn't help, because all Controls Bottom and Right will be out of reach.
Adding Scrollbars ?
As well a test, if resizing is needed must be included.

Example :

Code (fw): Select all Collapse
FUNCTION TESTSIZE()
LOCAL oDlg
LOCAL nWidth := GetSysMetrics(0) - 50   // Screen Horizontal
LOCAL nHeight := GetSysMetrics(1) - 100   // Screen Height

DEFINE DIALOG oDlg  NAME "Test" PIXEL

ACTIVATE DIALOG oDlg  ; // test if resizing needed 
ON INIT IIF( oDlg:nWidth > nWidth .or. oDlg:nHeight > nHeight, ;
                    oDlg:Move( 30, 30, nWidth, nHeight, .F. ), ;
                    oDlg:Move( 30, 30, oDlg:nWidth, oDlg:nHeight, .F.) )

RETURN NIL






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: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Resize dialogs from resources
Posted: Wed Jun 30, 2010 04:54 AM

Dear Uwe,

I think so. It has some case to hide some get or button to out of dialog. It will be good method.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion