|
- /* Solmyr - H3M manager
- * Copyright (C) 2009 Xavier Gendre
- *
- * This file is part of Solmyr.
- *
- * Solmyr is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Solmyr is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Solmyr. If not, see <http://www.gnu.org/licenses/>.
- */
-
- #ifndef H_XG_TREEVIEW_1108090353
- #define H_XG_TREEVIEW_1108090353
-
- #include "filter.hpp"
- #include "modelcolumn.hpp"
- #include "pixmanager.hpp"
-
- #include <gtkmm/cellrenderer.h>
- #include <gtkmm/liststore.h>
- #include <gtkmm/textbuffer.h>
- #include <gtkmm/treemodel.h>
- #include <gtkmm/treemodelfilter.h>
- #include <gtkmm/treeview.h>
-
- #include <glibmm/refptr.h>
-
- namespace Solmyr
- {
-
- class TreeView : public Gtk::TreeView
- {
- public:
- TreeView();
- virtual ~TreeView() {}
-
- int add_row_from_file(const char *, const char *,
- Glib::RefPtr<Gtk::TextBuffer>);
- void clear_all() {m_refListStore->clear();}
- guint32 get_visible_number();
- void refresh(Solmyr::Filter);
-
- // Signal accessors
- typedef sigc::signal<void, Glib::ustring, Glib::ustring>
- sigt_row_selected;
- sigt_row_selected signal_row_selected()
- {return m_signal_row_selected;}
-
- protected:
- // Visibility function
- virtual bool visible_func(const Gtk::TreeModel::const_iterator &);
-
- // Signals
- sigt_row_selected m_signal_row_selected;
-
- // Signal handlers
- virtual void on_row_selected();
-
- // Cell renderers
- void allies_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void difficulty_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void loss_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void name_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void players_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void size_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void underground_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void version_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
- void victory_cr(Gtk::CellRenderer *,
- const Gtk::TreeModel::iterator &);
-
- Solmyr::ModelColumn m_column;
- Solmyr::Filter m_filter;
- Solmyr::PixManager m_pixmanager;
- Glib::RefPtr<Gtk::ListStore> m_refListStore;
- Glib::RefPtr<Gtk::TreeModelFilter> m_refTreeModelFilter;
-
- };
-
- } // namespace Solmyr
-
- #endif // H_XG_TREEVIEW_1108090353
|