RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
rmgui_dropdown_t Struct Reference

Retained dropdown state, caller-owned, written by rmgui_dropdown_init and rmgui_dropdown_input only; the host reads open (declare the popup while 1), selected and first_visible, and sets or clears RMGUI_STYLE_STATE_DISABLED in states. More...

#include <dropdown.h>

Data Fields

size_t count
size_t visible_rows
size_t selected
size_t highlighted
size_t first_visible
size_t hover
size_t pressed
uint8_t open
uint8_t capture
uint8_t states

Detailed Description

Retained dropdown state, caller-owned, written by rmgui_dropdown_init and rmgui_dropdown_input only; the host reads open (declare the popup while 1), selected and first_visible, and sets or clears RMGUI_STYLE_STATE_DISABLED in states.

Invariants after a successful init: 1 <= count <= INT_MAX (the input result index type ceiling); 1 <= visible_rows <= count; selected, highlighted < count; first_visible <= count - visible_rows; hover and pressed are an option index or RMGUI_DROPDOWN_NONE.

rmgui_dropdown_t.count

options

rmgui_dropdown_t.visible_rows

popup rows shown at once

rmgui_dropdown_t.selected

the committed option

rmgui_dropdown_t.highlighted

keyboard cursor over the popup

rmgui_dropdown_t.first_visible

option shown in the popup's first row

rmgui_dropdown_t.hover

popup option under the pointer

rmgui_dropdown_t.pressed

popup option the held press began on

rmgui_dropdown_t.open

1 while the popup is shown

rmgui_dropdown_t.capture

element-private pointer capture

rmgui_dropdown_t.states

closed row: HOVER/PRESSED/FOCUSED (input), DISABLED (host)

Field Documentation

◆ count

size_t rmgui_dropdown_t::count

◆ visible_rows

size_t rmgui_dropdown_t::visible_rows

◆ selected

size_t rmgui_dropdown_t::selected

◆ highlighted

size_t rmgui_dropdown_t::highlighted

◆ first_visible

size_t rmgui_dropdown_t::first_visible

◆ hover

size_t rmgui_dropdown_t::hover

◆ pressed

size_t rmgui_dropdown_t::pressed

◆ open

uint8_t rmgui_dropdown_t::open

◆ capture

uint8_t rmgui_dropdown_t::capture

◆ states

uint8_t rmgui_dropdown_t::states

The documentation for this struct was generated from the following file: