123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #include "copyright.h"
- #include "XMenuInt.h"
- int
- XMenuRecompute(Display *display, register XMenu *menu)
-
-
- {
- register XMPane *p_ptr;
- register XMSelect *s_ptr;
- register int p_num;
- register int s_num;
-
- if (menu->p_count == 0) {
- _XMErrorCode = XME_NOT_INIT;
- return(XM_FAILURE);
- }
-
- _XMRecomputeGlobals(display, menu);
-
- p_num = 0;
- for (
- p_ptr = menu->p_list->next;
- p_ptr != menu->p_list;
- p_ptr = p_ptr->next
- ){
-
- if (_XMRecomputePane(display, menu, p_ptr, p_num) == _FAILURE) {
- return(XM_FAILURE);
- }
- p_num++;
-
- s_num = 0;
- for (
- s_ptr = p_ptr->s_list->next;
- s_ptr != p_ptr->s_list;
- s_ptr = s_ptr->next
- ) {
-
- if (_XMRecomputeSelection(display, menu, s_ptr, s_num) == _FAILURE) {
- return(XM_FAILURE);
- }
- s_num++;
- }
- }
-
- if (menu->menu_style == CENTER) {
- menu->width = menu->p_width + (menu->p_bdr_width << 1);
- }
- else {
- menu->width = menu->p_width + (menu->p_bdr_width << 1) +
- ((menu->p_count - 1) * menu->p_x_off);
- }
- menu->height = menu->p_height + (menu->p_bdr_width << 1) +
- ((menu->p_count - 1) * menu->p_y_off);
-
- menu->recompute = 0;
-
- _XMErrorCode = XME_NO_ERROR;
- return(XM_SUCCESS);
- }
|