Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM
Re: RESIZE Objects when resize Window or Dialog (ANTONIO ?)
Posted: Thu Sep 04, 2014 07:49 AM
Hi,
My idea was not that, ... not EasyDialog
My idea was to have alternate, another folder with .ch files, example .\FWH\INCLUDE1
with changed .CH files like in few posts above, and using rowfactor and colfactor
sSysWidth := 0 // System Width
sSysHeight := 0 // System Height
sSouWidth := 800 // Source Width
sSouHeight := 600 // Source Height
sRowFactor := 0 // Factor for new Width
sColFactor := 0 // Factor for new Height
ScrResolution(@sSysWidth,@sSysHeight)
sRowFactor := sSysWidth / sSouWidth
sColFactor := sSysHeight / sSouHeight
So if dialog/window is based on 800/600 resolution and curent resolution is 1024/768
rowfactor is 1.28 colfactor is 1.28
we will have the same size on the screen in both cases while creating dialog/window ... or other objects
buttons, gets ...
No changes needed in program ... just in make file change include path to \FWH\INCLUDE1
example:
#xcommand DEFINE DIALOG <oDlg> ;
[ <resource: NAME, RESNAME, RESOURCE> <cResName> ] ;
[ TITLE <cTitle> ] ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <lib: LIBRARY, DLL> <hResources> ] ;
[ <vbx: VBX> ] ;
[ STYLE <nStyle> ] ;
[ <color: COLOR, COLORS> <nClrText> [,<nClrBack> ] ] ;
[ BRUSH <oBrush> ] ;
[ <of: WINDOW, DIALOG, OF> <oWnd> ] ;
[ <pixel: PIXEL> ] ;
[ ICON <oIco> ] ;
[ FONT <oFont> ] ;
[ <help: HELP, HELPID> <nHelpId> ] ;
[ <transparent: TRANSPARENT> ] ;
[ GRADIENT <aGradColors> ] ;
=> ;
<oDlg> = TDialog():New( <nTop*sRowFactor>, <nLeft*sColFactor>, <nBottom*sRowFactor>, <nRight*sColFactor>,;
<cTitle>, <cResName>, <hResources>, <.vbx.>, <nStyle>,;
<nClrText>, <nClrBack>, <oBrush>, <oWnd>, <.pixel.>,;
<oIco>, <oFont>, <nHelpId>, <nWidth*sColFactor>, <nHeight*sRowFactor>, <.transparent.>,;
<aGradColors> )
Best regards,