67 :
BasePrintout(_(
"Track Print").ToStdString()), m_track(track) {
72 m_table.StartFillHeader();
75 m_table << (
const char*)wxString(_(
"Leg")).mb_str();
78 m_table << (
const char*)wxString(_(
"Position")).mb_str();
81 m_table << (
const char*)wxString(_(
"Course")).mb_str();
84 m_table << (
const char*)wxString(_(
"Distance")).mb_str();
87 m_table << (
const char*)wxString(_(
"Time")).mb_str();
90 m_table << (
const char*)wxString(_(
"Speed")).mb_str();
93 m_table.StartFillWidths();
103 m_table.StartFillData();
104 for (
int n = 0; n <= m_track->GetnPoints(); n++) {
105 m_table << lcPoints->OnGetItemText(n, 0);
108 m_table << lcPoints->OnGetItemText(n, 3) + _(
" ") +
109 lcPoints->OnGetItemText(n, 4);
112 m_table << lcPoints->OnGetItemText(n, 2);
114 m_table << lcPoints->OnGetItemText(n, 1);
116 m_table << lcPoints->OnGetItemText(n, 5);
118 m_table << lcPoints->OnGetItemText(n, 6);
125 wxFont trackPrintFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
155 wxFont trackPrintFont_bold(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
157 dc->SetFont(trackPrintFont_bold);
158 wxBrush brush(wxColour(255, 255, 255), wxBRUSHSTYLE_TRANSPARENT);
161 int header_text_offset_x = 2;
162 int header_text_offset_y = 2;
164 dc->DrawText(m_track->GetName(), 150, 20);
166 int current_x = m_margin_x;
167 int current_y = m_margin_y;
168 vector<PrintCell>& header_content = m_table.GetHeader();
169 for (
size_t j = 0; j < header_content.size(); j++) {
171 dc->DrawRectangle(current_x, current_y, cell.GetWidth(), cell.GetHeight());
172 dc->DrawText(cell.GetText(), current_x + header_text_offset_x,
173 current_y + header_text_offset_y);
174 current_x += cell.GetWidth();
177 wxFont trackPrintFont_normal(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
178 wxFONTWEIGHT_NORMAL);
179 dc->SetFont(trackPrintFont_normal);
181 vector<vector<PrintCell> >& cells = m_table.GetContent();
182 current_y = m_margin_y + m_table.GetHeaderHeight();
183 int current_height = 0;
184 for (
size_t i = 0; i < cells.size(); i++) {
185 vector<PrintCell>& content_row = cells[i];
186 current_x = m_margin_x;
187 for (
size_t j = 0; j < content_row.size(); j++) {
189 if (cell.GetPage() == page) {
190 wxRect r(current_x, current_y, cell.GetWidth(), cell.GetHeight());
191 dc->DrawRectangle(r);
192 r.Offset(m_text_offset_x, m_text_offset_y);
193 dc->DrawLabel(cell.GetText(), r);
194 current_x += cell.GetWidth();
195 current_height = cell.GetHeight();
198 current_y += current_height;