Horizon
multi_item_button.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "util/uuid.hpp"
4 #include <set>
5 #include "util/changeable.hpp"
6 
7 namespace horizon {
8 
9 class MultiItemButton : public Gtk::MenuButton, public Changeable {
10 public:
12  void set_items(const std::set<UUID> &uus);
13  std::set<UUID> get_items() const;
14  void update();
15 
16 protected:
17  virtual class MultiItemSelector &get_selector() = 0;
18  virtual const MultiItemSelector &get_selector() const = 0;
19  virtual std::string get_item_name(const UUID &uu) const = 0;
20  virtual std::string get_label_text() const;
21  void update_label();
22 
23  void construct();
24 
25 private:
26  Gtk::Popover *popover;
27  void on_toggled() override;
28  Gtk::Label *label = nullptr;
29 };
30 } // namespace horizon
Definition: changeable.hpp:5
Definition: multi_item_button.hpp:9
Definition: multi_item_selector.hpp:8
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16