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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2894 - (hide annotations) (download) (as text)
Sat Apr 30 14:42:14 2016 UTC (7 years, 11 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3023 byte(s)
* Enabled auto save & restore of window size & position of all
  remaining windows.
* Bumped version (1.0.0.svn7).

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

  ViewVC Help
Powered by ViewVC