Debian Codegraph @

Source/Widgets/TriggerIdAndLocation.h

raw
1 /*
2 * TriggerIdAndLocation.h
3 *
4 * Created on: 4 Dec 2016
5 * Author: jeremy
6 */
7
8 #ifndef SOURCE_WIDGETS_TRIGGERIDANDLOCATION_H_
9 #define SOURCE_WIDGETS_TRIGGERIDANDLOCATION_H_
10
11 #include <gtkmm/grid.h>
12 #include <gtkmm/label.h>
13 #include <gtkmm/comboboxtext.h>
14
15 #include <memory>
16 #include <vector>
17 #include <string>
18
19 namespace Widgets
20 {
21
22 class TriggerIdAndLocation : public Gtk::Grid
23 {
24
25 public:
26
27 TriggerIdAndLocation(const std::vector<std::string>& locations, const std::vector<int>& ids);
28 virtual ~TriggerIdAndLocation() = default;
29
30 void SetTriggerLoc(const std::string& t) { location.set_active_text(t); };
31 void SetTriggerId(const int id) { triggerId.set_active_text(std::to_string(id)); }
32
33 std::string GetTriggerLoc() const { return location.get_entry_text(); }
34 int GetTriggerId() const { return std::stoi(triggerId.get_entry_text()); }
35
36
37 private:
38
39 Gtk::Label locationLabel;
40 Gtk::Label triggerIdLabel;
41 Gtk::ComboBoxText location;
42 Gtk::ComboBoxText triggerId;
43
44 };
45
46
47 typedef std::shared_ptr<TriggerIdAndLocation> TriggerIdAndLocationPtr;
48
49 } /* namespace Widgets */
50
51 #endif /* SOURCE_WIDGETS_TRIGGERIDANDLOCATION_H_ */