* Sets up a blank list with the specified size and position. * @param width Width in pixels. * @param height Height in pixels. * @param x X position in pixels. * @param y Y position in pixels. */
| 39 | * @param y Y position in pixels. |
| 40 | */ |
| 41 | TextList::TextList(int width, int height, int x, int y) : InteractiveSurface(width, height, x, y), _texts(), _columns(), _big(0), _small(0), _font(0), _scroll(0), _visibleRows(0), _selRow(0), _color(0), _dot(false), _selectable(false), _condensed(false), _contrast(false), _wrap(false), |
| 42 | _bg(0), _selector(0), _margin(0), _scrolling(true), _arrowLeft(), _arrowRight(), _arrowPos(-1), _scrollPos(4), _arrowType(ARROW_VERTICAL), |
| 43 | _leftClick(0), _leftPress(0), _leftRelease(0), _rightClick(0), _rightPress(0), _rightRelease(0), _arrowsLeftEdge(0), _arrowsRightEdge(0), _comboBox(0) |
| 44 | { |
| 45 | _up = new ArrowButton(ARROW_BIG_UP, 13, 14, getX() + getWidth() + _scrollPos, getY()); |
| 46 | _up->setVisible(false); |
| 47 | _up->setTextList(this); |
| 48 | _down = new ArrowButton(ARROW_BIG_DOWN, 13, 14, getX() + getWidth() + _scrollPos, getY() + getHeight() - 14); |
| 49 | _down->setVisible(false); |
| 50 | _down->setTextList(this); |
| 51 | int h = std::max(_down->getY() - _up->getY() - _up->getHeight(), 1); |
| 52 | _scrollbar = new ScrollBar(_up->getWidth(), h, getX() + getWidth() + _scrollPos, _up->getY() + _up->getHeight()); |
| 53 | _scrollbar->setVisible(false); |
| 54 | _scrollbar->setTextList(this); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Deletes all the stuff contained in the list. |
nothing calls this directly
no test coverage detected