/[svn]/gigedit/trunk/src/gigedit/ReferencesView.h
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/ReferencesView.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3340 - (show annotations) (download) (as text)
Mon Jul 31 11:20:18 2017 UTC (6 years, 7 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3161 byte(s)
* Added search filter field which allows to quickly filter the instrument
  list by case insensitive search tokens.
* Fix: navigating between dimension zones by keyboard did sometimes not
  work after switching from an instrument with different dimension types.
* Fix: Sample references view dialog had some odd behaviors, like it did not
  respond to mouse scroll events for instance.
* Bumped version (1.0.0.svn62).

1 /*
2 Copyright (c) 2014-2017 Christian Schoenebeck
3
4 This file is part of "gigedit" and released under the terms of the
5 GNU General Public License version 2.
6 */
7
8 #ifndef GIGEDIT_REFERENCESVIEW_H
9 #define GIGEDIT_REFERENCESVIEW_H
10
11 #ifdef LIBGIG_HEADER_FILE
12 # include LIBGIG_HEADER_FILE(gig.h)
13 #else
14 # include <gig.h>
15 #endif
16
17 #include <gtkmm.h>
18 #include "wrapLabel.hh"
19 #include "ManagedWindow.h"
20
21 /** @brief Sample reference browser dialog.
22 *
23 * Shows a modal dialog with a tree view showing all instruments and their
24 * respective regions which reference the selected sample at least once.
25 */
26 class ReferencesView : public ManagedDialog {
27 public:
28 ReferencesView(Gtk::Window& parent);
29 void setSample(gig::Sample* sample);
30
31 // When the user single clicked on a sample reference on this reference
32 // view dialog, then this signal is emitted and the dimension region editor
33 // shall select the respective, instrument, region and dimension region for
34 // further editing. The editor shall return true if selection was successful
35 // or should return false on errors.
36 sigc::signal<bool, gig::DimensionRegion*> dimension_region_selected;
37
38 // implementation for abstract methods of interface class "ManagedDialog"
39 virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->sampleRefsWindowX; }
40 virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->sampleRefsWindowY; }
41 virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->sampleRefsWindowW; }
42 virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->sampleRefsWindowH; }
43
44 protected:
45 gig::Sample* m_sample;
46
47 Gtk::HButtonBox m_buttonBox;
48 Gtk::ScrolledWindow m_scrolledWindow;
49 Gtk::TreeView m_treeView;
50 Gtk::Button m_closeButton;
51 #if GTKMM_MAJOR_VERSION < 3
52 view::WrapLabel m_descriptionLabel;
53 #else
54 Gtk::Label m_descriptionLabel;
55 #endif
56 #if GTKMM_MAJOR_VERSION < 3
57 view::WrapLabel m_summaryLabel;
58 #else
59 Gtk::Label m_summaryLabel;
60 #endif
61
62 class RefsTreeModel : public Gtk::TreeModel::ColumnRecord {
63 public:
64 RefsTreeModel() {
65 add(m_col_name);
66 add(m_col_instr);
67 add(m_col_region);
68 add(m_col_refcount);
69 }
70
71 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
72 Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
73 Gtk::TreeModelColumn<gig::Region*> m_col_region;
74 Gtk::TreeModelColumn<Glib::ustring> m_col_refcount;
75 } m_columns;
76
77 class RefsTreeStore : public Gtk::TreeStore {
78 public:
79 static Glib::RefPtr<RefsTreeStore> create(const RefsTreeModel& columns) {
80 return Glib::RefPtr<RefsTreeStore>( new RefsTreeStore(columns) );
81 }
82 protected:
83 RefsTreeStore(const RefsTreeModel& columns) : Gtk::TreeStore(columns) {}
84 };
85
86 Glib::RefPtr<RefsTreeStore> m_refTreeModel;
87
88 void onSelectionChanged(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
89 };
90
91 #endif // GIGEDIT_REFERENCESVIEW_H

  ViewVC Help
Powered by ViewVC