10 #ifndef __listbox_hpp__ 16 #if defined(__WATCOMC__) 32 unsigned int const i_len_x,
33 unsigned int const i_len_y);
40 unsigned char const* i_label);
55 size_t const i_slot)
const;
65 int const i_iter)
const;
74 unsigned int const i_len_x,
75 unsigned int const i_len_y);
86 unsigned char const* i_str);
90 bool const i_multiline);
94 group*
const i_parent);
98 int const i_response);
107 bool const i_selected=
true);
134 size_t const i_slot);
162 bool const i_multiline)
172 unsigned char const* i_str)
178 if (i_str && i_str[0])
181 l_len= 1+strlen(reinterpret_cast<char const*>(i_str));
182 m_label=
reinterpret_cast<unsigned char*
>(malloc(l_len));
194 group*
const i_parent)
205 int const i_response)
213 signal_selected_t i_signal)
233 #define __listbox_hpp__ unsigned char const * get_item(size_t const i_slot) const
retrieve an item from the listbox
Definition: listbox.cpp:554
void vertical_configure()
configure vertical scrollbar for display
Definition: listbox.cpp:680
void set_signal_selected(signal_selected_t i_signal)
set callback
Definition: listbox.hpp:212
virtual enum event_response event_mouse(struct event_mouse const &i_event)
handle mouse event
Definition: listbox.cpp:404
unsigned char * m_label
Definition: listbox.hpp:118
virtual void move(int const i_pos_x, int const i_pos_y)
move the widget to a new position
Definition: listbox.cpp:75
int get_selected_next(int const i_iter) const
get the next selected item in the listbox
Definition: listbox.cpp:598
virtual enum event_response event_key(struct event_key const &i_event)
handle key event
Definition: listbox.cpp:459
void set_response(int const i_response)
set the response the widget returns when an item is selected
Definition: listbox.hpp:204
struct array m_array
Definition: listbox.hpp:116
void(* signal_selected_t)(listbox const *i_listbox, void *io_user_data)
function prototype to recieve signal
Definition: listbox.hpp:25
signal_selected_t m_signal_selected
Definition: listbox.hpp:120
void set_multiline(bool const i_multiline)
set whether or not the user can select more than one item
Definition: listbox.hpp:161
virtual void resize(unsigned int const i_len_x, unsigned int const i_len_y)
resize the widget
Definition: listbox.cpp:87
int get_selected_first() const
get the first selected item in the listbox
Definition: listbox.cpp:573
A dynamic array that holds pointers to objects.
static void vertical_cb(widget const *i_widget, void *io_user_data)
callback for vertical scrollbar
Definition: listbox.cpp:28
virtual void set_parent(group *const i_parent)
set the parent group of this widget
Definition: listbox.hpp:193
virtual ~listbox()
destructor
Definition: listbox.cpp:64
container to hold a collection of widgets
Definition: group.hpp:15
void emit_selected()
emits the selected signal
Definition: listbox.hpp:222
int add(unsigned char const *i_label)
adds a value to the end of a list
Definition: listbox.cpp:100
container to hold objects
Definition: array.h:14
void scroll_internal()
called when value in the vertical scrollbar changed
Definition: listbox.cpp:544
enum event_response m_response
Definition: listbox.hpp:119
void set_label(unsigned char const *i_str)
set the text label of the listbox
Definition: listbox.hpp:171
event_response
response
Definition: event.h:14
void set_selected(size_t const i_slot, bool const i_selected=true)
set an item as selected or unselected
Definition: listbox.cpp:169
size_t m_line
Definition: listbox.hpp:115
void select(size_t const i_slot)
selects an item
Definition: listbox.cpp:190
size_t get_count() const
get number of items in listbox
Definition: listbox.hpp:155
scrollbar m_vertical
Definition: listbox.hpp:117
void unselect_all()
unselect all items in the listbox
Definition: listbox.cpp:152
bool m_multiline
Definition: listbox.hpp:114
size_t m_taken
Definition: array.h:17
void remove_all()
remove all items from the listbox
Definition: listbox.cpp:653
container for a mouse event
Definition: event.h:37
Allows the user to choose a value from a list.
Definition: listbox.hpp:20
virtual void draw() const
draws the widget
Definition: listbox.cpp:244
container for a keyboard event
Definition: event.h:23