zone-tab.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
  2. /*
  3. * zone-tab.h
  4. * Copyright (C) 2017 Unknown <francois@gautrais.eu>
  5. *
  6. * histodexc is free software: you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * histodexc is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. * See the GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _ZONE_TAB_H_
  20. #define _ZONE_TAB_H_
  21. #include "tab.h"
  22. class GWindow;
  23. class ResourceTab;
  24. class MapViewer;
  25. class Area;
  26. class ZoneTab : public Tab
  27. {
  28. public:
  29. ZoneTab(GtkWidget *window, GtkBuilder *builder, ResourceTab* tab);
  30. virtual ~ZoneTab();
  31. virtual void on_save_clicked();
  32. void on_save();
  33. void on_save_angle();
  34. void on_delete();
  35. void on_select();
  36. void on_dev_res();
  37. void on_rm_zone();
  38. void on_add_zone();
  39. void on_select_res();
  40. void on_save_switch(bool state);
  41. virtual void write(const std::string& file);
  42. virtual Json::Value getJson(bool genFinal=false);
  43. virtual void setupTab(Data& a);
  44. virtual Data& getTab(bool& genFinal);
  45. virtual void open(Json::Value& val);
  46. void remove(std::string name);
  47. void insert(const std::string& name, Area* val=0);
  48. Area* findArea(const std::string& name);
  49. std::vector<Area>& getAreas() {return m_areas;}
  50. protected:
  51. GtkEntry* m_name;
  52. GtkEntry* m_resource;
  53. GtkSpinButton* m_angle;
  54. GtkSpinButton* m_field;
  55. GtkSpinButton* m_radius;
  56. GtkTreeView* m_list;
  57. GtkListStore* m_listStore;
  58. GtkTreeView* m_listRes;
  59. GtkListStore* m_listResStore;
  60. GtkSwitch* m_useAngle;
  61. GtkBox* m_root;
  62. GtkBox* m_rootMap;
  63. GtkButton* m_devRes;
  64. GtkButton* m_rmZone;
  65. GtkButton* m_add;
  66. GtkButton* m_delete;
  67. MapViewer* m_map;
  68. std::vector<Area> m_areas;
  69. bool m_isLoading;
  70. ResourceTab* m_resTab;
  71. private:
  72. };
  73. #endif // _ZONE_TAB_H_