15 #ifndef GUI_WIDGETS_GENERATOR_HPP_INCLUDED
16 #define GUI_WIDGETS_GENERATOR_HPP_INCLUDED
21 #include <boost/intrusive_ptr.hpp>
74 const bool has_maximum,
84 virtual void clear() = 0;
168 tbuilder_grid_const_ptr list_builder,
170 const std::function<
void(
twidget&)>& callback)
192 tbuilder_grid_const_ptr list_builder,
193 const std::map<std::string /* widget id */, string_map>&
data,
194 const std::function<
void(
twidget&)>& callback) = 0;
212 tbuilder_grid_const_ptr list_builder,
213 const std::vector<string_map>& data,
214 const std::function<
void(
twidget&)>& callback)
234 tbuilder_grid_const_ptr list_builder,
235 const std::vector<std::map<std::string /*widget id*/, string_map> >&
237 const std::function<
void(
twidget&)>& callback) = 0;
275 int y_offset)
override = 0;
281 const std::vector<twidget*>& call_stack)
override
287 const bool must_be_active)
override = 0;
291 const bool must_be_active)
const override
Abstract base class for the generator.
virtual void select_item(const unsigned index, const bool select)=0
(De)selects an item.
GLuint GLdouble GLdouble GLint GLint order
boost::intrusive_ptr< const tbuilder_grid > tbuilder_grid_const_ptr
virtual void place(const tpoint &origin, const tpoint &size) override=0
See twidget::place.
virtual unsigned get_selected_item_count() const =0
Returns the number of selected items.
virtual unsigned get_item_at_ordered(unsigned index_ordered) const =0
virtual void clear()=0
Deletes all items.
virtual int get_selected_item() const =0
Returns the selected item.
virtual void handle_key_right_arrow(SDLMod modifier, bool &handled)=0
Right arrow key pressed.
virtual tgrid & item(const unsigned index)=0
Gets the grid of an item.
tplacement
Determines how the items are placed.
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
virtual void impl_draw_children(surface &frame_buffer, int x_offset, int y_offset) override=0
See twidget::impl_draw_children.
std::function< bool(unsigned, unsigned)> torder_func
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
virtual void handle_key_down_arrow(SDLMod modifier, bool &handled)=0
Down arrow key pressed.
virtual unsigned get_item_count() const =0
Returns the number of items.
virtual bool is_selected(const unsigned index) const =0
Returns whether the item is selected.
virtual void layout_initialise(const bool full_initialisation) override=0
See twidget::layout_initialise.
virtual bool get_item_shown(const unsigned index) const =0
Returns whether the item is shown.
virtual tgrid & create_item(const int index, tbuilder_grid_const_ptr list_builder, const string_map &item_data, const std::function< void(twidget &)> &callback)=0
Creates a new item.
virtual void handle_key_up_arrow(SDLMod modifier, bool &handled)=0
Up arrow key pressed.
virtual void set_item_shown(const unsigned index, const bool show)=0
Shows or hides an item.
virtual void set_origin(const tpoint &origin) override=0
See twidget::set_origin.
std::map< std::string, t_string > string_map
void show(CVideo &video, const std::string &window_id, const t_string &message, const tpoint &mouse)
Shows a tip.
virtual void set_order(const torder_func &order)=0
virtual void request_reduce_width(const unsigned maximum_width) override=0
See twidget::request_reduce_width.
virtual void request_reduce_height(const unsigned maximum_height) override=0
See twidget::request_reduce_height.
virtual unsigned get_ordered_index(unsigned index) const =0
virtual tpoint calculate_best_size() const override=0
See twidget::calculate_best_size.
static tgenerator_ * build(const bool has_minimum, const bool has_maximum, const tplacement placement, const bool select)
Create a new generator.
void toggle_item(const unsigned index)
Toggles the selection state of an item.
virtual void do_select_item(const unsigned index)=0
Selects a not selected item.
virtual void create_items(const int index, tbuilder_grid_const_ptr list_builder, const std::vector< string_map > &data, const std::function< void(twidget &)> &callback)=0
Creates one or more new item(s).
virtual void handle_key_left_arrow(SDLMod modifier, bool &handled)=0
Left arrow key pressed.
friend class tdebug_layout_graph
virtual void child_populate_dirty_list(twindow &caller, const std::vector< twidget * > &call_stack) override=0
See twidget::child_populate_dirty_list.
virtual void set_visible_rectangle(const SDL_Rect &rectangle) override=0
See twidget::set_visible_rectangle.
virtual void do_deselect_item(const unsigned index)=0
Deselects a selected item.
virtual tgrid & item_ordered(const unsigned index)=0
Gets the grid of an item.
virtual twidget * find_at(const tpoint &coordinate, const bool must_be_active) override=0
See twidget::find_at.
virtual void delete_item(const unsigned index)=0
Deletes an item.