60 :
BasePrintout(_(
"Track Print").ToStdString()), m_track(track) {
65 m_table.StartFillHeader();
68 m_table << (
const char*)wxString(_(
"Leg")).mb_str();
71 m_table << (
const char*)wxString(_(
"Position")).mb_str();
74 m_table << (
const char*)wxString(_(
"Course")).mb_str();
77 m_table << (
const char*)wxString(_(
"Distance")).mb_str();
80 m_table << (
const char*)wxString(_(
"Time")).mb_str();
83 m_table << (
const char*)wxString(_(
"Speed")).mb_str();
86 m_table.StartFillWidths();
96 m_table.StartFillData();
97 for (
int n = 0; n <= m_track->GetnPoints(); n++) {
98 m_table << lcPoints->OnGetItemText(n, 0);
101 m_table << lcPoints->OnGetItemText(n, 3) + _(
" ") +
102 lcPoints->OnGetItemText(n, 4);
105 m_table << lcPoints->OnGetItemText(n, 2);
107 m_table << lcPoints->OnGetItemText(n, 1);
109 m_table << lcPoints->OnGetItemText(n, 5);
111 m_table << lcPoints->OnGetItemText(n, 6);
118 wxFont trackPrintFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
148 wxFont trackPrintFont_bold(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
150 dc->SetFont(trackPrintFont_bold);
151 wxBrush brush(wxColour(255, 255, 255), wxBRUSHSTYLE_TRANSPARENT);
154 int header_text_offset_x = 2;
155 int header_text_offset_y = 2;
157 dc->DrawText(m_track->GetName(), 150, 20);
159 int current_x = m_margin_x;
160 int current_y = m_margin_y;
161 vector<PrintCell>& header_content = m_table.GetHeader();
162 for (
size_t j = 0; j < header_content.size(); j++) {
164 dc->DrawRectangle(current_x, current_y, cell.GetWidth(), cell.GetHeight());
165 dc->DrawText(cell.GetText(), current_x + header_text_offset_x,
166 current_y + header_text_offset_y);
167 current_x += cell.GetWidth();
170 wxFont trackPrintFont_normal(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
171 wxFONTWEIGHT_NORMAL);
172 dc->SetFont(trackPrintFont_normal);
174 vector<vector<PrintCell> >& cells = m_table.GetContent();
175 current_y = m_margin_y + m_table.GetHeaderHeight();
176 int current_height = 0;
177 for (
size_t i = 0; i < cells.size(); i++) {
178 vector<PrintCell>& content_row = cells[i];
179 current_x = m_margin_x;
180 for (
size_t j = 0; j < content_row.size(); j++) {
182 if (cell.GetPage() == page) {
183 wxRect r(current_x, current_y, cell.GetWidth(), cell.GetHeight());
184 dc->DrawRectangle(r);
185 r.Offset(m_text_offset_x, m_text_offset_y);
186 dc->DrawLabel(cell.GetText(), r);
187 current_x += cell.GetWidth();
188 current_height = cell.GetHeight();
191 current_y += current_height;