66 :
BasePrintout(_(
"Track Print").ToStdString()), m_track(track) {
71 m_table.StartFillHeader();
74 m_table << (
const char*)wxString(_(
"Leg")).mb_str();
77 m_table << (
const char*)wxString(_(
"Position")).mb_str();
80 m_table << (
const char*)wxString(_(
"Course")).mb_str();
83 m_table << (
const char*)wxString(_(
"Distance")).mb_str();
86 m_table << (
const char*)wxString(_(
"Time")).mb_str();
89 m_table << (
const char*)wxString(_(
"Speed")).mb_str();
92 m_table.StartFillWidths();
102 m_table.StartFillData();
103 for (
int n = 0; n <= m_track->GetnPoints(); n++) {
104 m_table << lcPoints->OnGetItemText(n, 0);
107 m_table << lcPoints->OnGetItemText(n, 3) + _(
" ") +
108 lcPoints->OnGetItemText(n, 4);
111 m_table << lcPoints->OnGetItemText(n, 2);
113 m_table << lcPoints->OnGetItemText(n, 1);
115 m_table << lcPoints->OnGetItemText(n, 5);
117 m_table << lcPoints->OnGetItemText(n, 6);
124 wxFont trackPrintFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
154 wxFont trackPrintFont_bold(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
156 dc->SetFont(trackPrintFont_bold);
157 wxBrush brush(wxColour(255, 255, 255), wxBRUSHSTYLE_TRANSPARENT);
160 int header_text_offset_x = 2;
161 int header_text_offset_y = 2;
163 dc->DrawText(m_track->GetName(), 150, 20);
165 int current_x = m_margin_x;
166 int current_y = m_margin_y;
167 vector<PrintCell>& header_content = m_table.GetHeader();
168 for (
size_t j = 0; j < header_content.size(); j++) {
170 dc->DrawRectangle(current_x, current_y, cell.GetWidth(), cell.GetHeight());
171 dc->DrawText(cell.GetText(), current_x + header_text_offset_x,
172 current_y + header_text_offset_y);
173 current_x += cell.GetWidth();
176 wxFont trackPrintFont_normal(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
177 wxFONTWEIGHT_NORMAL);
178 dc->SetFont(trackPrintFont_normal);
180 vector<vector<PrintCell> >& cells = m_table.GetContent();
181 current_y = m_margin_y + m_table.GetHeaderHeight();
182 int current_height = 0;
183 for (
size_t i = 0; i < cells.size(); i++) {
184 vector<PrintCell>& content_row = cells[i];
185 current_x = m_margin_x;
186 for (
size_t j = 0; j < content_row.size(); j++) {
188 if (cell.GetPage() == page) {
189 wxRect r(current_x, current_y, cell.GetWidth(), cell.GetHeight());
190 dc->DrawRectangle(r);
191 r.Offset(m_text_offset_x, m_text_offset_y);
192 dc->DrawLabel(cell.GetText(), r);
193 current_x += cell.GetWidth();
194 current_height = cell.GetHeight();
197 current_y += current_height;