Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. scaling of GUI objects for touch screens

scaling of GUI objects for touch screens

Scheduled Pinned Locked Moved Windows API
c++jsonhelpquestion
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Theo Buys
    wrote on last edited by
    #1

    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?

    L 1 Reply Last reply
    0
    • T Theo Buys

      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?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      "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.

      T 1 Reply Last reply
      0
      • L Lost User

        "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.

        T Offline
        T Offline
        Theo Buys
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups