1 |
/* |
/* |
2 |
Copyright (c) 2014,2015 Christian Schoenebeck |
Copyright (c) 2014 - 2017 Christian Schoenebeck |
3 |
|
|
4 |
This file is part of "gigedit" and released under the terms of the |
This file is part of "gigedit" and released under the terms of the |
5 |
GNU General Public License version 2. |
GNU General Public License version 2. |
14 |
|
|
15 |
ReferencesView::ReferencesView(Gtk::Window& parent) : |
ReferencesView::ReferencesView(Gtk::Window& parent) : |
16 |
ManagedDialog("", parent, true), m_sample(NULL), |
ManagedDialog("", parent, true), m_sample(NULL), |
17 |
m_closeButton(Gtk::Stock::CLOSE), m_descriptionLabel() |
#if HAS_GTKMM_STOCK |
18 |
|
m_closeButton(Gtk::Stock::CLOSE), |
19 |
|
#else |
20 |
|
m_closeButton(_("_Close"), true), |
21 |
|
#endif |
22 |
|
m_descriptionLabel() |
23 |
{ |
{ |
24 |
set_title("Nothing selected"); |
set_title("Nothing selected"); |
25 |
|
|
26 |
|
#if !HAS_GTKMM_STOCK |
27 |
|
m_closeButton.set_icon_name("window-close"); |
28 |
|
#endif |
29 |
|
|
30 |
m_scrolledWindow.add(m_treeView); |
m_scrolledWindow.add(m_treeView); |
31 |
m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); |
m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); |
32 |
|
|
33 |
|
#if USE_GTKMM_BOX |
34 |
|
get_content_area()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK); |
35 |
|
get_content_area()->pack_start(m_scrolledWindow); |
36 |
|
get_content_area()->pack_start(m_summaryLabel, Gtk::PACK_SHRINK); |
37 |
|
get_content_area()->pack_start(m_buttonBox, Gtk::PACK_SHRINK); |
38 |
|
#else |
39 |
get_vbox()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK); |
get_vbox()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK); |
40 |
get_vbox()->pack_start(m_scrolledWindow); |
get_vbox()->pack_start(m_scrolledWindow); |
41 |
get_vbox()->pack_start(m_summaryLabel, Gtk::PACK_SHRINK); |
get_vbox()->pack_start(m_summaryLabel, Gtk::PACK_SHRINK); |
42 |
get_vbox()->pack_start(m_buttonBox, Gtk::PACK_SHRINK); |
get_vbox()->pack_start(m_buttonBox, Gtk::PACK_SHRINK); |
43 |
|
#endif |
44 |
|
|
45 |
#if GTKMM_MAJOR_VERSION >= 3 |
#if GTKMM_MAJOR_VERSION >= 3 |
46 |
m_descriptionLabel.set_line_wrap(); |
m_descriptionLabel.set_line_wrap(); |
66 |
); |
); |
67 |
|
|
68 |
m_buttonBox.set_layout(Gtk::BUTTONBOX_END); |
m_buttonBox.set_layout(Gtk::BUTTONBOX_END); |
69 |
|
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
70 |
|
m_buttonBox.set_margin(5); |
71 |
|
#else |
72 |
m_buttonBox.set_border_width(5); |
m_buttonBox.set_border_width(5); |
73 |
|
#endif |
74 |
m_buttonBox.pack_start(m_closeButton, Gtk::PACK_SHRINK); |
m_buttonBox.pack_start(m_closeButton, Gtk::PACK_SHRINK); |
75 |
|
|
76 |
m_closeButton.signal_clicked().connect( |
m_closeButton.signal_clicked().connect( |
77 |
sigc::mem_fun(*this, &ReferencesView::hide) |
sigc::mem_fun(*this, &ReferencesView::hide) |
78 |
); |
); |
79 |
|
|
80 |
|
#if HAS_GTKMM_SHOW_ALL_CHILDREN |
81 |
show_all_children(); |
show_all_children(); |
82 |
|
#endif |
83 |
} |
} |
84 |
|
|
85 |
void ReferencesView::setSample(gig::Sample* sample) { |
void ReferencesView::setSample(gig::Sample* sample) { |