scaling of GUI objects for touch screens
-
My native C++/MFC desktop-application is hard to touch with the current high resolution touch-screens. The API GetDeviceCaps don't help because it don't reply the right sizes of the screen. The scaling of GUI-objects seems to become a nightmare to keep them touchable. The Windows OS also did not help. There is only a option to size the text in template resources with 100% (standard), 125% and 150%. But that resizes the complete desktop. There is no option for a single application. The size of template dialog-windows is based on the font points. But is seems hard to change this dynamical for all dialogs en message-boxes. Does anyone have a solution for this?
-
My native C++/MFC desktop-application is hard to touch with the current high resolution touch-screens. The API GetDeviceCaps don't help because it don't reply the right sizes of the screen. The scaling of GUI-objects seems to become a nightmare to keep them touchable. The Windows OS also did not help. There is only a option to size the text in template resources with 100% (standard), 125% and 150%. But that resizes the complete desktop. There is no option for a single application. The size of template dialog-windows is based on the font points. But is seems hard to change this dynamical for all dialogs en message-boxes. Does anyone have a solution for this?
"Years ago" when I needed to rescale an app, I retrieved the current "system metrics" and rescaled each form in its constructor by iterating over all the controls; recalculating Top, Left, Width and Height by some factor; and changing the Font sizes by some factor. Sounds formidable, but in fact it was only a couple of hundred lines of shared code for all the base classes. This worked as long as one had not used any "custom" code for layout.
-
"Years ago" when I needed to rescale an app, I retrieved the current "system metrics" and rescaled each form in its constructor by iterating over all the controls; recalculating Top, Left, Width and Height by some factor; and changing the Font sizes by some factor. Sounds formidable, but in fact it was only a couple of hundred lines of shared code for all the base classes. This worked as long as one had not used any "custom" code for layout.
Thanks for reply. "Years ago" I have only to deal with visibility. With the mouse you can click them all. But today people like to foul the screen with their fingers. It seems that the API GetDeviceCaps did not work right with the new Windows Display Driver Model (WDDM) beginning with Windows Vista. I found out a way to get the screen driver info from registry but that don't work for old XP. I hope OS gets an upgrade to better support touchable objects for native desktop applications.