Announcement

Collapse
No announcement yet.

Measurement units

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Measurement units

    Is there a way to set the measurement units globally for a program? At the moment i,m using DDT Dialogs with a statusbar, but the Dialog and the statusbar are using different measurement units. It's difficult to get things aligned that way.....

    Peter
    Regards,
    Peter

  • #2
    DDT uses dialog-units and custom-controls (the most probable way you created the statusbar control... CONTROL ADD "msctls_statusbar32") will use logical points.

    There is no way to set a "global unit of measure", so the DIALOG UNIS and DIALOG PIXELS statements (and maybe DCtoLP() and LPtoDC() API's under some circumstances) must be used to translate between the coordinate systems as appropriate.

    -------------
    Lance
    PowerBASIC Support
    ( mailto:[email protected][email protected]</A> )
    Lance
    mailto:[email protected]

    Comment


    • #3
      I already was afraid there was no way to do it globally.... Thanks.
      Peter
      Regards,
      Peter

      Comment


      • #4
        You can do it on a per-window basis with the SetMapMode() API function. I have often found it useful to tell windows/controls to operate in pixels instead of those annoying logical/dialog box units.
        If you try to make something idiot-proof, someone will invent a better idiot.

        Comment


        • #5
          Thanks, I'll try it. It would be a nice option for DDT to be able to set the default unit to pixels. It's just much easier to work with...
          Peter
          Regards,
          Peter

          Comment


          • #6
            SetMapMode() is used to change the scale and orientation of the axes of a device context ... great for working with the client area of a window/dialog, or a custom control (of your own design), but mostly useless for sending parameters to a standard child control. Unless you are using a private or class device context, the mapping mode is released when the DC is released.

            -------------
            Lance
            PowerBASIC Support
            ( mailto:[email protected][email protected]</A> )
            Lance
            mailto:[email protected]

            Comment

            Working...
            X