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

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

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

revision 3748 by schoenebeck, Sun Feb 16 17:27:03 2020 UTC revision 3749 by schoenebeck, Sun Feb 16 18:39:53 2020 UTC
# Line 105  ScriptPatchVars::ScriptPatchVars() : Line 105  ScriptPatchVars::ScriptPatchVars() :
105      (      (
106          sigc::mem_fun(*this, &ScriptPatchVars::onTreeViewKeyRelease)          sigc::mem_fun(*this, &ScriptPatchVars::onTreeViewKeyRelease)
107      );      );
     // Gtk "row-activated" signal (Gtkmm's signal_row_activated) is only fired  
     // if this single click property is set to true  
108      //m_treeView.set_activate_on_single_click(true);      //m_treeView.set_activate_on_single_click(true);
109      m_treeView.signal_row_activated().connect(      m_treeView.signal_row_activated().connect(
110          [this](const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column){          [this](const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column) {
111              printf("row activated !!!!\n");              // open script source code editor for double clicked script title row
112              //m_editing = true; // so we can detect while user is editing some value              Gtk::TreeModel::iterator iter = m_treeStore->get_iter(path);
113                Gtk::TreeModel::Row row = *iter;
114                gig::Script* script = row[m_treeModel.m_col_script];
115                if (!script || row[m_treeModel.m_col_value] != "✎") return;
116                signal_edit_script.emit(script);
117          }          }
118      );      );
119      m_treeView.set_has_tooltip(true);      m_treeView.set_has_tooltip(true);
# Line 266  void ScriptPatchVars::buildTreeViewSlot( Line 268  void ScriptPatchVars::buildTreeViewSlot(
268      row[m_treeModel.m_col_name] = pScript->Name + " <sup>Slot " + ToString(iScriptSlot+1) + "</sup>";      row[m_treeModel.m_col_name] = pScript->Name + " <sup>Slot " + ToString(iScriptSlot+1) + "</sup>";
269      row[m_treeModel.m_col_name_weight] = PANGO_WEIGHT_BOLD;      row[m_treeModel.m_col_name_weight] = PANGO_WEIGHT_BOLD;
270      row[m_treeModel.m_col_type] = "Script";      row[m_treeModel.m_col_type] = "Script";
271      row[m_treeModel.m_col_value] = "";      row[m_treeModel.m_col_value] = "✎"; // make user visually aware that he might access script's source code here
272      row[m_treeModel.m_col_slot]  = -1;      row[m_treeModel.m_col_slot]  = -1;
273      row[m_treeModel.m_col_allowTextEntry] = false;      row[m_treeModel.m_col_allowTextEntry] = false;
274      row[m_treeModel.m_col_editable] = false;      row[m_treeModel.m_col_editable] = false;
275      row[m_treeModel.m_col_script] = NULL;      row[m_treeModel.m_col_script] = pScript;
276      row[m_treeModel.m_col_value_tooltip] = "";      row[m_treeModel.m_col_value_tooltip] = _("Double click or hit ⏎ to open script code editor.");
277    
278      std::map<std::string,PatchVar> vars = getPatchVars(m_instrument, iScriptSlot);      std::map<std::string,PatchVar> vars = getPatchVars(m_instrument, iScriptSlot);
279      for (const auto& var : vars) {      for (const auto& var : vars) {
# Line 325  bool ScriptPatchVars::onQueryTreeViewToo Line 327  bool ScriptPatchVars::onQueryTreeViewToo
327          m_treeView.get_path_at_pos(x, y, path, pointedColumn, cellX, cellY);          m_treeView.get_path_at_pos(x, y, path, pointedColumn, cellX, cellY);
328      }      }
329      Gtk::TreeViewColumn* valueColumn = m_treeView.get_column(2);      Gtk::TreeViewColumn* valueColumn = m_treeView.get_column(2);
330      if (pointedColumn == valueColumn) { // mouse hovers value column ...      if (pointedColumn == valueColumn || row[m_treeModel.m_col_value] == "✎") { // mouse hovers value column or on any "Script" meta row's columns...
331          const Glib::ustring tip = row[m_treeModel.m_col_value_tooltip];          const Glib::ustring tip = row[m_treeModel.m_col_value_tooltip];
332          if (tip.empty()) return false; // don't show tooltip          if (tip.empty()) return false; // don't show tooltip
333          // show model / cell's assigned tooltip          // show model / cell's assigned tooltip
334          tooltip->set_markup(tip);          tooltip->set_markup(tip);
335          m_treeView.set_tooltip_cell(tooltip, &path, valueColumn, NULL);          m_treeView.set_tooltip_cell(tooltip, &path, pointedColumn, NULL);
336          return true; // show tooltip          return true; // show tooltip
337      }      }
338      return false; // don't show tooltip      return false; // don't show tooltip

Legend:
Removed from v.3748  
changed lines
  Added in v.3749

  ViewVC Help
Powered by ViewVC