| 7572 | } |
| 7573 | |
| 7574 | int Item_TextScroll_OverLB ( itemDef_t *item, float x, float y ) |
| 7575 | { |
| 7576 | rectDef_t r; |
| 7577 | textScrollDef_t *scrollPtr; |
| 7578 | int thumbstart; |
| 7579 | |
| 7580 | scrollPtr = (textScrollDef_t*)item->typeData; |
| 7581 | |
| 7582 | // Scroll bar isn't drawing so ignore this input |
| 7583 | if ((( scrollPtr->iLineCount * scrollPtr->lineHeight ) <= (item->window.rect.h - 2)) && (item->type == ITEM_TYPE_TEXTSCROLL)) |
| 7584 | { |
| 7585 | return 0; |
| 7586 | } |
| 7587 | |
| 7588 | r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; |
| 7589 | r.y = item->window.rect.y; |
| 7590 | r.h = r.w = SCROLLBAR_SIZE; |
| 7591 | if (Rect_ContainsPoint(&r, x, y)) |
| 7592 | { |
| 7593 | return WINDOW_LB_LEFTARROW; |
| 7594 | } |
| 7595 | |
| 7596 | r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; |
| 7597 | if (Rect_ContainsPoint(&r, x, y)) |
| 7598 | { |
| 7599 | return WINDOW_LB_RIGHTARROW; |
| 7600 | } |
| 7601 | |
| 7602 | thumbstart = Item_TextScroll_ThumbPosition(item); |
| 7603 | r.y = thumbstart; |
| 7604 | if (Rect_ContainsPoint(&r, x, y)) |
| 7605 | { |
| 7606 | return WINDOW_LB_THUMB; |
| 7607 | } |
| 7608 | |
| 7609 | r.y = item->window.rect.y + SCROLLBAR_SIZE; |
| 7610 | r.h = thumbstart - r.y; |
| 7611 | if (Rect_ContainsPoint(&r, x, y)) |
| 7612 | { |
| 7613 | return WINDOW_LB_PGUP; |
| 7614 | } |
| 7615 | |
| 7616 | r.y = thumbstart + SCROLLBAR_SIZE; |
| 7617 | r.h = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; |
| 7618 | if (Rect_ContainsPoint(&r, x, y)) |
| 7619 | { |
| 7620 | return WINDOW_LB_PGDN; |
| 7621 | } |
| 7622 | |
| 7623 | return 0; |
| 7624 | } |
| 7625 | |
| 7626 | void Item_TextScroll_MouseEnter (itemDef_t *item, float x, float y) |
| 7627 | { |
no test coverage detected