comparison src/xmenu.c @ 7521:2971264ff9aa

(xmenu_show): Completely ignore nameless panes except for the first pane. Ignore named panes too if KEYMAPS.
author Richard M. Stallman <rms@gnu.org>
date Tue, 17 May 1994 04:30:32 +0000
parents 1a6156c8731e
children 371ae57ac9a8
comparison
equal deleted inserted replaced
7520:6cc6328992d6 7521:2971264ff9aa
1380 struct event_queue *queue = NULL; 1380 struct event_queue *queue = NULL;
1381 struct event_queue *queue_tmp; 1381 struct event_queue *queue_tmp;
1382 1382
1383 Position root_x, root_y; 1383 Position root_x, root_y;
1384 1384
1385 int first_pane;
1386
1385 *error = NULL; 1387 *error = NULL;
1386 1388
1387 if (menu_items_used <= MENU_ITEMS_PANE_LENGTH) 1389 if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
1388 { 1390 {
1389 *error = "Empty menu"; 1391 *error = "Empty menu";
1436 wv = malloc_widget_value (); 1438 wv = malloc_widget_value ();
1437 wv->name = "menu"; 1439 wv->name = "menu";
1438 wv->value = 0; 1440 wv->value = 0;
1439 wv->enabled = 1; 1441 wv->enabled = 1;
1440 first_wv = wv; 1442 first_wv = wv;
1443 first_pane = 1;
1441 1444
1442 /* Loop over all panes and items, filling in the tree. */ 1445 /* Loop over all panes and items, filling in the tree. */
1443 i = 0; 1446 i = 0;
1444 while (i < menu_items_used) 1447 while (i < menu_items_used)
1445 { 1448 {
1446 if (EQ (XVECTOR (menu_items)->contents[i], Qnil)) 1449 if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
1447 { 1450 {
1448 submenu_stack[submenu_depth++] = save_wv; 1451 submenu_stack[submenu_depth++] = save_wv;
1449 save_wv = prev_wv; 1452 save_wv = prev_wv;
1450 prev_wv = 0; 1453 prev_wv = 0;
1454 first_pane = 1;
1451 i++; 1455 i++;
1452 } 1456 }
1453 else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda)) 1457 else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
1454 { 1458 {
1455 prev_wv = save_wv; 1459 prev_wv = save_wv;
1456 save_wv = submenu_stack[--submenu_depth]; 1460 save_wv = submenu_stack[--submenu_depth];
1461 first_pane = 0;
1457 i++; 1462 i++;
1458 } 1463 }
1459 else if (EQ (XVECTOR (menu_items)->contents[i], Qt) 1464 else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
1460 && submenu_depth != 0) 1465 && submenu_depth != 0)
1461 i += MENU_ITEMS_PANE_LENGTH; 1466 i += MENU_ITEMS_PANE_LENGTH;
1478 pane_string = ""; 1483 pane_string = "";
1479 1484
1480 /* If the pane has a meaningful name, 1485 /* If the pane has a meaningful name,
1481 make the pane a top-level menu item 1486 make the pane a top-level menu item
1482 with its items as a submenu beneath it. */ 1487 with its items as a submenu beneath it. */
1483 if (strcmp (pane_string, "")) 1488 if (!keymaps && strcmp (pane_string, ""))
1484 { 1489 {
1485 wv = malloc_widget_value (); 1490 wv = malloc_widget_value ();
1486 if (save_wv) 1491 if (save_wv)
1487 save_wv->next = wv; 1492 save_wv->next = wv;
1488 else 1493 else
1490 wv->name = pane_string; 1495 wv->name = pane_string;
1491 if (keymaps && !NILP (prefix)) 1496 if (keymaps && !NILP (prefix))
1492 wv->name++; 1497 wv->name++;
1493 wv->value = 0; 1498 wv->value = 0;
1494 wv->enabled = 1; 1499 wv->enabled = 1;
1495 } 1500 save_wv = wv;
1496 save_wv = wv; 1501 prev_wv = 0;
1497 prev_wv = 0; 1502 }
1503 else if (first_pane)
1504 {
1505 save_wv = wv;
1506 prev_wv = 0;
1507 }
1508 first_pane = 0;
1498 i += MENU_ITEMS_PANE_LENGTH; 1509 i += MENU_ITEMS_PANE_LENGTH;
1499 } 1510 }
1500 else 1511 else
1501 { 1512 {
1502 /* Create a new item within current pane. */ 1513 /* Create a new item within current pane. */