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

Diff of /gigedit/trunk/src/gigedit/ReferencesView.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3363 by schoenebeck, Mon Jul 31 11:20:18 2017 UTC revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC
# Line 1  Line 1 
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.
# Line 14  Glib::ustring note_str(int note); Line 14  Glib::ustring note_str(int note);
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();
# Line 50  ReferencesView::ReferencesView(Gtk::Wind Line 66  ReferencesView::ReferencesView(Gtk::Wind
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) {

Legend:
Removed from v.3363  
changed lines
  Added in v.3364

  ViewVC Help
Powered by ViewVC