Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

sizing Dialog box

timberwolf
Beginner
921 Views
Hello,
I have created a dialog box using the following code,
IF (DLGINIT(ID,DLG)) THEN
....
retlog = DlgModal(DLG)
call DlgUninit(DLG)
END IF
How would you change the size of the dialog box?
Because if I run it, when the display is set to 1600x1200 it fits in the window. But I change the window display to 800x600 the dialog box is bigger.
Thanks
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
921 Views
Well, what would you like the result to be? You can scale the dialog, but that will clip the contents as well. You can resize the controls within, but that will probably clip most of the text within static control.
Here's the sketch of code which scales everything, including controls' font. See API documentation for details.
Jugoslav
0 Kudos
timberwolf
Beginner
921 Views
JugoslavDujic,
I can scale the dialog. But lets say I run on a machine that has a resolution of 1600x1200 and a machine that has a resolution of 1024x768. The dialog box will be bigger on the the second machine. I don't want to manually scale the dialog box for each machine. I would like some type of code that will change the size of the dialog box dynamically depending on the current display resolution. Is there a way to do this?
Thanks
0 Kudos
Jugoslav_Dujic
Valued Contributor II
921 Views
Here it is, attached. The idea is to use EnumChildWindows to go through every control in the dialog, and pass the information via type(T_SCALE) (you can make it global instead of using lParam). iOrigXRes/iOrigYRes present the resolution where the dialog is developed, i.e. where it looks "best". Try changing these values, or change your screen resolution.
Note, however, that the end result probably cannot be as nice as manually crafted dialog.
Jugoslav
0 Kudos
anthonyrichards
New Contributor III
921 Views
I agree with Jugoslav - better to develop a dialog for each resolution and put up the one that fits the machine, after getting screen info. WIth 1600/1024 = 1.5625 and 12 point/8 point = 1.5, maybe develop the 1600*1200 with 12 point font and the 1024*768 with 8-point. Here is code which will find out the work area of the desktop not obscured by task bar and application desk-top toolbars and outputthem a message box :
Code:
use dfwinty
...
...
integer*4 ret
logical*4 lret
character*100 message
character*5 screenx, screeny
type (T_RECT)  monitor

lret=SystemParametersInfo(SPI_GETWORKAREA, 0, LOC(monitor), 0 )
write(screenx,'(i5)') monitor.right-monitor.left
write(screeny,'(i5)') monitor.bottom-monitor.top
message="screenX="//screenx//",screenY="//screeny
message=TRIM(ADJUSTL(message))//""C
! put up a message box showing the X and Y screen resolutions
ret = MessageBox(NULL, message, "Screen info"C, MB_OK)

Message Edited by anthonyrichards on 09-15-2004 08:30 AM

0 Kudos
Reply