DVX_GUI/listhelp/listHelp.h

45 lines
1.9 KiB
C

// listHelp.h -- Public API for the shared list/dropdown helper library
//
// Declares dropdown arrow drawing, item length scanning, keyboard
// navigation, and popup list painting shared across widget DXEs
// (ListBox, Dropdown, ComboBox, ListView, TreeView).
#ifndef LIST_HELP_H
#define LIST_HELP_H
#include "../core/dvxWidgetPlugin.h"
#define DROPDOWN_BTN_WIDTH 16
#define DROPDOWN_MAX_VISIBLE 8
// ============================================================
// Dropdown arrow glyph
// ============================================================
void widgetDrawDropdownArrow(DisplayT *d, const BlitOpsT *ops, int32_t centerX, int32_t centerY, uint32_t color);
// ============================================================
// Item measurement
// ============================================================
int32_t widgetMaxItemLen(const char **items, int32_t count);
// ============================================================
// Keyboard navigation (Up/Down/Home/End/PgUp/PgDn)
// ============================================================
int32_t widgetNavigateIndex(int32_t key, int32_t current, int32_t count, int32_t pageSize);
// ============================================================
// Popup rect calculation
// ============================================================
void widgetDropdownPopupRect(WidgetT *w, const BitmapFontT *font, int32_t contentH, int32_t itemCount, int32_t *popX, int32_t *popY, int32_t *popW, int32_t *popH);
// ============================================================
// Popup list painting
// ============================================================
void widgetPaintPopupList(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, int32_t popX, int32_t popY, int32_t popW, int32_t popH, const char **items, int32_t itemCount, int32_t hoverIdx, int32_t scrollPos);
#endif // LIST_HELP_H