📄 waypointlist.cpp
字号:
/* GHelm - Nautical Navigation Software * Copyright (C) 2005 Jon Michaelchuck * * This application is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */#include "waypointlist.h"#include "util.h"/** * Constructor */WaypointList::WaypointList(){ list_store = Gtk::ListStore::create(waypoint_columns); tree_view.set_model(list_store); tree_view.append_column("Name", waypoint_columns.name); tree_view.append_column("Longitude", waypoint_columns.longitude); tree_view.append_column("Latitude", waypoint_columns.latitude); add(tree_view); set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);}/** * Destructor */WaypointList::~WaypointList(){}/** * Add a waypoint * @param waypoint waypoint to add */void WaypointList::AddWaypoint(waypoint_t waypoint){ Gtk::TreeModel::Row row = *(list_store->append()); row[waypoint_columns.name] = waypoint.name; row[waypoint_columns.longitude] = GetFormattedLongLatString(waypoint.longlat[0]); row[waypoint_columns.latitude] = GetFormattedLongLatString(waypoint.longlat[1]);}/** * clear the list */void WaypointList::Clear(){ list_store->clear(); }/** * on renderer switched signal handler * @chart Pointer to chart changed to */void WaypointList::on_switched(Chart *chart){ Clear(); if (chart) { std::vector<waypoint_t>::iterator it; std::vector<waypoint_t>::iterator end = chart->waypoints.end(); for (it = chart->waypoints.begin(); it != end; ++it) AddWaypoint(*it); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -