FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour variable size of Dialogs
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
variable size of Dialogs
Posted: Tue Nov 04, 2008 09:16 AM
Hi,

is there a possibility to change the size of dialogs? For example, I use following code for a dialog in my rc-file:

WG_AUSWERT DIALOG LOADONCALL MOVEABLE DISCARDABLE 75, 53, 108, 103
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Auswertungs-Währung"
FONT 8, "MS Sans Serif"
{
 DEFPUSHBUTTON "&OK", 111, 3, 85, 50, 14
 PUSHBUTTON "&Abbruch", 110, 55, 85, 50, 14
 COMBOBOX 121, 53, 4, 49, 84, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
 LTEXT "Bitte wählen Sie die Währung, die Sie für Ihre Auswertungen (Statistiken, Preisliste) benutzen wollen.", -1, 6, 22, 96, 56
 LTEXT "Währung", -1, 5, 6, 44, 8
}


if I change from FONT 8 to FONT 10, the dialog size automatically increases.
However, when I let the font at 8, define this dialog in source code and use the method oDlg:Setfont(oFont) with a bigger size, for example 10, the dialog size doesn't adjust. Is there a possibility to influence the size of dialogs from source code? I'd like to offer our customers an easy adjustment of dialog sizes...
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Resize Dialog
Posted: Tue Nov 04, 2008 02:12 PM
Hello Gilbert,

You can resize a dialog from resources :

Sample :

// Move and resize

ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT ( gradpaint0( hDC, oDlg ), SetDialogsGradient( oFld ) ) ;
ON INIT ( oDlg:Move( 30 , 10, 100, 50, .f. ) )
OR
*oDlg:SetSize( nWidth, nHeight, lRepaint ) 

// Move with same dimensions

*ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ) )


The dialog is resized, but not the objects !!!
I have seen in some app's a zoom-effect, it means,
all objects are resized to the new dialog-dimension.
With FWH I think, it is not possible.

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: 44162
Joined: Thu Oct 06, 2005 05:47 PM
variable size of Dialogs
Posted: Tue Nov 04, 2008 06:44 PM

Gilbert,

You could load the dialogbox resource info into memory, change its font data into it, and create the dialogbox from the modified resource, so it will automatically resize its dimensions and controls sizes.

Please review the use of cResData in FWH\samples\RE.prg

You can load the resource into memory using FindResource() and LoadResource()

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion