#pragma once #include #include #include #include #include #include class EntryBox : public Gtk::Box { public: class Entry : public Gtk::Entry { public: Entry(const std::string &content = "", std::function on_activate_ = nullptr); std::function on_activate; /// Only the default activation on an entry will update its history. void update_history(); private: long selected_history; std::string last_content; bool set_text_from_history = false; }; class Button : public Gtk::Button { public: Button(const std::string &label, std::function on_activate_ = nullptr); std::function on_activate; }; class ToggleButton : public Gtk::ToggleButton { public: ToggleButton(const std::string &label, std::function on_activate_ = nullptr); std::function on_activate; }; class Label : public Gtk::Label { public: Label(std::function update_ = nullptr); std::function update; }; private: EntryBox(); public: static EntryBox &get() { static EntryBox instance; return instance; } Gtk::Box upper_box; Gtk::Box lower_box; void clear(); void hide() { clear(); } void show(); std::list entries; std::list