Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef GUI_WIDGETS_GROUP_HPP_INCLUDED
- #define GUI_WIDGETS_GROUP_HPP_INCLUDED
- #include "gui/widgets/widget.hpp"
- #include <vector>
- namespace gui2
- {
- template <class T = twidget>
- class tgroup
- {
- public:
- tgroup(const std::string& id = "");
- const std::string& id() const { return id_; }
- typedef typename std::vector<T*> group_list;
- typedef typename group_list::iterator group_iterator;
- typedef typename group_list::const_iterator group_iterator_const;
- void add_member(T* widget);
- void remove_member(T* widget);
- group_list get_members() { return members_; }
- /**
- * General function to operate on the members in a group.
- *
- * @param group_operator Operator function to be called on each
- * member of the group.
- */
- // void execute_group_actions(boost::function<void(tselectable_*)> group_operator);
- std::pair<group_iterator, group_iterator> widgets()
- {
- return std::make_pair(members_.begin(), members_.end());
- }
- std::pair<group_iterator_const, group_iterator_const> widgets() const
- {
- return std::make_pair(members_.begin(), members_.end());
- }
- private:
- std::string id_;
- group_list members_;
- };
- } // namespace gui2
- #endif
Advertisement
Add Comment
Please, Sign In to add comment