{"id":63,"date":"2009-07-07T10:36:32","date_gmt":"2009-07-07T10:36:32","guid":{"rendered":""},"modified":"2009-07-07T10:36:32","modified_gmt":"2009-07-07T10:36:32","slug":"using-different-measurement-units-on-win","status":"publish","type":"post","link":"http:\/\/www.icetips.com\/blog_wp\/2009\/07\/07\/using-different-measurement-units-on-win\/","title":{"rendered":"Using different measurement units on windows"},"content":{"rendered":"<p>Clarion uses dialog units as screen position measurement unit when designing windows.  This is fixed and cannot be changed at design time, but it can be changed at runtime.  For window design we can use <b>PROP:Pixels<\/b> and to change to pixels it is a simple matter of setting PROP:Pixels to true for the window object, like:<\/p>\n<div style=\"border: 1px solid gray;padding: 2px;background:#FBFFE8;margin-bottom:10px\">\n<pre>\r\n WindowLabel {PROP:Pixels} = True\r\n<\/pre>\n<\/div>\n<p>Or:<\/p>\n<div style=\"border: 1px solid gray;padding: 2px;background:#FBFFE8;margin-bottom:10px\">\n<pre>\r\n 0 {PROP:Pixels} = True\r\n<\/pre>\n<\/div>\n<p>Since 0 (zero) always refers to the structure of the current target object.  To set the window back to using dialog units, simply set PROP:Pixels to false:<\/p>\n<div style=\"border: 1px solid gray;padding: 2px;background:#FBFFE8;margin-bottom:10px\">\n<pre>\r\n 0 {PROP:Pixels} = False\r\n<\/pre>\n<\/div>\n<p>It may not be immediately obvious, but you can also use a few other measurement units when dealing with windows at runtime.  There are 3 more measurement units that can be used: <b>PROP:Thous<\/b>, <b>PROP:mm<\/b> and <b>PROP:Points<\/b>.  If you set the properties to false Clarion goes back to dialog units.  Normally we would only think of using PROP:Thous, PROP:mm and PROP:Points on reports, but they work equally well on windows!<\/p>\n<p>The smallest unit you can use with PROP:Thous is 1 which equals 0.0254mm.  Point is 1\/72\" equal to about 0.353mm.  With millimeters, the smallest unit is 2 (or at least it used to be) or 100 times bigger than the smallest unit with PROP:Thous, which makes it pretty much useless for any precision placements.  If I need to set sizes in metric units I convert to 1\/1000\"  It may not always be perfect but for most things I think it is close enough.<\/p>\n<p>If you have a control on a report, for example a fixed width textbox and you want the user of your software to be able to format the contents on a window so that it will look exactly as it will print, you can get the measurement from the report and use it to set the size of the textbox on a window.  Let<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_63\" class=\"pvc_stats all  \" data-element-id=\"63\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"http:\/\/www.icetips.com\/blog_wp\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Clarion uses dialog units as screen position measurement unit when designing windows. This is fixed and cannot be changed at design time, but it can be changed at runtime. For window design we can use PROP:Pixels and to change to pixels it is a simple matter of setting PROP:Pixels to true for the window object, <a href=\"http:\/\/www.icetips.com\/blog_wp\/2009\/07\/07\/using-different-measurement-units-on-win\/\" class=\"more-link\">...continue reading <span class=\"screen-reader-text\">Using different measurement units on windows<\/span><\/a><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_63\" class=\"pvc_stats all  \" data-element-id=\"63\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"http:\/\/www.icetips.com\/blog_wp\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/comments?post=63"}],"version-history":[{"count":0,"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.icetips.com\/blog_wp\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}