[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 3cf5a1c 056/156: Add wx_table_generator::outp
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 3cf5a1c 056/156: Add wx_table_generator::output_super_header() |
Date: |
Tue, 30 Jan 2018 17:22:09 -0500 (EST) |
branch: master
commit 3cf5a1cdb0f06d94ed6e2ac5fe36d38cb46ce22e
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Add wx_table_generator::output_super_header()
Add support for super headers spanning several columns in addition to
the normal per-column headers.
---
wx_table_generator.cpp | 29 +++++++++++++++++++++++++++++
wx_table_generator.hpp | 10 ++++++++++
2 files changed, 39 insertions(+)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 5952306..5720f5d 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -388,6 +388,35 @@ void wx_table_generator::output_header(int* pos_y,
enum_output_mode output_mode)
}
}
+void wx_table_generator::output_super_header
+ (std::string const& header
+ ,std::size_t begin_column
+ ,std::size_t end_column
+ ,int* pos_y
+ ,enum_output_mode output_mode
+ )
+{
+ switch(output_mode)
+ {
+ case e_output_normal:
+ break;
+ case e_output_measure_only:
+ *pos_y += row_height_;
+ return;
+ }
+
+ // We don't have a function for getting the rectangle of a span of columns,
+ // but we can reuse the existing text_rect() if we just increase its width
+ // by the width of all the extra (i.e. not counting the starting one)
+ // columns in this span.
+ auto rect = text_rect(begin_column, *pos_y);
+ rect.width += do_get_cell_x(end_column) - do_get_cell_x(begin_column + 1);
+
+ dc_.DrawLabel(header, rect, wxALIGN_CENTER_HORIZONTAL);
+
+ *pos_y += row_height_;
+}
+
void wx_table_generator::output_row
(int* pos_y
,std::string const* values
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index cf17868..a71717c 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -72,6 +72,16 @@ class wx_table_generator
,enum_output_mode output_mode = e_output_normal
);
+ // Render a super-header, i.e. a header spanning over several columns. The
+ // columns range is specified as a close/open interval, as usual in C++.
+ void output_super_header
+ (std::string const& header
+ ,std::size_t begin_column
+ ,std::size_t end_column
+ ,int* pos_y
+ ,enum_output_mode output_mode = e_output_normal
+ );
+
// Render a row with the given values at the given position and update it.
// The values here can be single-line only and there must be exactly the
// same number of them as the number of columns.
- [lmi-commits] [lmi] master 89c676d 009/156: Add pdf_writer_wx::get_page_height() helper, (continued)
- [lmi-commits] [lmi] master 89c676d 009/156: Add pdf_writer_wx::get_page_height() helper, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 8e26a76 004/156: Improve encapsulation by returning only wxDC from pdf_writer_wx, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master cb5cb7b 021/156: Add more contents to the narrative summary page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 173cc28 022/156: Change interpolated strings syntax to be Mustache-like, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2e4850c 023/156: Implement the rest of "Narrative Summary" page body text, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c341dbb 108/156: Factor out compliance_tracking template from the footer one, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 76881d8 019/156: Refactor: extra add_body_paragraph() helper, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 08127f1 028/156: Add symbolic constant for the "valign" HTML attribute, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 0d6c7f0 062/156: Get rid of separate wxDC parameter in the code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bbada54 084/156: Add image to the columns headings page too, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 3cf5a1c 056/156: Add wx_table_generator::output_super_header(),
Greg Chicares <=
- [lmi-commits] [lmi] master 95e616e 105/156: Add wx_table_generator::columns_count() accessor, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 3f1d437 088/156: Add add_abbreviated_variable() helper, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 118a249 097/156: Add "Column Definitions and Key Terms" page to NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1ab47c0 063/156: Fix definition of integer-valued variable in PDF illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master bb21f4d 077/156: Fix header for composite illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d2b2cae 038/156: Change column_headings page to use external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2bb1c91 041/156: Remove unnecessary outer html and body tags, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1afd45c 040/156: Avoid spurious coding style violation, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 9695e9e 112/156: Create InitAnnLoanDueRate vector in addition to the scalar, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5f6dc89 131/156: Use string objects for illustration_table_column fields, Greg Chicares, 2018/01/30