MCPcopy Create free account
hub / github.com/NetHack/NetHack / ToggleMenuSelect

Function ToggleMenuSelect

outdated/sys/mac/macwin.c:1442–1456  ·  view source on GitHub ↗

* Routine used to select and de-select elements in a menu window, used by * KeyMenu, * ClickMenu, and UpdateMenu. Takes the NhWindow and a line ref relative to * the scrollbar. */

Source from the content-addressed store, hash-verified

1440 * the scrollbar.
1441 */
1442static void
1443ToggleMenuSelect(NhWindow *aWin, int line)
1444{
1445 Rect r;
1446
1447 GetWindowBounds(aWin->its_window, kWindowContentRgn, &r);
1448 OffsetRect(&r, -r.left, -r.top);
1449 if (aWin->scrollBar)
1450 r.right -= SBARWIDTH;
1451 r.top = line * aWin->row_height;
1452 r.bottom = r.top + aWin->row_height;
1453
1454 LMSetHiliteMode((UInt8)(LMGetHiliteMode() & 0x7F));
1455 InvertRect(&r);
1456}
1457
1458/*
1459 * Check to see if given item is selected, return index if it is

Callers 3

MenwKeyFunction · 0.85
MenwClickFunction · 0.85
MenwUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected