comparison src/dialog-msw.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents cc15677e0335
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */ 19 Boston, MA 02111-1307, USA. */
20 20
21 /* Synched up with: Not in FSF. */ 21 /* Synched up with: Not in FSF. */
22 22
23 /* Autorship: 23 /* Author:
24 Initially written by kkm, May 1998 24 Initially written by kkm, May 1998
25 */ 25 */
26 26
27 #include <config.h> 27 #include <config.h>
28 #include "lisp.h" 28 #include "lisp.h"
44 44
45 /* 45 /*
46 Button metrics 46 Button metrics
47 -------------- 47 --------------
48 All buttons have height of 15 DLU. The minimum width for a button is 32 DLU, 48 All buttons have height of 15 DLU. The minimum width for a button is 32 DLU,
49 but it can be expanded to accomodate its text, so the width is calculated as 49 but it can be expanded to accommodate its text, so the width is calculated as
50 8 DLU per button plus 4 DLU per character. 50 8 DLU per button plus 4 DLU per character.
51 max (32, 6 * text_lenght). The factor of six is rather empirical, but it 51 max (32, 6 * text_length). The factor of six is rather empirical, but it
52 works better than 8 which comes from the definition of a DLU. Buttons are 52 works better than 8 which comes from the definition of a DLU. Buttons are
53 spaced with 6 DLU gap. Minimum distance from the button to the left or right 53 spaced with 6 DLU gap. Minimum distance from the button to the left or right
54 dialog edges is 6 DLU, and the distance between the dialog bottom edge and 54 dialog edges is 6 DLU, and the distance between the dialog bottom edge and
55 buttons is 7 DLU. 55 buttons is 7 DLU.
56 */ 56 */
63 #define Y_BUTTON_FROM_EDGE 7 63 #define Y_BUTTON_FROM_EDGE 7
64 64
65 /* 65 /*
66 Text field metrics 66 Text field metrics
67 ------------------ 67 ------------------
68 Text ditance from lwft and right edges is the same as for buttons, and the 68 Text distance from left and right edges is the same as for buttons, and the
69 top margin is 11 DLU. The static control has height of 2 DLU per control 69 top margin is 11 DLU. The static control has height of 2 DLU per control
70 plus 8 DLU per each line of text. Distance between the bottom edge of the 70 plus 8 DLU per each line of text. Distance between the bottom edge of the
71 control and the button row is 15 DLU. Minimum width of the static control 71 control and the button row is 15 DLU. Minimum width of the static control
72 is 100 DLU, thus giving minmium dialog wight of 112 DLU. Maximum width is 72 is 100 DLU, thus giving minimum dialog weight of 112 DLU. Maximum width is
73 300 DLU, and, if the text is wider than that, the text is wrapped on the 73 300 DLU, and, if the text is wider than that, the text is wrapped on the
74 next line. Each character in the text is considered 4 DLU wide. 74 next line. Each character in the text is considered 4 DLU wide.
75 */ 75 */
76 76
77 #define X_MIN_TEXT 100 77 #define X_MIN_TEXT 100
96 done). Let WBR denote the width of the button row. 96 done). Let WBR denote the width of the button row.
97 97
98 Next, the width of the static field is determined. 98 Next, the width of the static field is determined.
99 First, if all lines of text fit into max (WBR, X_MAX_TEXT), the width of the 99 First, if all lines of text fit into max (WBR, X_MAX_TEXT), the width of the
100 control is the same as the width of the longest line. 100 control is the same as the width of the longest line.
101 Sencond, if all lines of text are narrower than X_MIN_TEXT, then width of 101 Second, if all lines of text are narrower than X_MIN_TEXT, then width of
102 the control is set to X_MIN_TEXT. 102 the control is set to X_MIN_TEXT.
103 Otherwise, width is set to max(WBR, X_AVE_TEXT). In this case, line wrapping will 103 Otherwise, width is set to max(WBR, X_AVE_TEXT). In this case, line wrapping will
104 happen. 104 happen.
105 105
106 If width of the text contol is larger than that of the button row, then the 106 If width of the text control is larger than that of the button row, then the
107 latter is centered accross the dialog, by giving it extra edge 107 latter is centered across the dialog, by giving it extra edge
108 margins. Otherwise, minimal margins are given to the button row. 108 margins. Otherwise, minimal margins are given to the button row.
109 */ 109 */
110 110
111 #define ID_ITEM_BIAS 32 111 #define ID_ITEM_BIAS 32
112 112