void
MEShowNodesWindow::on_showNode()
{
   m_selectedRow = m_selection->get_selected();
   if( m_selectedRow )
   {
      Gtk::TreePath path = m_listStore->get_path( m_selectedRow );
      mc2dbg8 << "Row " << path.to_string() << " selected!!!" << endl;
      Glib::ustring tmpUstring = path.to_string();
      const char* tmpCharStr = tmpUstring.c_str();
      uint32 rowNbr = strtoul(tmpCharStr, NULL, 0);
      mc2dbg8 << "Row " << rowNbr << " selected!!!" << endl;

      uint32 fromNodeID = processRow( *m_selectedRow );

      OldItem* item = m_mapArea->getMap()->itemLookup(fromNodeID);
      int32 lat, lon;
      if ((fromNodeID & 0x80000000) != 0) {
         lat = item->getGfxData()->getLat(0,0);
         lon = item->getGfxData()->getLon(0,0);
      } else {
         lat = item->getGfxData()->getLastLat(0);
         lon = item->getGfxData()->getLastLon(0);
      }

      const int32 delta = 50000;
      m_mapArea->zoomToBBox(lat+delta, lon-delta, lat-delta, lon+delta);
   }
}
Beispiel #2
0
Gtk::TreePath RFO::createFile(RFO_Object *parent, const Slicer &stl,
			      std::string location)
{
  RFO_File r;
  r.stl = stl;
  r.location = location;
  parent->files.push_back(r);
  update_model();
  Gtk::TreePath path;
  path.push_back (0); // root
  path.push_back (parent->idx);
  path.push_back (parent->files.size() - 1);

  return path;
}
Beispiel #3
0
void sp_font_selector_set_font (SPFontSelector *fsel, font_instance *font, double size)
{
    if (font)
    {  
        Gtk::TreePath path;
        
        Glib::ustring family = font_factory::Default()->GetUIFamilyString(font->descr);

        try {
            path = Inkscape::FontLister::get_instance()->get_row_for_font (family);
        } catch (...) {
            return;
        }

        fsel->block_emit = TRUE;
        gtk_tree_selection_select_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (fsel->family_treeview)), path.gobj());
        gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (fsel->family_treeview), path.gobj(), NULL, TRUE, 0.5, 0.5);
        fsel->block_emit = FALSE;

        GList *list = 0;
        GtkTreeIter iter;
        GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(fsel->family_treeview));
        gtk_tree_model_get_iter (model, &iter, path.gobj());
        gtk_tree_model_get (model, &iter, 1, &list, -1);

        unsigned int bestStyleNumber = sp_font_selector_get_best_style(font, list);

        GtkTreePath *path_c = gtk_tree_path_new ();
        gtk_tree_path_append_index (path_c, bestStyleNumber);
        gtk_tree_selection_select_path (gtk_tree_view_get_selection (GTK_TREE_VIEW (fsel->style_treeview)), path_c);
        gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (fsel->style_treeview), path_c, NULL, TRUE, 0.5, 0.5);
    
        if (size != fsel->fontsize)
        {
            gchar s[8];
            g_snprintf (s, 8, "%.5g", size); // UI, so printf is ok
            gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(fsel->size))), s);
            fsel->fontsize = size;
            sp_font_selector_set_size_tooltip(fsel);
            sp_font_selector_set_sizes(fsel);
        }
    }
    
}
//------------------------------------------------------------------------------
void QueryOutputView::refresh()
{
  const int mode = _mode.get_active_row_number();
  switch (mode)
  {

    case 2: // History output
    {
      const Glib::RefPtr<Gtk::TreeModel> entry_model = _entries_grid.get_model();
      const Gtk::TreeModel::Children children = entry_model->children();
      const int size = children.size();
      if (size > 0)
      {
        const Gtk::TreeIter iter = (--children.end());
        const Gtk::TreePath path = entry_model->get_path(iter);
        _entries_grid.set_cursor(path);
      }

      _details_grid.scroll_to(1);
    }
    case 0: // Action Output - always need refresh even if it's not visible
    case 1: //Text output
    {
      _action_output.refresh(false);

      const int log_row_count = _action_output.row_count();
      if (log_row_count > 0)
      {
        Gtk::TreePath path;
        path.push_back(log_row_count-1);
        _action_output.scroll_to_row(path);
        _action_output.set_cursor(path);
      }
      break;
    }
  }
}
//------------------------------------------------------------------------------
void QueryOutputView::refresh() {
  const int mode = _mode.get_active_row_number();
  switch (mode) {
    case 2: // History output
    {
      _entries_grid.scroll_to(0); // newest entry is always first
      _details_grid.scroll_to(1);
    }
    case 0: // Action Output - always need refresh even if it's not visible
    case 1: // Text output
    {
      _action_output.refresh(false);

      const int log_row_count = _action_output.row_count();
      if (log_row_count > 0) {
        Gtk::TreePath path;
        path.push_back(log_row_count - 1);
        _action_output.scroll_to_row(path);
        _action_output.set_cursor(path);
      }
      break;
    }
  }
}
//------------------------------------------------------------------------------
void DbMySQLRoutineGroupEditor::activate_row(const Gtk::TreePath &path, Gtk::TreeViewColumn *column)
{
  _be->open_editor_for_routine_at_index(path.front());
}