variable size of Dialogs

variable size of Dialogs

Postby gkuhnert » Tue Nov 04, 2008 9: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:

Code: Select all  Expand view
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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Resize Dialog

Postby ukoenig » Tue Nov 04, 2008 2:12 pm

Hello Gilbert,

You can resize a dialog from resources :

Sample :

Code: Select all  Expand view

// 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 :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

Postby Antonio Linares » Tue Nov 04, 2008 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests