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

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

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

revision 3441 by schoenebeck, Sun Dec 9 20:48:18 2018 UTC revision 3460 by persson, Sat Feb 2 07:48:50 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2017 Andreas Persson   * Copyright (C) 2006-2019 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 2669  void MainWindow::on_action_help_about() Line 2669  void MainWindow::on_action_help_about()
2669      dialog.set_name("Gigedit");      dialog.set_name("Gigedit");
2670  #endif  #endif
2671      dialog.set_version(VERSION);      dialog.set_version(VERSION);
2672      dialog.set_copyright("Copyright (C) 2006-2017 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2019 Andreas Persson");
2673      const std::string sComment =      const std::string sComment =
2674          _("Built " __DATE__ "\nUsing ") +          _("Built " __DATE__ "\nUsing ") +
2675          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
# Line 2765  PropDialog::PropDialog() Line 2765  PropDialog::PropDialog()
2765  #endif  #endif
2766    
2767      add(vbox);      add(vbox);
2768  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
2769      table.set_margin(5);      table.set_margin(5);
2770  #else  #else
2771      table.set_border_width(5);      table.set_border_width(5);
# Line 2773  PropDialog::PropDialog() Line 2773  PropDialog::PropDialog()
2773      vbox.add(table);      vbox.add(table);
2774      vbox.pack_start(buttonBox, Gtk::PACK_SHRINK);      vbox.pack_start(buttonBox, Gtk::PACK_SHRINK);
2775      buttonBox.set_layout(Gtk::BUTTONBOX_END);      buttonBox.set_layout(Gtk::BUTTONBOX_END);
2776  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
2777      buttonBox.set_margin(5);      buttonBox.set_margin(5);
2778  #else  #else
2779      buttonBox.set_border_width(5);      buttonBox.set_border_width(5);
# Line 2925  InstrumentProps::InstrumentProps() : Line 2925  InstrumentProps::InstrumentProps() :
2925      table.add(eDimensionKeyRangeHigh);      table.add(eDimensionKeyRangeHigh);
2926    
2927      add(vbox);      add(vbox);
2928  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
2929      table.set_margin(5);      table.set_margin(5);
2930  #else  #else
2931      table.set_border_width(5);      table.set_border_width(5);
# Line 2934  InstrumentProps::InstrumentProps() : Line 2934  InstrumentProps::InstrumentProps() :
2934      table.show();      table.show();
2935      vbox.pack_start(buttonBox, Gtk::PACK_SHRINK);      vbox.pack_start(buttonBox, Gtk::PACK_SHRINK);
2936      buttonBox.set_layout(Gtk::BUTTONBOX_END);      buttonBox.set_layout(Gtk::BUTTONBOX_END);
2937  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
2938      buttonBox.set_margin(5);      buttonBox.set_margin(5);
2939  #else  #else
2940      buttonBox.set_border_width(5);      buttonBox.set_border_width(5);
# Line 2998  void MainWindow::updateSampleRefCountMap Line 2998  void MainWindow::updateSampleRefCountMap
2998    
2999  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {
3000      Gtk::TreeModel::iterator iter;      Gtk::TreeModel::iterator iter;
3001      m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter);      if (!m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter)) {
3002            return false;
3003        }
3004      Gtk::TreeModel::Path path(iter);      Gtk::TreeModel::Path path(iter);
3005      Gtk::TreeModel::Row row = *iter;      Gtk::TreeModel::Row row = *iter;
3006      Gtk::TreeViewColumn* pointedColumn = NULL;      Gtk::TreeViewColumn* pointedColumn = NULL;
# Line 3030  bool MainWindow::onQueryTreeViewTooltip( Line 3032  bool MainWindow::onQueryTreeViewTooltip(
3032  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {
3033      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));
3034      const int iScriptSlots = instrument->ScriptSlotCount();      const int iScriptSlots = instrument->ScriptSlotCount();
3035      Glib::ustring tooltip = "<u>(" + ToString(index) + ") „"  + name + "”</u>\n\n";      Glib::ustring tooltip = "<u>(" + ToString(index) + ") “"  + name + "”</u>\n\n";
3036      if (!iScriptSlots)      if (!iScriptSlots)
3037          tooltip += "<span foreground='red'><i>No script assigned</i></span>";          tooltip += "<span foreground='red'><i>No script assigned</i></span>";
3038      else {      else {
3039          for (int i = 0; i < iScriptSlots; ++i) {          for (int i = 0; i < iScriptSlots; ++i) {
3040              tooltip += "• " + ToString(i+1) + ". Script:  „<span foreground='#46DEFF'><b>" +              tooltip += "• " + ToString(i+1) + ". Script: “<span foreground='#46DEFF'><b>" +
3041                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";
3042              if (i + 1 < iScriptSlots) tooltip += "\n\n";              if (i + 1 < iScriptSlots) tooltip += "\n\n";
3043          }          }
# Line 3453  void MainWindow::select_instrument(gig:: Line 3455  void MainWindow::select_instrument(gig::
3455              show_intruments_tab();              show_intruments_tab();
3456              m_TreeView.get_selection()->unselect_all();              m_TreeView.get_selection()->unselect_all();
3457                            
3458  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
3459              auto iterSel = model->children()[i].get_iter();              auto iterSel = model->children()[i].get_iter();
3460              m_TreeView.get_selection()->select(iterSel);              m_TreeView.get_selection()->select(iterSel);
3461  #else  #else
# Line 3483  bool MainWindow::select_dimension_region Line 3485  bool MainWindow::select_dimension_region
3485              // select and show the respective instrument in the list view              // select and show the respective instrument in the list view
3486              show_intruments_tab();              show_intruments_tab();
3487              m_TreeView.get_selection()->unselect_all();              m_TreeView.get_selection()->unselect_all();
3488  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
3489              auto iterSel = model->children()[i].get_iter();              auto iterSel = model->children()[i].get_iter();
3490              m_TreeView.get_selection()->select(iterSel);              m_TreeView.get_selection()->select(iterSel);
3491  #else  #else
# Line 3519  void MainWindow::select_sample(gig::Samp Line 3521  void MainWindow::select_sample(gig::Samp
3521              if (rowSample[m_SamplesModel.m_col_sample] == sample) {              if (rowSample[m_SamplesModel.m_col_sample] == sample) {
3522                  show_samples_tab();                  show_samples_tab();
3523                  m_TreeViewSamples.get_selection()->unselect_all();                  m_TreeViewSamples.get_selection()->unselect_all();
3524  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
3525                  auto iterSel = rowGroup.children()[s].get_iter();                  auto iterSel = rowGroup.children()[s].get_iter();
3526                  m_TreeViewSamples.get_selection()->select(iterSel);                  m_TreeViewSamples.get_selection()->select(iterSel);
3527  #else  #else
# Line 4794  bool MainWindow::instrument_row_visible( Line 4796  bool MainWindow::instrument_row_visible(
4796      trim(pattern);      trim(pattern);
4797      if (pattern.empty()) return true;      if (pattern.empty()) return true;
4798    
4799  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22)  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 24)
4800      //HACK: on GTKMM4 development branch const_iterator cannot be easily converted to iterator, probably going to be fixed before final GTKMM4 release though.      //HACK: on GTKMM4 development branch const_iterator cannot be easily converted to iterator, probably going to be fixed before final GTKMM4 release though.
4801      Gtk::TreeModel::Row row = **(Gtk::TreeModel::iterator*)(&iter);      Gtk::TreeModel::Row row = **(Gtk::TreeModel::iterator*)(&iter);
4802  #else  #else

Legend:
Removed from v.3441  
changed lines
  Added in v.3460

  ViewVC Help
Powered by ViewVC