Lines Matching refs:smw

50 #define ForAllChildren(smw, childP)				\
51 for ((childP) = (SmeObject *)(smw)->composite.children; \
52 (childP) < (SmeObject *)((smw)->composite.children \
53 + (smw)->composite.num_children); \
399 SimpleMenuWidget smw = (SimpleMenuWidget)cnew;
404 if (smw->simple_menu.label_class == NULL)
405 smw->simple_menu.label_class = smeBSBObjectClass;
407 smw->simple_menu.label = NULL;
408 smw->simple_menu.entry_set = NULL;
409 smw->simple_menu.recursive_set_values = False;
411 smw->simple_menu.sub_menu = NULL;
412 smw->simple_menu.state = 0;
417 if (smw->simple_menu.label_string != NULL)
423 smw->simple_menu.menu_width = True;
425 if (XtWidth(smw) == 0) {
426 smw->simple_menu.menu_width = False;
427 XtWidth(smw) = width;
430 smw->simple_menu.menu_height = True;
432 if (XtHeight(smw) == 0) {
433 smw->simple_menu.menu_height = False;
434 XtHeight(smw) = height;
459 SimpleMenuWidget smw = (SimpleMenuWidget)w;
467 if (smw->simple_menu.display_list)
468 XawRunDisplayList(w, smw->simple_menu.display_list, event, region);
474 ForAllChildren(smw, entry) {
510 SimpleMenuWidget smw = (SimpleMenuWidget)w;
515 attrs->cursor = smw->simple_menu.cursor;
517 if (smw->simple_menu.backing_store == Always ||
518 smw->simple_menu.backing_store == NotUseful ||
519 smw->simple_menu.backing_store == WhenMapped) {
521 attrs->backing_store = smw->simple_menu.backing_store;
699 SimpleMenuWidget smw = (SimpleMenuWidget)XtParent(w);
731 Layout((Widget)smw, NULL, NULL);
861 SimpleMenuWidget smw = (SimpleMenuWidget)w;
862 SmeObject entry = smw->simple_menu.entry_set;
868 if (!smw->simple_menu.sub_menu)
873 smw->simple_menu.entry_set = NULL;
896 SimpleMenuWidget smw = (SimpleMenuWidget)w;
904 if (entry == smw->simple_menu.entry_set)
908 if (!smw->simple_menu.sub_menu)
919 if (smw->simple_menu.sub_menu)
920 PopdownSubMenu(smw);
926 if (!(smw->simple_menu.state & SMW_UNMAPPING))
931 smw->simple_menu.entry_set = entry;
938 PopupSubMenu(smw);
999 * w - smw widget
1010 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1012 return ((Widget)smw->simple_menu.entry_set);
1020 * w - smw widget
1028 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1030 smw->simple_menu.entry_set = NULL;
1041 * w - smw widget
1050 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1055 if (smw->simple_menu.label_string == NULL ||
1056 smw->simple_menu.label != NULL) {
1063 XtSetArg(args[0], XtNlabel, smw->simple_menu.label_string);
1065 smw->simple_menu.label = (SmeObject)
1067 smw->simple_menu.label_class, w, args, TWO);
1070 for (child = smw->composite.children + smw->composite.num_children,
1071 i = (int)smw->composite.num_children; i > 0; i--, child--) {
1078 *child = (Widget)smw->simple_menu.label;
1104 SimpleMenuWidget smw;
1114 smw = (SimpleMenuWidget)w;
1118 smw = (SimpleMenuWidget)XtParent(w);
1122 allow_change_size = (!XtIsRealized((Widget)smw)
1123 || smw->shell.allow_shell_resize);
1125 for (i = smw->simple_menu.label ? 1 : 0;
1126 i < smw->composite.num_children;
1130 kid = smw->composite.children[i];
1133 if (smw->simple_menu.row_height != 0)
1134 XtHeight(kid) = smw->simple_menu.row_height;
1140 if (smw->simple_menu.label
1141 && XtIsManaged((Widget)smw->simple_menu.label)) {
1144 kid = (Widget)smw->simple_menu.label;
1153 if (!smw->simple_menu.menu_width)
1154 XtWidth(smw) = 0;
1155 if (!smw->simple_menu.menu_height)
1156 XtHeight(smw) = 0;
1157 if (!XtWidth(smw) || !XtHeight(smw))
1158 MakeResizeRequest((Widget)smw);
1162 hadd = (short)smw->simple_menu.left_margin;
1166 vadd = (short)smw->simple_menu.top_margin;
1167 if (smw->simple_menu.label)
1168 vadd = (short)(vadd + XtHeight(smw->simple_menu.label));
1174 for (i = smw->simple_menu.label ? 1 : 0;
1175 i < smw->composite.num_children;
1177 kid = smw->composite.children[i];
1183 if (n && (height + height_kid + smw->simple_menu.bottom_margin
1184 > XtHeight(smw))) {
1202 height = (Dimension)(tmp_h + smw->simple_menu.bottom_margin);
1205 if (smw->simple_menu.label && width < XtWidth(smw->simple_menu.label)) {
1208 inc = (float)(XtWidth(smw->simple_menu.label) - width) / (float)count;
1209 width = XtWidth(smw->simple_menu.label);
1215 width = (Dimension)(width + (hadd + smw->simple_menu.right_margin));
1222 for (i = smw->simple_menu.label ? 1 : 0;
1223 i < smw->composite.num_children;
1225 kid = smw->composite.children[i];
1231 if (n && (tmp_h + height_kid + smw->simple_menu.bottom_margin
1232 > XtHeight(smw))) {
1253 MakeSetValuesRequest((Widget) smw, width, height);
1255 if (smw->simple_menu.label) {
1256 XtX(smw->simple_menu.label) = 0;
1257 XtY(smw->simple_menu.label) = (Position)smw->simple_menu.top_margin;
1258 XtWidth(smw->simple_menu.label) = (Dimension)(XtWidth(smw)
1260 - (smw->simple_menu.left_margin + smw->simple_menu.right_margin)
1337 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1365 if (smw->simple_menu.popup_entry == NULL)
1366 entry = smw->simple_menu.label;
1368 entry = smw->simple_menu.popup_entry;
1394 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1396 if (smw->simple_menu.menu_on_screen) {
1441 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1449 smw->simple_menu.cursor,
1465 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1467 if (!smw->simple_menu.recursive_set_values) {
1468 if (XtWidth(smw) != width || XtHeight(smw) != height) {
1472 smw->simple_menu.recursive_set_values = True;
1477 else if (XtIsRealized((Widget)smw))
1478 XawSimpleMenuRedisplay((Widget)smw, NULL, NULL);
1480 smw->simple_menu.recursive_set_values = False;
1486 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1489 ForAllChildren(smw, entry) {
1497 if (*entry == smw->simple_menu.label)
1525 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1553 if (x_loc < 0 || x_loc >= XtWidth(smw) ||
1554 y_loc < 0 || y_loc >= XtHeight(smw))
1558 * smw->simple_menu.menu_on_screen because menus is bigger than screen
1562 if (smw->simple_menu.entry_set) {
1564 XtX(smw->simple_menu.entry_set)
1565 + XtWidth(smw->simple_menu.entry_set) + 1,
1586 if (smw->simple_menu.entry_set) {
1587 entry = DoGetEventEntry(w, XtX(smw->simple_menu.entry_set) - 1,
1727 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1733 smw = (SimpleMenuWidget)w;
1734 smw->simple_menu.entry_set = NULL;
1740 smw->simple_menu.state |= SMW_UNMAPPING;
1741 if (smw->simple_menu.sub_menu)
1742 PopdownSubMenu(smw);
1747 PopupSubMenu(SimpleMenuWidget smw)
1752 SmeBSBObject entry = (SmeBSBObject)smw->simple_menu.entry_set;
1759 if ((menu = FindMenu((Widget)smw, entry->sme_bsb.menu_name)) == NULL)
1762 smw->simple_menu.sub_menu = menu;
1767 popleft = (smw->simple_menu.state & SMW_POPLEFT) != 0;
1770 XtTranslateCoords((Widget)smw,
1775 XtTranslateCoords((Widget)smw,
1776 (Position)XtWidth(smw),
1784 menu_x = (Position)(menu_x - (XtWidth(menu) + XtWidth(smw)));
1815 PopdownSubMenu(SimpleMenuWidget smw)
1817 SimpleMenuWidget menu = (SimpleMenuWidget)smw->simple_menu.sub_menu;
1827 smw->simple_menu.sub_menu = NULL;
1834 SimpleMenuWidget smw = (SimpleMenuWidget)w;
1836 smw->simple_menu.state &= (unsigned char)(~(SMW_UNMAPPING | SMW_POPLEFT));