Debian Codegraph @

demos/gtk-demo/demowindow.h

raw symbols SCIP
1 /* Copyright (C) 2001 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #ifndef _DEMOWINDOW_H
18 #define _DEMOWINDOW_H
19
20 #include <gtkmm/window.h>
21 #include <gtkmm/headerbar.h>
22 #include <gtkmm/button.h>
23 #include <gtkmm/notebook.h>
24 #include <gtkmm/scrolledwindow.h>
25 #include <gtkmm/box.h>
26
27 #include <gtkmm/treestore.h>
28 #include <gtkmm/treeview.h>
29 #include "textwidget.h"
30 #include <stdio.h>
31
32 class DemoWindow : public Gtk::Window
33 {
34 public:
35 DemoWindow();
36 ~DemoWindow() override;
37
38 protected:
39 void run_example(const Gtk::TreeModel::Row& row);
40 void configure_header_bar();
41
42 void fill_tree();
43
44 void load_file(const std::string& filename);
45 void add_data_tabs(const std::string& filename);
46 void remove_data_tabs();
47
48 //Signal handlers:
49 static bool select_function(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool currently_selected);
50 virtual void on_treeselection_changed();
51 virtual void on_treeview_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
52 virtual void on_example_window_hide();
53 virtual void on_run_button_clicked();
54
55 //Member widgets:
56 Gtk::HeaderBar m_HeaderBar;
57 Gtk::Button m_RunButton;
58 Gtk::Notebook m_Notebook;
59 Gtk::ScrolledWindow m_SideBar;
60 Gtk::Box m_HBox;
61
62 Glib::RefPtr<Gtk::TreeStore> m_refTreeStore;
63 Gtk::TreeView m_TreeView;
64 Glib::RefPtr<Gtk::TreeSelection> m_refTreeSelection;
65 Gtk::TreeModel::Path m_TreePath;
66
67 TextWidget m_TextWidget_Info, m_TextWidget_Source;
68
69 Gtk::Window* m_pWindow_Example;
70
71 std::string m_current_filename;
72 };
73
74 #endif //_DEMOWINDOW_H