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

Function SetPropInfo

sys/amiga/winamenu.c:1421–1456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419}
1420
1421void
1422SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total, long top)
1423{
1424 long mflags;
1425 long hidden;
1426 int body, pot;
1427
1428 hidden = max(total - vis, 0);
1429
1430 /* Force the last section to be just to the bottom */
1431
1432 if (top > hidden)
1433 top = hidden;
1434
1435 /* Scale the body position. */
1436 /* 2 lines overlap */
1437
1438 if (hidden > 0 && total > 2)
1439 body = (ULONG)((vis - 2) * MAXBODY) / (total - 2);
1440 else
1441 body = MAXBODY;
1442
1443 if (hidden > 0)
1444 pot = (ULONG)(top * MAXPOT) / hidden;
1445 else
1446 pot = 0;
1447
1448 mflags = AUTOKNOB | FREEVERT;
1449#ifdef INTUI_NEW_LOOK
1450 if (IntuitionBase->LibNode.lib_Version >= 37) {
1451 mflags |= PROPNEWLOOK;
1452 }
1453#endif
1454
1455 NewModifyProp(gad, win, NULL, mflags, 0, pot, MAXBODY, body, 1);
1456}

Callers 3

DoMenuScrollFunction · 0.85
amii_putstrFunction · 0.85
amii_doprev_messageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected