comparison src/glyphs-widget.c @ 2297:13a418960a88

[xemacs-hg @ 2004-09-22 02:05:42 by stephent] various doc patches <87isa7awrh.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 22 Sep 2004 02:06:52 +0000
parents 04bc9d2f42c7
children ecf1ebac70d8
comparison
equal deleted inserted replaced
2296:a58ea4d0d0cd 2297:13a418960a88
272 widget_instance_border_width (Lisp_Image_Instance* ii) 272 widget_instance_border_width (Lisp_Image_Instance* ii)
273 { 273 {
274 return widget_border_width (IMAGE_INSTANCE_DOMAIN (ii)); 274 return widget_border_width (IMAGE_INSTANCE_DOMAIN (ii));
275 } 275 }
276 276
277 /* #### Its not clear to me what the value of logical_unit_height should 277 /* #### It's not clear to me what the value of logical_unit_height should
278 be, or whether it should even depend on the current 278 be, or whether it should even depend on the current image_instance. It
279 image_instance. It really should probably only depend on the 279 really should probably only depend on the default widget face and the
280 default widget face and the domain, however you can envisage users 280 domain, however you can envisage users wanting different logical units
281 wanting different logical units for nested layouts - so using the 281 for nested layouts - so using the properties of the current layout is
282 properties of the current lahyout is probably not so dumb. */ 282 probably not so dumb. */
283 static int 283 static int
284 logical_unit_height (Lisp_Object text, Lisp_Object face, Lisp_Object domain) 284 logical_unit_height (Lisp_Object text, Lisp_Object face, Lisp_Object domain)
285 { 285 {
286 int charheight = 0; 286 int charheight = 0;
287 widget_query_string_geometry (text, face, 287 widget_query_string_geometry (text, face,
288 0, &charheight, domain); 288 0, &charheight, domain);
289 /* For the returned value to be useful it needs to be big enough to 289 /* For the returned value to be useful it needs to be big enough to
290 accomodate the largest single-height widget. This is currently 290 accomodate the largest single-height widget. This is currently
291 the edit-field. */ 291 the edit-field. */
292 return charheight + 2 * widget_spacing (domain) 292 return charheight + 2 * widget_spacing (domain)
293 + 4 * widget_border_width (domain); 293 + 4 * widget_border_width (domain);
294 } 294 }
295 295
959 GET_LIST_LENGTH (items, len); 959 GET_LIST_LENGTH (items, len);
960 *height = len * h; 960 *height = len * h;
961 } 961 }
962 } 962 }
963 963
964 /* Get the geometry of a tab control. This is based on the number of 964 /* Get the geometry of a tab control. This is based on the number of
965 items and text therin in the tab control. */ 965 items and text therein in the tab control. */
966 static void 966 static void
967 tab_control_query_geometry (Lisp_Object image_instance, 967 tab_control_query_geometry (Lisp_Object image_instance,
968 int* width, int* height, 968 int* width, int* height,
969 enum image_instance_geometry UNUSED (disp), 969 enum image_instance_geometry UNUSED (disp),
970 Lisp_Object domain) 970 Lisp_Object domain)
976 976
977 LIST_LOOP (rest, items) 977 LIST_LOOP (rest, items)
978 { 978 {
979 int h, w; 979 int h, w;
980 980
981 /* #### Maybe we should allow items to be a list of strings?
982 Ie, autoconvert "label" -> ["label" "label" :selected maybe-t].
983 Maybe there's a better place (or several places) to do this?
984 If so, change image_instantiator_tab_control back to use
985 check_valid_item_list for checking Q_items. -- sjt */
981 widget_query_string_geometry (XGUI_ITEM (XCAR (rest))->name, 986 widget_query_string_geometry (XGUI_ITEM (XCAR (rest))->name,
982 IMAGE_INSTANCE_WIDGET_FACE (ii), 987 IMAGE_INSTANCE_WIDGET_FACE (ii),
983 &w, &h, domain); 988 &w, &h, domain);
984 tw += 5 * widget_instance_border_width (ii); /* some bias */ 989 tw += 5 * widget_instance_border_width (ii); /* some bias */
985 tw += w; 990 tw += w;