65 :
BasePrintout(_(
"Track Print").ToStdString()), m_track(track) {
70 m_table.StartFillHeader();
73 m_table << (
const char*)wxString(_(
"Leg")).mb_str();
76 m_table << (
const char*)wxString(_(
"Position")).mb_str();
79 m_table << (
const char*)wxString(_(
"Course")).mb_str();
82 m_table << (
const char*)wxString(_(
"Distance")).mb_str();
85 m_table << (
const char*)wxString(_(
"Time")).mb_str();
88 m_table << (
const char*)wxString(_(
"Speed")).mb_str();
91 m_table.StartFillWidths();
101 m_table.StartFillData();
102 for (
int n = 0; n <= m_track->GetnPoints(); n++) {
103 m_table << lcPoints->OnGetItemText(n, 0);
106 m_table << lcPoints->OnGetItemText(n, 3) + _(
" ") +
107 lcPoints->OnGetItemText(n, 4);
110 m_table << lcPoints->OnGetItemText(n, 2);
112 m_table << lcPoints->OnGetItemText(n, 1);
114 m_table << lcPoints->OnGetItemText(n, 5);
116 m_table << lcPoints->OnGetItemText(n, 6);
123 wxFont trackPrintFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
153 wxFont trackPrintFont_bold(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
155 dc->SetFont(trackPrintFont_bold);
156 wxBrush brush(wxColour(255, 255, 255), wxBRUSHSTYLE_TRANSPARENT);
159 int header_text_offset_x = 2;
160 int header_text_offset_y = 2;
162 dc->DrawText(m_track->GetName(), 150, 20);
164 int current_x = m_margin_x;
165 int current_y = m_margin_y;
166 vector<PrintCell>& header_content = m_table.GetHeader();
167 for (
size_t j = 0; j < header_content.size(); j++) {
169 dc->DrawRectangle(current_x, current_y, cell.GetWidth(), cell.GetHeight());
170 dc->DrawText(cell.GetText(), current_x + header_text_offset_x,
171 current_y + header_text_offset_y);
172 current_x += cell.GetWidth();
175 wxFont trackPrintFont_normal(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
176 wxFONTWEIGHT_NORMAL);
177 dc->SetFont(trackPrintFont_normal);
179 vector<vector<PrintCell> >& cells = m_table.GetContent();
180 current_y = m_margin_y + m_table.GetHeaderHeight();
181 int current_height = 0;
182 for (
size_t i = 0; i < cells.size(); i++) {
183 vector<PrintCell>& content_row = cells[i];
184 current_x = m_margin_x;
185 for (
size_t j = 0; j < content_row.size(); j++) {
187 if (cell.GetPage() == page) {
188 wxRect r(current_x, current_y, cell.GetWidth(), cell.GetHeight());
189 dc->DrawRectangle(r);
190 r.Offset(m_text_offset_x, m_text_offset_y);
191 dc->DrawLabel(cell.GetText(), r);
192 current_x += cell.GetWidth();
193 current_height = cell.GetHeight();
196 current_y += current_height;