jwinkl Posted August 24, 2013 Posted August 24, 2013 Hi, does anyone know a way to define the width of a DCL dialog box in pixel units? The command width = 200; makes the dialog window not 200 pixels wide, but fills nearly the whole width of the screen (1600 pixels). Quote
Lee Mac Posted August 24, 2013 Posted August 24, 2013 In my experience, the following formulae provide a good approximation: tw = pw/6 th = ph/13 Where: tw / th = Tile Width / Height pw / ph = Pixel Width / Height Hence, for a 200x100 pixel tile, you would use the following: width = 33.33; height = 7.69; fixed_width = true; fixed_height = true; Example: test : dialog { spacer; : image { key = "img"; width = 33.33; height = 7.69; fixed_width = true; fixed_height = true; color = 0; } spacer; ok_only; } Quote
jwinkl Posted August 24, 2013 Author Posted August 24, 2013 Thanks a lot. Do you or does anyone know why DCL has this behaviour, that seems to me somewhat lunatic? Dialog windows don't make any sense but on a screen, so it would be natural to use the same units as the screen does - pixels, that is. Quote
Lee Mac Posted August 24, 2013 Posted August 24, 2013 As stated in the Developer Documentation, DCL uses units corresponding to the height & width of characters: width Possible values are an integer or a real number representing the distance in character-width units. ... Character width units are defined as the average width of all uppercase and lowercase alphabetic characters, or the screen width divided by 80, whichever is less (average width is (width(A .. Z) + width (a .. z)))/52 ). height Possible values are an integer or a real number representing the distance in character height units. ... Character-height units are defined as the maximum height of screen characters (including line spacing). Though, I do not know why these units were chosen. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.