71 :
BasePrintout(_(
"Route Print").ToStdString()), m_route(route) {
76 m_table.StartFillHeader();
81 m_table << _(
"To Waypoint");
84 m_table << _(
"Position");
87 m_table << _(
"Course");
90 m_table << _(
"Distance");
93 m_table << _(
"Description");
97 m_table.StartFillWidths();
116 m_table.StartFillData();
118 for (
int n = 1; n <= m_route->GetnPoints(); n++) {
120 if (NULL == point)
continue;
129 m_table << point->GetName();
132 std::wostringstream point_position;
133 point_position << toSDMM(1, point->m_lat,
false) <<
"\n"
134 << toSDMM(2, point->m_lon,
false);
135 m_table << point_position.str();
139 m_table << formatAngle(point->GetCourse());
146 std::ostringstream point_distance;
147 point_distance << std::fixed << std::setprecision(2) << std::setw(6)
148 << toUsrDistance(point->GetDistance())
149 << getUsrDistanceUnit();
150 m_table << point_distance.str();
156 m_table << point->GetDescription();
164 wxFont routePrintFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
194 wxFont routePrintFont_bold(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
196 dc->SetFont(routePrintFont_bold);
197 wxBrush brush(wxColour(255, 255, 255), wxBRUSHSTYLE_TRANSPARENT);
200 int header_text_offset_x = 2;
201 int header_text_offset_y = 2;
205 int current_x = m_margin_x;
206 int current_y = m_margin_y;
207 vector<PrintCell>& header_content = m_table.GetHeader();
208 for (
size_t j = 0; j < header_content.size(); j++) {
210 dc->DrawRectangle(current_x, current_y, cell.GetWidth(), cell.GetHeight());
211 dc->DrawText(cell.GetText(), current_x + header_text_offset_x,
212 current_y + header_text_offset_y);
213 current_x += cell.GetWidth();
216 wxFont routePrintFont_normal(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
217 wxFONTWEIGHT_NORMAL);
218 dc->SetFont(routePrintFont_normal);
220 vector<vector<PrintCell> >& cells = m_table.GetContent();
221 current_y = m_margin_y + m_table.GetHeaderHeight();
222 int current_height = 0;
223 for (
size_t i = 0; i < cells.size(); i++) {
224 vector<PrintCell>& content_row = cells[i];
225 current_x = m_margin_x;
226 for (
size_t j = 0; j < content_row.size(); j++) {
228 if (cell.GetPage() == page) {
229 wxRect r(current_x, current_y, cell.GetWidth(), cell.GetHeight());
230 dc->DrawRectangle(r);
231 r.Offset(m_text_offset_x, m_text_offset_y);
232 dc->DrawLabel(cell.GetText(), r);
233 current_x += cell.GetWidth();
234 current_height = cell.GetHeight();
237 current_y += current_height;