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

Dialog Box Text Scaling

tomballard
Beginner
1,395 Views
If I change a font size in one of my dialog boxes from the CVF resource editor, the entire dialog box is scaled accordingly and the text fits the text boxes and pull down menus as designed.

However, if the user has selected large fonts from the display properties settings in the OS (Windows 2000 in this case) and runs my application, the dialog box and text boxes do not fit the text as designed in my application. Has anyone determined how to get around this problem.
0 Kudos
6 Replies
Jugoslav_Dujic
Valued Contributor II
1,395 Views
Size of dialog box and controls are expressed in Dialog Logical Units (DLUs), which are based on size of selected font. See GetDialogBaseUnits entry in documentation. That is designed just for the purpose to enable various font sizes. However, designers must pay attention that the mechanism is inexact and always leave a bit more room for the text on the controls.

However, I find the behaviour you observe a bit strange. You see, text "Text" in given font on e.g. 24-point size is not twice as wide as the same text on 12-point size, but somewhat less. This is consequence of the fact that spacing gets relatively smaller as the size grows. Thus, I'd expect that if you designed it on small fonts, on large fonts it will fit better, not worse. Maybe user has selected different typeface as well?
0 Kudos
Steven_L_Intel1
Employee
1,395 Views
I know exactly what Tom is talking about. On one of my systems I run with "large fonts" enabled. This is a Windows display property that scales fonts by 125% (and gives you larger icons, too.) It applies to all fonts.

In most areas, this works fine, but most applications with dialog boxes don't account for the larger font (I'm not sure why they need to!) and you get the problem Tom describes, where dialog boxes are not resized to accomodate the larger font. I don't know how one programs an application to allow for a "large fonts" selection.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,395 Views
Yes, vendors of many RAD tools and developers in them seem to have forgotten about font scaling. I'm referring to RAD tools (Delphi, Access, FoxPro, VB) because they use "form" windows which don't utilize standard Windows mechanisms. I recall having these problems with an app written in an early Delphi version.

But my point is, if you use standard dialogs from .rc files and standard methods to display them, you should have no problems with this (provided you develop on small fonts). Attached are two screenshots of a dialog of mine on standard large (125%) and small size. Note that text fits better in large version. I did not do anything special about it -- it's a normal DFLOGM-handled dialog.

...
Sorry, the files won't attach (two gifs of ca. 15 kB), so you'll have to trust my words. I keep on getting:

java.lang.IllegalArgumentException at java.net.URLDecoder.decode(URLDecoder.java:60) at _attach__jsp._jspService(_attach__jsp.java:1238) at com.caucho.jsp.JavaPage.service(JavaPage.java:74) at com.caucho.jsp.Page.subservice(Page.java:485) at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:176) at com.caucho.server.http.Invocation.service(Invocation.java:278) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129) at com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:847) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213) at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:484)
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,395 Views
OK, I solved it by merging two gifs in one
0 Kudos
Steven_L_Intel1
Employee
1,395 Views
This makes sense. I don't see the problem on every application, and not with dialog boxes I create using CVF.

Steve
0 Kudos
tomballard
Beginner
1,395 Views
Thanks for the responses on this, but I still don't understand what my problem is. I am using standard DFLOGM handler methods such as DLGINIT, DLGSET and DLGMODAL for initializing and displaying my dialog boxes from the .rc files created by CVF. This does not automatically scale the dialog boxes based on 125% font scaling in my application. There must be something a bit more subtle that I don't understand about dialog box handling.
0 Kudos
Reply