15 #define GETTEXT_DOMAIN "wesnoth-lib"
21 #ifdef GUI2_EXPERIMENTAL_LISTBOX
117 : displayed_status_()
119 , displayed_types_fields_()
125 displayed_types_.assign(
true);
129 register_displayed_type_field(
"show_unknown",
ADDON_UNKNOWN);
130 register_displayed_type_field(
"show_cores",
ADDON_CORE);
136 register_displayed_type_field(
"show_mp_maps",
ADDON_MP_MAPS);
137 register_displayed_type_field(
"show_mp_eras",
ADDON_MP_ERA);
139 register_displayed_type_field(
"show_mp_mods",
ADDON_MP_MOD);
140 register_displayed_type_field(
"show_media",
ADDON_MEDIA);
143 register_displayed_type_field(
"show_other",
ADDON_OTHER);
164 const bool have_any_unchecked
168 std::bind(&unchecked_bool_field_finder,
174 field->set_widget_value(window, !have_any_unchecked);
190 tlistbox& list = find_widget<tlistbox>(&window,
"statuses_list",
false);
191 window.keyboard_capture(&list);
194 std::map<std::string, string_map>
row;
198 row.insert(std::make_pair(
"status", column));
206 find_widget<tbutton>(&window,
"toggle_all_displayed_types",
false),
227 = &find_widget<ttoggle_button>(&window,
"sort_" + toggle_id,
false);
243 = &find_widget<ttoggle_button>(&window,
"sort_" + toggle_id,
false);
261 tlistbox& list = find_widget<tlistbox>(&window,
"statuses_list",
false);
273 return _(
"addons_view^Not Installed");
275 return _(
"addons_view^Upgradable");
277 return _(
"addons_view^Installed");
279 return _(
"addons_view^All Add-ons");
ADDON_SORT_DIRECTION dir_
tgroup< ADDON_SORT > sort_tgroup_
void register_sort_toggle(twindow &window, const std::string &toggle_id, ADDON_SORT value)
boost::array< bool, ADDON_TYPES_COUNT > displayed_types_
ADDON_TYPE
Values used for add-on classification; UI-only at the moment, in the future it could be used for dire...
an add-on that fits in no other category
ADDON_SORT
Add-on fallback/default sorting criteria for the user interface.
ADDON_STATUS_FILTER displayed_status_
tgroup< ADDON_SORT_DIRECTION > dir_tgroup_
void toggle_dir_callback()
bool select_row(const unsigned row, const bool select=true)
Selectes a row.
REGISTER_DIALOG(label_settings)
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
void clear()
Clears the entire group of members.
T get_widget_value(twindow &window)
Gets the value of the field.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
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.
GLdouble GLdouble GLdouble b
static std::string status_label(ADDON_STATUS_FILTER s)
ADDON_SORT_DIRECTION
Add-on fallback/default sorting direction.
static UNUSEDNOWARN std::string _(const char *str)
ADDON_STATUS_FILTER
Add-on installation status filters for the user interface.
void add_row(const string_map &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
GLsizei const GLfloat * value
static void field(LexState *ls, struct ConsControl *cc)
Modification of the game for MP.
void toggle_sort_callback()
std::map< std::string, t_string > string_map
void post_show(twindow &window)
Inherited from tdialog.
Miscellaneous content/media (unit packs, terrain packs, music packs, etc.).
GLenum GLenum GLvoid GLvoid * column
std::vector< tfield_bool * > displayed_types_fields_
T get_active_member_value()
Returns the value paired with the currently activiely toggled member of the group.
Multiplayer plain (no WML) map pack.
Sort by last upload time.
GLenum GLenum GLvoid * row
void register_dir_toggle(twindow &window, const std::string &toggle_id, ADDON_SORT_DIRECTION value)
void register_displayed_type_field(const std::string &field_id, ADDON_TYPE addon_type)
tfield_bool * register_bool(const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
Creates a new boolean field.
void add_member(tselectable_ *widget, const T &value)
Adds a widget/value pair to the group vector.
void pre_show(twindow &window)
Inherited from tdialog.
void toggle_all_displayed_types_button_callback(twindow &window)
Specialized field class for boolean.
int get_selected_row() const
Returns the first selected row.
void read_types_vector(const std::vector< bool > &v)
GLsizei const GLcharARB ** string