31 #ifndef __PRINTTABLE_H__
32 #define __PRINTTABLE_H__
35 #include <wx/datetime.h>
36 #include <wx/cmdline.h>
37 #include <wx/string.h>
39 #include <wx/msw/private.h>
42 #include "model/ocpn_types.h"
55 enum TableState { TABLE_SETUP_WIDTHS = 0, TABLE_FILL_DATA, TABLE_FILL_HEADER };
76 std::vector<std::vector<wxString> > data;
77 std::vector<double> widths;
78 std::vector<wxString> header;
89 Table& operator<<(
const int&);
90 Table& operator<<(
const double&);
91 Table& operator<<(
const wxString&);
93 std::vector<std::vector<wxString> >& GetData() {
return data; };
95 void StartFillData() { state = TABLE_FILL_DATA; };
97 void StartFillHeader() { state = TABLE_FILL_HEADER; };
99 void StartFillWidths() { state = TABLE_SETUP_WIDTHS; };
101 int GetRowHeight(
int i) {
return widths[i]; };
104 std::ostream& operator<<(std::ostream&,
Table&);
131 wxString modified_content;
151 void Init(
const wxString& _content, wxDC* _dc,
int _width,
int _cellpadding,
152 bool bold_font =
false);
155 wxRect GetRect() {
return rect; };
158 wxString GetText() {
return modified_content; };
161 int GetHeight() {
return height; };
164 int GetWidth() {
return width; };
167 void SetPage(
int _page) { page = _page; };
170 void SetHeight(
int _height) { height = _height; };
173 int GetPage() {
return page; };
187 std::vector<std::vector<PrintCell> > contents;
188 std::vector<PrintCell> header_content;
189 std::vector<int> rows_heights;
200 void AdjustCells(wxDC* _dc,
int marginX,
int marginY);
203 std::vector<std::vector<PrintCell> >& GetContent() {
return contents; };
205 std::vector<PrintCell>& GetHeader() {
return header_content; };
207 int GetNumberPages() {
return number_of_pages; };
210 int GetHeaderHeight() {
return header_height; };
This class takes multilined string and modifies it to fit into given width for given device.
Extension of a class Table with printing into dc.
Represents a NxM simple table with captions.