A listbox is a control that holds several items of the same type. More...
#include <listbox.hpp>
Public Member Functions | |
builder_listbox (const config &cfg) | |
virtual std::unique_ptr< widget > | build () const override |
virtual std::unique_ptr< widget > | build (const replacements_map &replacements) const override |
![]() | |
builder_styled_widget (const config &cfg) | |
virtual std::unique_ptr< widget > | build (const replacements_map &replacements) const override |
virtual std::unique_ptr< widget > | build () const=0 |
virtual std::unique_ptr< widget > | build (const replacements_map &replacements) const=0 |
![]() | |
builder_widget (const config &cfg) | |
virtual | ~builder_widget () |
Public Attributes | |
scrollbar_container::scrollbar_mode | vertical_scrollbar_mode |
scrollbar_container::scrollbar_mode | horizontal_scrollbar_mode |
builder_grid_ptr | header |
builder_grid_ptr | footer |
builder_grid_ptr | list_builder |
std::vector< widget_data > | list_data |
Listbox data. More... | |
bool | has_minimum_ |
bool | has_maximum_ |
![]() | |
std::string | definition |
Parameters for the styled_widget. More... | |
t_string | label_string |
t_string | tooltip |
t_string | help |
bool | use_tooltip_on_label_overflow |
bool | use_markup |
![]() | |
std::string | id |
Parameters for the widget. More... | |
std::string | linked_group |
widget::debug_border | debug_border_mode |
color_t | debug_border_color |
Additional Inherited Members | |
![]() | |
using | replacements_map = std::map< std::string, std::shared_ptr< builder_widget > > |
The replacements type is used to define replacement types. More... | |
using | optional_replacements = utils::optional_reference< const replacements_map > |
A listbox is a control that holds several items of the same type.
Normally the items in a listbox are ordered in rows, this version might allow more options for ordering the items in the future. The definition of a listbox contains the definition of its scrollbar:
Key | Type | Default | Description |
---|---|---|---|
scrollbar | section | mandatory | A grid containing the widgets for the scrollbar. The scrollbar has some special widgets so it can make default behavior for certain widgets. |
The resolution for a listbox also contains the following keys:
ID (return value) | Type | Mandatory | Description |
---|---|---|---|
_begin | clickable | no | Moves the position to the beginning of the list. |
_line_up | clickable | no | Move the position one item up. (NOTE: if too many items to move per item it might be more items.) |
_half_page_up | clickable | no | Move the position half the number of the visible items up. (See note at _line_up.) |
_page_up | clickable | no | Move the position the number of visible items up. (See note at _line_up.) |
_end | clickable | no | Moves the position to the end of the list. |
_line_down | clickable | no | Move the position one item down.(See note at _line_up.) |
_half_page_down | clickable | no | Move the position half the number of the visible items down. (See note at _line_up.) |
_page_down | clickable | no | Move the position the number of visible items down. (See note at _line_up.) |
_scrollbar | vertical_scrollbar | yes | This is the scrollbar so the user can scroll through the list. |
A clickable is one of:
Key | Type | Default | Description |
---|---|---|---|
vertical_scrollbar_mode | scrollbar_mode | initial_auto | Determines whether or not to show the scrollbar. |
horizontal_scrollbar_mode | scrollbar_mode | initial_auto | Determines whether or not to show the scrollbar. |
header | grid | [] | Defines the grid for the optional header. (This grid will automatically get the id _header_grid.) |
footer | grid | [] | Defines the grid for the optional footer. (This grid will automatically get the id _footer_grid.) |
list_definition | section | mandatory | This defines how a listbox item looks. It must contain the grid definition for 1 row of the list. |
list_data | section | [] | A grid alike section which stores the initial data for the listbox. Every row must have the same number of columns as the 'list_definition'. |
has_minimum | bool | true | If false, less than one row can be selected. |
has_maximum | bool | true | If false, more than one row can be selected. |
Definition at line 480 of file listbox.hpp.
|
explicit |
Definition at line 750 of file listbox.cpp.
References _(), f, footer, h, config::has_child(), header, list_builder, list_data, config::mandatory_child(), config::optional_child(), gui2::implementation::parse_list_data(), and VALIDATE.
|
overridevirtual |
Implements gui2::builder_widget.
Definition at line 783 of file listbox.cpp.
References gui2::generator_base::build(), DBG_GUI_G, gui2::implementation::builder_styled_widget::definition, footer, has_maximum_, has_minimum_, header, horizontal_scrollbar_mode, list_builder, list_data, gui2::generator_base::vertical_list, and vertical_scrollbar_mode.
|
override |
Definition at line 548 of file styled_widget.cpp.
builder_grid_ptr gui2::implementation::builder_listbox::footer |
Definition at line 492 of file listbox.hpp.
Referenced by build(), and builder_listbox().
bool gui2::implementation::builder_listbox::has_maximum_ |
Definition at line 504 of file listbox.hpp.
Referenced by build().
bool gui2::implementation::builder_listbox::has_minimum_ |
Definition at line 504 of file listbox.hpp.
Referenced by build().
builder_grid_ptr gui2::implementation::builder_listbox::header |
Definition at line 491 of file listbox.hpp.
Referenced by build(), and builder_listbox().
scrollbar_container::scrollbar_mode gui2::implementation::builder_listbox::horizontal_scrollbar_mode |
Definition at line 489 of file listbox.hpp.
Referenced by build().
builder_grid_ptr gui2::implementation::builder_listbox::list_builder |
Definition at line 494 of file listbox.hpp.
Referenced by build(), and builder_listbox().
std::vector<widget_data> gui2::implementation::builder_listbox::list_data |
Listbox data.
Contains a vector with the data to set in every cell, it's used to serialize the data in the config, so the config is no longer required.
Definition at line 502 of file listbox.hpp.
Referenced by build(), and builder_listbox().
scrollbar_container::scrollbar_mode gui2::implementation::builder_listbox::vertical_scrollbar_mode |
Definition at line 488 of file listbox.hpp.
Referenced by build().