This source file includes following definitions.
- XMenuRecompute
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #include "XMenuInt.h"
35
36 int
37 XMenuRecompute(Display *display, register XMenu *menu)
38
39
40 {
41 register XMPane *p_ptr;
42 register XMSelect *s_ptr;
43
44 register int p_num;
45 register int s_num;
46
47
48
49
50
51 if (menu->p_count == 0) {
52 _XMErrorCode = XME_NOT_INIT;
53 return(XM_FAILURE);
54 }
55
56
57
58
59
60 _XMRecomputeGlobals(display, menu);
61
62
63
64
65
66 p_num = 0;
67 for (
68 p_ptr = menu->p_list->next;
69 p_ptr != menu->p_list;
70 p_ptr = p_ptr->next
71 ){
72
73
74
75 if (_XMRecomputePane(display, menu, p_ptr, p_num) == _FAILURE) {
76 return(XM_FAILURE);
77 }
78 p_num++;
79
80
81
82
83 s_num = 0;
84 for (
85 s_ptr = p_ptr->s_list->next;
86 s_ptr != p_ptr->s_list;
87 s_ptr = s_ptr->next
88 ) {
89
90
91
92 if (_XMRecomputeSelection(display, menu, s_ptr, s_num) == _FAILURE) {
93 return(XM_FAILURE);
94 }
95 s_num++;
96 }
97 }
98
99
100
101
102 if (menu->menu_style == CENTER) {
103 menu->width = menu->p_width + (menu->p_bdr_width << 1);
104 }
105 else {
106 menu->width = menu->p_width + (menu->p_bdr_width << 1) +
107 ((menu->p_count - 1) * menu->p_x_off);
108 }
109 menu->height = menu->p_height + (menu->p_bdr_width << 1) +
110 ((menu->p_count - 1) * menu->p_y_off);
111
112
113
114
115 menu->recompute = 0;
116
117
118
119
120 _XMErrorCode = XME_NO_ERROR;
121 return(XM_SUCCESS);
122 }
123