The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gamestate_inspector.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2016 by Yurii Chernyi <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #define GETTEXT_DOMAIN "wesnoth-lib"
16 
18 
20 #include "gui/dialogs/helper.hpp"
22 #include "gui/widgets/button.hpp"
23 #ifdef GUI2_EXPERIMENTAL_LISTBOX
24 #include "gui/widgets/list.hpp"
25 #else
26 #include "gui/widgets/listbox.hpp"
27 #endif
28 #include "gui/widgets/settings.hpp"
29 #include "gui/widgets/window.hpp"
30 
31 #include "desktop/clipboard.hpp"
32 #include "game_events/manager.hpp"
33 #include "serialization/parser.hpp" // for write()
34 
35 #include "game_data.hpp"
36 #include "recall_list_manager.hpp"
37 #include "resources.hpp"
38 #include "team.hpp"
39 #include "units/unit.hpp"
40 #include "units/map.hpp"
41 #include "ai/manager.hpp"
42 
43 #include "display_context.hpp"
44 #include "filter_context.hpp"
45 
46 #include <vector>
47 #include "utils/functional.hpp"
48 #include <boost/shared_ptr.hpp>
49 
50 namespace
51 {
52 
53 inline std::string config_to_string(const config& cfg)
54 {
55  std::ostringstream s;
56  write(s, cfg);
57  return s.str();
58 }
59 
60 inline std::string config_to_string(const config& cfg, std::string only_children)
61 {
62  config filtered;
63  for(const config& child : cfg.child_range(only_children)) {
64  filtered.add_child(only_children, child);
65  }
66  return config_to_string(filtered);
67 }
68 
69 }
70 
71 namespace gui2
72 {
73 
74 /*WIKI
75  * @page = GUIWindowDefinitionWML
76  * @order = 2_gamestate_inspector
77  *
78  * == Gamestate inspector ==
79  *
80  * This shows the gamestate inspector
81  *
82  * @begin{table}{dialog_widgets}
83  *
84  * inspector_name & & control & m &
85  * Name of the inspector. $
86  *
87  * stuff_list & & control & m &
88  * List of various stuff that can be viewed. $
89  *
90  * inspect & & control & m &
91  * The state of the variable or event. $
92  *
93  * copy & & button & m &
94  * A button to copy the state to clipboard. $
95  *
96  * @end{table}
97  */
98 
99 
100 /*
101 static void inspect_ai(twindow& window, int side)
102 {
103  const config &ai_cfg = ai::manager::to_config(side);
104  NEW_find_widget<tcontrol>(
105  &window,
106  "inspect",
107  false).set_label(config_to_string(ai_cfg.debug));
108 }
109 */
110 
111 /**
112  * Template for dialog callbacks for dialogs using model-view-controller
113  * architecture pattern.
114  *
115  * It allows delegating of the callback to a private view class, which should
116  * be accessible via dialog->get_view() (and return a pointer to the view
117  * class). Example usage: widget->set_callback(dialog_callback<my_dialog_class,
118  * my_dialog_class::inner_view_class
119  * &my_dialog_class::inner_view_class::member_function>);
120  */
121 template <class D, class V, void (V::*fptr)()>
123 {
124  D* dialog = dynamic_cast<D*>(caller.dialog());
125  assert(dialog);
126  (*(dialog->get_view()).*fptr)();
127 }
128 
129 
130 // The model is an interface defining the data to be displayed or otherwise
131 // acted upon in the user interface.
133 {
134 public:
135  model(const vconfig& c)
136  : cfg(c)
137  , name()
138  , stuff_list()
139  , stuff_types_list()
140  , inspect()
141  , inspector_name()
142  , copy_button()
143  , lua_button()
144  {
145  name = cfg["name"].str();
146  }
147 
150 
157 
158  static const unsigned int max_inspect_win_len = 20000;
159 
160 
162  {
163  stuff_list->clear();
164  }
165 
166 
168  {
169  stuff_types_list->clear();
170  }
171 
172  void add_row_to_stuff_list(const std::string& id, const std::string& label, bool colorize = false)
173  {
174  std::map<std::string, string_map> data;
175  string_map item;
176  item["id"] = id;
177  item["label"] = label;
178  item["use_markup"] = colorize ? "true" : "false";
179  data.insert(std::make_pair("name", item));
180  stuff_list->add_row(data);
181  }
182 
183 
184  void add_row_to_stuff_types_list(const std::string& id, const std::string& label, bool colorize = false)
185  {
186  std::map<std::string, string_map> data;
187  string_map item;
188  item["id"] = id;
189  item["label"] = label;
190  item["use_markup"] = colorize ? "true" : "false";
191  data.insert(std::make_pair("typename", item));
192  stuff_types_list->add_row(data);
193  }
194 
195 
196  void set_inspect_window_text(const std::string& s, unsigned int page = 0)
197  {
198  unsigned int reminder = (s.length() - (max_inspect_win_len * page));
199  std::string s_ = s.substr(max_inspect_win_len * page, reminder > max_inspect_win_len ? max_inspect_win_len : reminder);
200  inspect->set_label(s_);
201  }
202 
203 
204  unsigned int get_num_page(const std::string& s)
205  {
206  // We always want to reserve a page for empty contents.
207  if(s.empty()) {
208  return 1;
209  }
210 
211  return (s.length() / max_inspect_win_len) + (s.length() % max_inspect_win_len > 0 ? 1 : 0);
212  }
213 };
214 
216 {
217 public:
220  : model_(m), name_(name)
221  {
222  }
224  {
225  }
226 
228  {
229  return name_;
230  }
231 
232  virtual void show_stuff_list() = 0;
233  virtual void handle_stuff_list_selection() = 0;
234  virtual void update_view_from_model() = 0;
235 
236 protected:
239 };
240 
242 {
243 public:
246  : single_mode_controller(name, m)
247  {
248  }
249 
251  {
253 
254  const config& vars = resources::gamedata
256  : config();
257 
258  for(const auto & a : vars.attribute_range())
259  {
260  model_.add_row_to_stuff_list(a.first, a.first);
261  }
262 
263  std::map<std::string, size_t> wml_array_sizes;
264 
265  for(const auto & c : vars.all_children_range())
266  {
267  if (wml_array_sizes.find(c.key) == wml_array_sizes.end()) {
268  wml_array_sizes[c.key] = 0;
269  } else {
270  ++wml_array_sizes[c.key];
271  }
272 
273  unsigned int num_pages = model_.get_num_page(config_to_string(c.cfg));
274  for (unsigned int i = 0; i < num_pages; i++) {
275  std::ostringstream cur_str;
276  cur_str << "[" << c.key << "][" << wml_array_sizes[c.key] << "]";
277  if (num_pages > 1) {
278  cur_str << " " << (i + 1) << "/" << num_pages;
279  }
280  model_.add_row_to_stuff_list(cur_str.str(), cur_str.str());
281  }
282  }
283 
285  }
286 
288  {
290  if(selected == -1) {
292  return;
293  }
294 
295  int i = 0; ///@todo replace with precached data
296  const config& vars = resources::gamedata
298  : config();
299 
300  for(const auto & a : vars.attribute_range())
301  {
302  if(selected == i) {
304  return;
305  }
306  i++;
307  }
308 
309  for(const auto & c : vars.all_children_range())
310  {
311  for (unsigned int j = 0; j < model_.get_num_page(config_to_string(c.cfg)); ++j) {
312  if (selected == i) {
313  model_.set_inspect_window_text(config_to_string(c.cfg), j);
314  return;
315  }
316  i++;
317  }
318  }
319  }
320 
321  virtual void update_view_from_model()
322  {
323  show_stuff_list();
325  }
326 };
327 
328 /**
329  * Controller for WML event and menu item handler views.
330  */
332 {
333 public:
334  /** WML event handler tag identifier. */
336  {
337  EVENT_HANDLER, /**< Standard WML event handler ([event]). */
338  WMI_HANDLER /**< WML menu item handler ([menu_item]). */
339  };
340 
341  /**
342  * Constructor.
343  *
344  * @param name View name displayed on the UI.
345  * @param m Inspector model reference.
346  * @param wml_node WML node key. Should be either "event" or
347  * "menu_item".
348  */
351  HANDLER_TYPE handler_type)
352  : single_mode_controller(name, m)
353  , handler_type_(handler_type)
354  , pages_()
355  {
356  }
357 
358  /**
359  * Populates the list of pages for this view.
360  */
361  virtual void show_stuff_list()
362  {
363  assert(resources::game_events);
364 
365  const std::string handler_key
366  = handler_type_ == WMI_HANDLER ? "menu_item" : "event";
367 
369  pages_.clear();
370  config events_config;
371  resources::game_events->write_events(events_config);
372 
373  for(const auto & cfg : events_config.child_range(handler_key))
374  {
375  shared_string_ptr sstrp(new std::string(config_to_string(cfg)));
376  const std::string& wmltext = *sstrp;
377  const unsigned num_pages = model_.get_num_page(wmltext);
378 
379  for(unsigned i = 0; i < num_pages; ++i) {
380  pages_.push_back(std::make_pair(sstrp, i));
381 
382  std::ostringstream o;
383 
384  if(handler_type_ == WMI_HANDLER) {
385  // [menu_item]
386  o << cfg["id"].str();
387  } else {
388  // [event]
389  o << cfg["name"].str();
390  if(!cfg["id"].empty()) {
391  o << " [id=\"" << cfg["id"].str() << "\"]";
392  }
393  }
394 
395  if(num_pages > 1) {
396  o << " [page" << (i + 1) << '/' << num_pages << ']';
397  }
398 
399  model_.add_row_to_stuff_list(o.str(), o.str());
400  }
401  }
402 
404  }
405 
406  /**
407  * Updates the page display for the currently selected item in this view.
408  */
410  {
411  const int row = model_.stuff_list->get_selected_row();
412  if(row < 0 || size_t(row) >= pages_.size()) {
414  return;
415  }
416 
417  const page_descriptor& pd = pages_[size_t(row)];
418  model_.set_inspect_window_text(*pd.first, pd.second);
419  }
420 
421  /**
422  * Updates the whole view (page list and page display).
423  */
424  virtual void update_view_from_model()
425  {
426  show_stuff_list();
428  }
429 
430 private:
431  // Because of GUI2's limitations, we need to use set_inspect_window_text's
432  // option to split view pages into multiple subpages. Each of those
433  // subpages is built from a shared string object we cache beforehand for
434  // cycle efficiency. We use a vector of page content pointers/subpage
435  // number pairs matching the UI layout to keep things simple.
436 
438  typedef std::pair<shared_string_ptr, unsigned> page_descriptor;
439 
441  std::vector<page_descriptor> pages_;
442 };
443 
445 {
446 public:
449  : single_mode_controller(name, m)
450  {
451  }
452 
454  {
456 
459  for(unit_map::iterator i = resources::units->begin();
460  i != resources::units->end();
461  ++i) {
462  Uint32 which_color = game_config::tc_info(viewer.teams()[i->side() - 1].color())[0];
463 
464  std::stringstream s;
465  s << '(' << i->get_location();
466  s << ") <span color='#" << std::hex << which_color << std::dec;
467  s << "'>side=" << i->side() << "</span> ";
468  if(i->can_recruit()) {
469  s << "<span color='yellow'>LEADER</span> ";
470  }
471 
472  s << "\nid=\"" << i->id() << "\" (" << i->type_id() << ")\n"
473  << "L" << i->level() << "; " << i->experience() << '/'
474  << i->max_experience() << " xp; " << i->hitpoints() << '/'
475  << i->max_hitpoints() << " hp;";
476  for(const auto & str : i->get_traits_list())
477  {
478  s << " " << str;
479  }
480 
481  std::string key = s.str();
482  model_.add_row_to_stuff_list(i->id(), key, true);
483  }
484  }
485 
487  }
488 
490  {
492  if(selected == -1) {
494  return;
495  }
496 
497  if(resources::units) {
498  int i = 0; ///@todo replace with precached data
499  for(unit_map::iterator u = resources::units->begin();
500  u != resources::units->end();
501  ++u) {
502  if(selected == i) {
503  config c_unit;
504  u->write(c_unit);
505  std::ostringstream cfg_str;
506  write(cfg_str, c_unit);
507  model_.set_inspect_window_text(cfg_str.str());
508  return;
509  }
510  i++;
511  }
512  }
514  }
515 
516  virtual void update_view_from_model()
517  {
518  show_stuff_list();
520  }
521 };
522 
523 
525 {
526 public:
529  int side)
530  : single_mode_controller(name, m), side_(side)
531  {
532  }
533 
535  {
537  // note: needs sync with handle_stuff_list_selection()
538  model_.add_row_to_stuff_list("overview", "overview");
539  model_.add_row_to_stuff_list("ai overview", "ai overview");
540  model_.add_row_to_stuff_list("ai engines", "ai engines");
541  model_.add_row_to_stuff_list("ai stages", "ai stages");
542  model_.add_row_to_stuff_list("ai aspects", "ai aspects");
543  model_.add_row_to_stuff_list("ai goals", "ai goals");
544  model_.add_row_to_stuff_list("recall list overview",
545  "recall list overview");
546  model_.add_row_to_stuff_list("recall list full", "recall list full");
547  model_.add_row_to_stuff_list("ai component structure",
548  "ai component structure");
549  model_.add_row_to_stuff_list("unit list overview",
550  "unit list overview");
552  }
553 
555  {
557  if(selected == -1) {
559  return;
560  }
561 
562  if(selected == 0) {
564  ? resources::teams->at(side_ - 1).to_config()
565  : config();
566  c.clear_children("ai", "village");
567  model_.set_inspect_window_text(config_to_string(c));
568  return;
569  }
570 
571  if(selected == 1) {
574  return;
575  }
576 
577  if(selected == 2) {
579  config_to_string(ai::manager::to_config(side_), "engine"));
580  }
581 
582  if(selected == 3) {
584  config_to_string(ai::manager::to_config(side_), "stage"));
585  }
586 
587  if(selected == 4) {
589  config_to_string(ai::manager::to_config(side_), "aspect"));
590  }
591 
592  if(selected == 5) {
594  config_to_string(ai::manager::to_config(side_), "goal"));
595  }
596 
597  if(selected == 6) {
598  std::stringstream s;
599  if (resources::teams) {
600  for(const auto & u : resources::teams->at(side_ - 1).recall_list())
601  {
602  s << "id=\"" << u->id() << "\" (" << u->type_id() << ")\nL"
603  << u->level() << "; " << u->experience() << "/"
604  << u->max_experience() << " xp; " << u->hitpoints() << "/"
605  << u->max_hitpoints() << " hp\n";
606  for(const auto & str : u->get_traits_list())
607  {
608  s << "\t" << str << std::endl;
609  }
610  s << std::endl;
611  }
612  }
614  return;
615  }
616 
617  if(selected == 7) {
618  config c;
619  if (resources::teams) {
620  for(const auto & u : resources::teams->at(side_ - 1).recall_list())
621  {
622  config c_unit;
623  u->write(c_unit);
624  c.add_child("unit", c_unit);
625  }
626  }
627  model_.set_inspect_window_text(config_to_string(c));
628  return;
629  }
630 
631  if(selected == 8) {
634  return;
635  }
636 
637 
638  if(selected == 9) {
639  std::stringstream s;
640  if(resources::units) {
641  for(unit_map::iterator i = resources::units->begin();
642  i != resources::units->end();
643  ++i) {
644  if(i->side() != side_) {
645  continue;
646  }
647  s << '(' << i->get_location() << ") ";
648  if(i->can_recruit()) {
649  s << "LEADER ";
650  }
651 
652  s << "\nid=\"" << i->id() << "\" (" << i->type_id() << ")\n"
653  << "L" << i->level() << "; " << i->experience() << '/'
654  << i->max_experience() << " xp; " << i->hitpoints() << '/'
655  << i->max_hitpoints() << " hp\n";
656  for(const auto & str : i->get_traits_list())
657  {
658  s << "\t" << str << std::endl;
659  }
660  s << std::endl;
661  }
662  }
664  return;
665  }
666  }
667 
668  virtual void update_view_from_model()
669  {
670  show_stuff_list();
672  }
673 
674 private:
675  int side_;
676 };
677 
678 
679 // The controller acts upon the model. It retrieves data from repositories,
680 // persists it, manipulates it, and determines how it will be displayed in the
681 // view.
683 {
684 public:
685  typedef std::vector<boost::shared_ptr<single_mode_controller> >
688  {
690  new variable_mode_controller("variables", model_)));
696  "menu items", model_, event_mode_controller::WMI_HANDLER)));
698  new unit_mode_controller("units", model_)));
699  // BOOST_FOREACHteam
700  int sides = resources::teams
701  ? static_cast<int>((*resources::teams).size())
702  : 0;
703  for(int side = 1; side <= sides; ++side) {
704  std::string side_str = std::to_string(side);
707  std::string("team ") + side_str, model_, side)));
708  }
709  }
710 
712  {
714  if(selected == -1) {
715  // TODO: select row (maybe remember last selected row?...)
716  selected = 0;
717  }
718  return sm_controllers_.at(selected);
719  }
720 
722  {
724  for(auto sm_controller : sm_controllers_)
725  {
726  model_.add_row_to_stuff_types_list(sm_controller->name(),
727  sm_controller->name());
728  }
729  }
730 
731 
732  void show_title()
733  {
735  }
736 
737 
739  {
741 
742  show_title();
743  c->update_view_from_model();
744  }
745 
746 
748  {
751  c->handle_stuff_list_selection();
752  }
753 
754 
756  {
760  c->update_view_from_model(); // TODO: 'activate'
761  }
762 
764  {
766  }
767 
769  {
771  }
772 
773 private:
776 };
777 
778 
779 // The view is an interface that displays data (the model) and routes user
780 // commands to the controller to act upon that data.
782 {
783 public:
784  view(const vconfig& cfg) : model_(cfg), controller_(model_)
785  {
786  }
787 
788  void pre_show(twindow& /*window*/)
789  {
792  }
793 
794 
796  {
798  }
799 
801  {
803  }
804 
806  {
808  }
809 
811  {
813  }
814 
815  void bind(twindow& window)
816  {
818  = &find_widget<tlistbox>(&window, "stuff_list", false);
820  = &find_widget<tlistbox>(&window, "stuff_types_list", false);
821  model_.inspect = find_widget<tcontrol>(&window, "inspect", false, true);
823  = &find_widget<tcontrol>(&window, "inspector_name", false);
825  = &find_widget<tbutton>(&window, "copy", false);
827  = &find_widget<tbutton>(&window, "lua", false);
828 
829 #ifdef GUI2_EXPERIMENTAL_LISTBOX
832  std::bind(&tgamestate_inspector::view::
834  this));
835 
838  std::bind(&tgamestate_inspector::view::
839  handle_stuff_list_item_clicked,
840  this));
841 
842 #else
847  handle_stuff_list_item_clicked>);
848 
854 #endif
855 
859  this,
860  std::ref(window)));
861 
865  this,
866  std::ref(window)));
867 
869  model_.copy_button->set_active(false);
870  model_.copy_button->set_tooltip(_("Clipboard support not found, contact your packager"));
871  }
872  }
873 
874 private:
877 };
878 
879 
880 REGISTER_DIALOG(gamestate_inspector)
881 
883  : view_(new view(cfg))
884 {
885 }
886 
888 {
889  return view_;
890 }
891 
893 {
894  view_->bind(window);
895  view_->pre_show(window);
896 }
897 
898 } // end of namespace gui2
std::vector< page_descriptor > pages_
child_itors child_range(const std::string &key)
Definition: config.cpp:613
virtual void set_active(const bool active) override
See tcontrol::set_active.
Definition: button.cpp:58
unit_iterator end()
Definition: map.hpp:311
virtual const display_context & get_disp_context() const =0
void write_events(config &cfg)
Definition: manager.cpp:181
virtual void show_stuff_list()=0
static void display(CVideo &video, lua_kernel_base *lk)
Display a new console, using given video and lua kernel.
bool available()
Whether wesnoth was compiled with support for a clipboard.
Definition: clipboard.cpp:61
const std::vector< Uint32 > & tc_info(const std::string &name)
const GLfloat * c
Definition: glew.h:12741
CVideo & video()
Definition: window.hpp:411
void set_inspect_window_text(const std::string &s, unsigned int page=0)
Definition: video.hpp:58
void connect_signal_notify_modified(tdispatcher &dispatcher, const tsignal_notification_function &signal)
Connects a signal handler for getting a notification upon modification.
Definition: dispatcher.hpp:725
This file contains the window object, this object is a top level container which has the event manage...
Controller for WML event and menu item handler views.
REGISTER_DIALOG(label_settings)
void handle_lua_button_clicked(twindow &window)
virtual void set_label(const t_string &label)
Definition: control.cpp:330
void connect_signal_mouse_left_click(tdispatcher &dispatcher, const tsignal_function &signal)
Connects a signal handler for a left mouse button click.
Definition: dispatcher.hpp:710
void add_row_to_stuff_types_list(const std::string &id, const std::string &label, bool colorize=false)
unsigned int get_num_page(const std::string &s)
-file sdl_utils.hpp
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definition: glew.h:1347
void clear_children(const std::string &key)
Definition: config.cpp:820
boost::shared_ptr< view > get_view()
game_data * gamedata
Definition: resources.cpp:22
virtual void update_view_from_model()
Updates the whole view (page list and page display).
const config & get_variables() const
Definition: game_data.hpp:37
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:62
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
Simple push button.
Definition: button.hpp:32
void add_row_to_stuff_list(const std::string &id, const std::string &label, bool colorize=false)
static std::string at(const std::string &file, int line)
static UNUSEDNOWARN std::string _(const char *str)
Definition: gettext.hpp:82
HANDLER_TYPE
WML event handler tag identifier.
std::vector< team > * teams
Definition: resources.cpp:29
This file contains the settings handling of the widget library.
boost::shared_ptr< single_mode_controller > get_sm_controller()
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.
Definition: listbox.cpp:74
filter_context * filter_con
Definition: resources.cpp:23
static std::string get_active_ai_overview_for_side(side_number side)
Gets AI Overview for active AI of the given side.
Definition: manager.cpp:732
boost::shared_ptr< view > view_
all_children_itors all_children_range() const
In-order iteration over all children.
Definition: config.cpp:1127
std::string selected
Definition: game_config.cpp:84
static config to_config(side_number side)
Gets AI config for active AI of the given side.
Definition: manager.cpp:759
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:7319
variable_mode_controller(const std::string &name, tgamestate_inspector::model &m)
WML menu item handler ([menu_item]).
config & add_child(const std::string &key)
Definition: config.cpp:743
tgamestate_inspector::model & model_
Managing the AIs lifecycle - headers.
const t_string & label() const
Definition: control.hpp:248
static size_t id
Ids for the timers.
Definition: timer.cpp:39
void set_tooltip(const t_string &tooltip)
Definition: control.hpp:265
game_events::manager * game_events
Definition: resources.cpp:24
single_mode_controller(const std::string &name, tgamestate_inspector::model &m)
std::map< std::string, t_string > string_map
Definition: generator.hpp:23
team_mode_controller(const std::string &name, tgamestate_inspector::model &m, int side)
std::pair< shared_string_ptr, unsigned > page_descriptor
void dialog_view_callback(twidget &caller)
Template for dialog callbacks for dialogs using model-view-controller architecture pattern...
virtual const std::vector< team > & teams() const =0
const_attr_itors attribute_range() const
Definition: config.cpp:984
The listbox class.
Definition: listbox.hpp:39
size_t i
Definition: function.cpp:1057
static std::string get_active_ai_structure_for_side(side_number side)
Gets AI Structure for active AI of the given side.
Definition: manager.cpp:738
Base class for all visible items.
Definition: control.hpp:34
GLuint const GLchar * name
Definition: glew.h:1782
virtual void handle_stuff_list_selection()=0
tdialog * dialog()
Returns the top-level dialogue.
Definition: widget.cpp:144
GLenum GLenum GLvoid * row
Definition: glew.h:3805
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
Definition: clipboard.cpp:40
GLenum GLint ref
Definition: glew.h:1813
boost::shared_ptr< std::string > shared_string_ptr
virtual void handle_stuff_list_selection()
Updates the page display for the currently selected item in this view.
const GLdouble * m
Definition: glew.h:6968
Base class for all widgets.
Definition: widget.hpp:49
virtual void update_view_from_model()=0
A variable-expanding proxy for the config class.
Definition: variable.hpp:36
event_mode_controller(const std::string &name, tgamestate_inspector::model &m, HANDLER_TYPE handler_type)
Constructor.
void set_callback_value_change(const std::function< void(twidget &)> &callback)
Definition: listbox.hpp:225
#define c
Definition: glew.h:12743
virtual void show_stuff_list()
Populates the list of pages for this view.
static const unsigned int max_inspect_win_len
Standard WML event handler ([event]).
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLdouble s
Definition: glew.h:1358
int get_selected_row() const
Returns the first selected row.
Definition: listbox.cpp:237
void pre_show(twindow &window)
Inherited from tdialog.
void write(std::ostream &out, configr_of const &cfg, unsigned int level)
Definition: parser.cpp:621
std::vector< boost::shared_ptr< single_mode_controller > > sm_controller_ptr_vector
GLsizei const GLcharARB ** string
Definition: glew.h:4503
unit_mode_controller(const std::string &name, tgamestate_inspector::model &m)
unit_map * units
Definition: resources.cpp:35
void clear()
Removes all the rows in the listbox, clearing it.
Definition: listbox.cpp:131