| 1419 | } |
| 1420 | |
| 1421 | void |
| 1422 | SetPropInfo(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 | } |
no outgoing calls
no test coverage detected