36 void insertItem(
int index,
const String &
item);
40 int currentIndex()
const {
return _currentIndex; }
41 void setCurrentIndex(
int index);
43 String currentItem()
const;
44 int count()
const {
return static_cast<int>(_items.
size()); }
79 int _currentIndex = -1;
80 int _scrollOffset = 0;
81 bool _dragging =
false;
84 int contentWidth()
const;
87 int thumbSize()
const;
88 int trackHeight()
const;
Event delivered when a key is pressed or released.
Definition keyevent.h:22
Dynamic array container wrapping std::vector.
Definition list.h:40
size_t size() const noexcept
Returns the number of elements in the list.
Definition list.h:301
Event delivered for mouse input.
Definition mouseevent.h:23
Base object for promeki.
Definition objectbase.h:129
ObjectBase * parent() const
Returns the parent object, if one. nullptr if none.
Definition objectbase.h:258
Manages a list of strings.
Definition stringlist.h:21
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
Scrollable list of items with keyboard and mouse navigation.
Definition listview.h:29
void ensureVisible(int index)
Adjusts the scroll offset so that the given index is visible.
int scrollOffset() const
Returns the current scroll offset.
Definition listview.h:47
void paintEvent(TuiPaintEvent *e) override
Called to paint the widget. Override in subclasses.
void scrollBy(int delta)
Scrolls the viewport by the given number of items.
Size2Di32 sizeHint() const override
Returns the preferred size. Override in subclasses.
void keyEvent(KeyEvent *e) override
Called on keyboard input. Override in subclasses.
void mouseEvent(MouseEvent *e) override
Called on mouse input. Override in subclasses.
Event delivered when a TUI widget needs to repaint.
Definition widget.h:28
Painting context for TUI widgets.
Definition painter.h:26
Style palette for TUI widgets.
Definition palette.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19