================= Item_ListBox_MaxScroll ================= */
| 8883 | ================= |
| 8884 | */ |
| 8885 | int Item_ListBox_MaxScroll(itemDef_t *item) |
| 8886 | { |
| 8887 | listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; |
| 8888 | int count = DC->feederCount(item->special); |
| 8889 | int max; |
| 8890 | |
| 8891 | if (item->window.flags & WINDOW_HORIZONTAL) |
| 8892 | { |
| 8893 | max = count - (item->window.rect.w / listPtr->elementWidth) + 1; |
| 8894 | } |
| 8895 | else |
| 8896 | { |
| 8897 | max = count - (item->window.rect.h / listPtr->elementHeight) + 1; |
| 8898 | } |
| 8899 | |
| 8900 | if (max < 0) |
| 8901 | { |
| 8902 | return 0; |
| 8903 | } |
| 8904 | return max; |
| 8905 | } |
| 8906 | |
| 8907 | /* |
| 8908 | ================= |
no outgoing calls
no test coverage detected