The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui::filter_textbox Class Reference

#include <construct_dialog.hpp>

Inheritance diagram for gui::filter_textbox:
Inheritance graph

Public Member Functions

 filter_textbox (CVideo &video, const std::string &header, const std::vector< std::string > &items, const std::vector< std::string > &items_to_filter, size_t header_row, dialog &dialog, int width=250)
 
int get_index (int selection) const
 
void delete_item (int selection)
 
- Public Member Functions inherited from gui::dialog_textbox
 dialog_textbox (label *const label_widget, CVideo &video, int width, const std::string &text="", bool editable=true, size_t max_size=256, int font_size=font::SIZE_PLUS, double alpha=0.4, double alpha_focus=0.2)
 
virtual ~dialog_textbox ()
 
labelget_label () const
 
sdl_handler_vector handler_members ()
 
- Public Member Functions inherited from gui::textbox
 textbox (CVideo &video, int width, const std::string &text="", bool editable=true, size_t max_size=256, int font_size=font::SIZE_PLUS, double alpha=0.4, double alpha_focus=0.2, const bool auto_join=true)
 
virtual ~textbox ()
 
const std::string text () const
 
void set_text (const std::string &text, const SDL_Color &color=font::NORMAL_COLOR)
 
void append_text (const std::string &text, bool auto_scroll=false, const SDL_Color &color=font::NORMAL_COLOR)
 
void clear ()
 
void set_selection (const int selstart, const int selend)
 
void set_cursor_pos (const int cursor_pos)
 
void set_editable (bool value)
 
bool editable () const
 
int font_size () const
 
void set_font_size (int fs)
 
void scroll_to_bottom ()
 
void set_wrap (bool val)
 
void set_edit_target (textbox *target)
 
- Public Member Functions inherited from gui::scrollarea
 scrollarea (CVideo &video, bool auto_join=true)
 Create a zone with automatic handling of scrollbar. More...
 
virtual void hide (bool value=true)
 
- Public Member Functions inherited from gui::widget
SDL_Rect const & location () const
 
virtual void set_location (SDL_Rect const &rect)
 
void set_location (int x, int y)
 
void set_width (int w)
 
void set_height (int h)
 
void set_measurements (int w, int h)
 
int width () const
 
int height () const
 
bool focus (const SDL_Event *event)
 
void set_focus (bool focus)
 
bool hidden () const
 
virtual void enable (bool new_val=true)
 
bool enabled () const
 
void set_clip_rect (const SDL_Rect &rect)
 
void set_volatile (bool val=true)
 
void set_dirty (bool dirty=true)
 
bool dirty () const
 
const std::stringid () const
 
void set_id (const std::string &id)
 
void set_help_string (const std::string &str)
 
void set_tooltip_string (const std::string &str)
 
virtual void process_help_string (int mousex, int mousey)
 
virtual void process_tooltip_string (int mousex, int mousey)
 
- Public Member Functions inherited from events::sdl_handler
virtual void join ()
 
virtual void join (context &c)
 
virtual void join_same (sdl_handler *parent)
 
virtual void leave ()
 
virtual void join_global ()
 
virtual void leave_global ()
 

Private Member Functions

virtual void handle_text_changed (const ucs4::string &text)
 

Private Attributes

std::vector< std::stringitems_
 
std::vector< std::stringitems_to_filter_
 
std::vector< std::stringfiltered_items_
 
std::vector< intindex_map_
 
std::vector< std::stringlast_words
 
size_t header_row_
 
gui::dialogdialog_
 

Additional Inherited Members

- Protected Member Functions inherited from gui::textbox
virtual void draw_contents ()
 
virtual void update_location (SDL_Rect const &rect)
 
virtual void set_inner_location (SDL_Rect const &)
 
virtual void scroll (unsigned int pos)
 
- Protected Member Functions inherited from gui::scrollarea
virtual void process_event ()
 
SDL_Rect inner_location () const
 
unsigned scrollbar_width () const
 
unsigned get_position () const
 
unsigned get_max_position () const
 
void set_position (unsigned pos)
 
void adjust_position (unsigned pos)
 
void move_position (int dep)
 
void set_shown_size (unsigned h)
 
void set_full_size (unsigned h)
 
void set_scroll_rate (unsigned r)
 
bool has_scrollbar () const
 
- Protected Member Functions inherited from gui::widget
 widget (widget const &o)
 
 widget (CVideo &video, const bool auto_join=true)
 
virtual ~widget ()
 
void bg_register (SDL_Rect const &rect)
 
void bg_restore () const
 
void bg_restore (SDL_Rect const &rect) const
 
void bg_update ()
 
void bg_cancel ()
 
CVideovideo () const
 
virtual void draw ()
 
const SDL_Rect * clip_rect () const
 
virtual sdl_handler_vector member_handlers ()
 
virtual void handle_window_event (SDL_Event const &event)
 
bool mouse_locked () const
 
void aquire_mouse_lock ()
 
void free_mouse_lock ()
 
- Protected Member Functions inherited from events::sdl_handler
 sdl_handler (const bool auto_join=true)
 
virtual ~sdl_handler ()
 
- Protected Attributes inherited from gui::widget
bool focus_
 

Detailed Description

Definition at line 119 of file construct_dialog.hpp.

Constructor & Destructor Documentation

gui::filter_textbox::filter_textbox ( CVideo video,
const std::string header,
const std::vector< std::string > &  items,
const std::vector< std::string > &  items_to_filter,
size_t  header_row,
dialog dialog,
int  width = 250 
)
inline

Definition at line 121 of file construct_dialog.hpp.

References gui::textbox::set_text().

Member Function Documentation

void gui::filter_textbox::delete_item ( int  selection)

Definition at line 934 of file construct_dialog.cpp.

References filtered_items_, header_row_, i, index_map_, items_, and items_to_filter_.

int gui::filter_textbox::get_index ( int  selection) const
void gui::filter_textbox::handle_text_changed ( const ucs4::string text)
privatevirtual

Member Data Documentation

gui::dialog& gui::filter_textbox::dialog_
private

Definition at line 147 of file construct_dialog.hpp.

Referenced by handle_text_changed().

std::vector<std::string> gui::filter_textbox::filtered_items_
private

Definition at line 143 of file construct_dialog.hpp.

Referenced by delete_item(), and handle_text_changed().

size_t gui::filter_textbox::header_row_
private

Definition at line 146 of file construct_dialog.hpp.

Referenced by delete_item(), get_index(), and handle_text_changed().

std::vector<int> gui::filter_textbox::index_map_
private

Definition at line 144 of file construct_dialog.hpp.

Referenced by delete_item(), get_index(), and handle_text_changed().

std::vector<std::string> gui::filter_textbox::items_
private

Definition at line 143 of file construct_dialog.hpp.

Referenced by delete_item(), and handle_text_changed().

std::vector<std::string> gui::filter_textbox::items_to_filter_
private

Definition at line 143 of file construct_dialog.hpp.

Referenced by delete_item(), and handle_text_changed().

std::vector<std::string> gui::filter_textbox::last_words
private

Definition at line 145 of file construct_dialog.hpp.

Referenced by handle_text_changed().


The documentation for this class was generated from the following files: