comparison lwlib/xlwmenu.c @ 1201:c2569faae8ed

[xemacs-hg @ 2003-01-12 10:45:53 by michaels] 2002-12-16 Ben Wing <ben@xemacs.org> * lwlib-Xlw.c (xlw_update_one_widget): * lwlib-Xm.c (xm_update_one_widget): * lwlib-Xm.c (xm_update_one_value): * lwlib.c: * lwlib.c (merge_scrollbar_values): * xlwmenu.c: * xlwmenu.c (display_menu): * xlwmenu.c (XlwMenuInitialize): * xlwmenu.c (XlwMenuSetValues): * xlwradio.c: * xlwradio.c (RadioClassPartInit): * xlwradio.c (RadioSet): * xlwradio.c (RadioUnset): class -> class_, new -> new_.
author michaels
date Sun, 12 Jan 2003 10:45:53 +0000
parents b39c14581166
children 8c5cf108f035
comparison
equal deleted inserted replaced
1200:6eeff8af17a2 1201:c2569faae8ed
149 {XtNresourceLabels, XtCResourceLabels, XtRBoolean, sizeof (Boolean), 149 {XtNresourceLabels, XtCResourceLabels, XtRBoolean, sizeof (Boolean),
150 offset (menu.lookup_labels), XtRImmediate, (XtPointer)False}, 150 offset (menu.lookup_labels), XtRImmediate, (XtPointer)False},
151 }; 151 };
152 #undef offset 152 #undef offset
153 153
154 static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new, 154 static Boolean XlwMenuSetValues (Widget current, Widget request, Widget new_,
155 ArgList args, Cardinal *num_args); 155 ArgList args, Cardinal *num_args);
156 static void XlwMenuRealize (Widget w, Mask *valueMask, 156 static void XlwMenuRealize (Widget w, Mask *valueMask,
157 XSetWindowAttributes *attributes); 157 XSetWindowAttributes *attributes);
158 static void XlwMenuRedisplay (Widget w, XEvent *ev, Region region); 158 static void XlwMenuRedisplay (Widget w, XEvent *ev, Region region);
159 static void XlwMenuResize (Widget w); 159 static void XlwMenuResize (Widget w);
160 static void XlwMenuInitialize (Widget request, Widget new, ArgList args, 160 static void XlwMenuInitialize (Widget request, Widget new_, ArgList args,
161 Cardinal *num_args); 161 Cardinal *num_args);
162 static void XlwMenuDestroy (Widget w); 162 static void XlwMenuDestroy (Widget w);
163 static void XlwMenuClassInitialize (void); 163 static void XlwMenuClassInitialize (void);
164 static void Start (Widget w, XEvent *ev, String *params, Cardinal *num_params); 164 static void Start (Widget w, XEvent *ev, String *params, Cardinal *num_params);
165 static void Drag (Widget w, XEvent *ev, String *params, Cardinal *num_params); 165 static void Drag (Widget w, XEvent *ev, String *params, Cardinal *num_params);
2198 } 2198 }
2199 2199
2200 static void 2200 static void
2201 display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p, 2201 display_menu (XlwMenuWidget mw, int level, Boolean just_compute_p,
2202 XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return, 2202 XPoint *highlighted_pos, XPoint *hit, widget_value **hit_return,
2203 widget_value *this, widget_value *that) 2203 widget_value *this_, widget_value *that)
2204 { 2204 {
2205 widget_value *val; 2205 widget_value *val;
2206 widget_value *following_item; 2206 widget_value *following_item;
2207 window_state *ws; 2207 window_state *ws;
2208 XPoint where; 2208 XPoint where;
2270 else 2270 else
2271 highlighted_pos->y = where.y; 2271 highlighted_pos->y = where.y;
2272 } 2272 }
2273 2273
2274 just_compute_this_one_p = 2274 just_compute_this_one_p =
2275 just_compute_p || ((this || that) && val != this && val != that); 2275 just_compute_p || ((this_ || that) && val != this_ && val != that);
2276 2276
2277 start.x = where.x; 2277 start.x = where.x;
2278 start.y = where.y; 2278 start.y = where.y;
2279 display_menu_item (mw, val, ws, &where, highlighted_p, horizontal_p, 2279 display_menu_item (mw, val, ws, &where, highlighted_p, horizontal_p,
2280 just_compute_this_one_p); 2280 just_compute_this_one_p);
2998 return font; 2998 return font;
2999 } 2999 }
3000 #endif /* NEED_MOTIF */ 3000 #endif /* NEED_MOTIF */
3001 3001
3002 static void 3002 static void
3003 XlwMenuInitialize (Widget request, Widget new, ArgList args, 3003 XlwMenuInitialize (Widget request, Widget new_, ArgList args,
3004 Cardinal *num_args) 3004 Cardinal *num_args)
3005 { 3005 {
3006 /* Get the GCs and the widget size */ 3006 /* Get the GCs and the widget size */
3007 XlwMenuWidget mw = (XlwMenuWidget)new; 3007 XlwMenuWidget mw = (XlwMenuWidget)new_;
3008 Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw))); 3008 Window window = RootWindowOfScreen (DefaultScreenOfDisplay (XtDisplay (mw)));
3009 Display *display = XtDisplay (mw); 3009 Display *display = XtDisplay (mw);
3010 3010
3011 /* mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */ 3011 /* mw->menu.cursor = XCreateFontCursor (display, mw->menu.cursor_shape); */
3012 mw->menu.cursor = mw->menu.cursor_shape; 3012 mw->menu.cursor = mw->menu.cursor_shape;
3161 if (mw->menu.windows) 3161 if (mw->menu.windows)
3162 XtFree ((char *) mw->menu.windows); 3162 XtFree ((char *) mw->menu.windows);
3163 } 3163 }
3164 3164
3165 static Boolean 3165 static Boolean
3166 XlwMenuSetValues (Widget current, Widget request, Widget new, ArgList args, 3166 XlwMenuSetValues (Widget current, Widget request, Widget new_, ArgList args,
3167 Cardinal *num_args) 3167 Cardinal *num_args)
3168 { 3168 {
3169 XlwMenuWidget oldmw = (XlwMenuWidget)current; 3169 XlwMenuWidget oldmw = (XlwMenuWidget)current;
3170 XlwMenuWidget newmw = (XlwMenuWidget)new; 3170 XlwMenuWidget newmw = (XlwMenuWidget)new_;
3171 Boolean redisplay = False; 3171 Boolean redisplay = False;
3172 int i; 3172 int i;
3173 3173
3174 if (newmw->menu.contents 3174 if (newmw->menu.contents
3175 && newmw->menu.contents->contents 3175 && newmw->menu.contents->contents