You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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.....
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.
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.
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.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment