b200adabf4a59e14997637337a009cf96e6cbc42
[ardour.git] / gtk2_ardour / keyeditor.h
1 #ifndef __ardour_gtk_key_editor_h__
2 #define __ardour_gtk_key_editor_h__
3
4 #include <string>
5
6 #include <gtkmm/treeview.h>
7 #include <gtkmm/treestore.h>
8 #include <gtkmm/scrolledwindow.h>
9 #include <glibmm/ustring.h>
10
11 #include "ardour_dialog.h"
12
13 class KeyEditor : public ArdourDialog
14 {
15   public:
16         KeyEditor ();
17         
18   protected:
19         void on_show ();
20         void on_unmap ();
21         bool on_key_release_event (GdkEventKey*);
22
23   private:
24         struct KeyEditorColumns : public Gtk::TreeModel::ColumnRecord {
25             KeyEditorColumns () {
26                     add (action);
27                     add (binding);
28                     add (path);
29             }
30             Gtk::TreeModelColumn<Glib::ustring> action;
31             Gtk::TreeModelColumn<std::string> binding;
32             Gtk::TreeModelColumn<std::string> path;
33         };
34
35         Gtk::ScrolledWindow scroller;
36         Gtk::TreeView view;
37         Glib::RefPtr<Gtk::TreeStore> model;
38         KeyEditorColumns columns;
39
40         void action_selected ();
41         void populate ();
42 };
43
44 #endif /* __ardour_gtk_key_editor_h__ */