[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master efc01fa 046/156: Allow disabling separator li
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master efc01fa 046/156: Allow disabling separator lines in wx_table_generator |
Date: |
Tue, 30 Jan 2018 17:22:07 -0500 (EST) |
branch: master
commit efc01fad393154afa7ae63612b9c02f8debde1ca
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Allow disabling separator lines in wx_table_generator
All tables don't have the same appearances.
---
wx_table_generator.cpp | 24 ++++++++++++++++++------
wx_table_generator.hpp | 8 ++++++++
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 28f8c28..7c8a96f 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -216,7 +216,10 @@ void wx_table_generator::do_output_values
int const y_text = y + char_height_;
y += row_height_;
- do_output_vert_separator(x, y_top, y);
+ if(draw_separators_)
+ {
+ do_output_vert_separator(x, y_top, y);
+ }
std::size_t const num_columns = columns_.size();
for(std::size_t col = 0; col < num_columns; ++col)
@@ -247,7 +250,10 @@ void wx_table_generator::do_output_values
dc_.DrawText(s, x_text, y_text);
}
x += width;
- do_output_vert_separator(x, y_top, y);
+ if(draw_separators_)
+ {
+ do_output_vert_separator(x, y_top, y);
+ }
}
}
@@ -328,9 +334,12 @@ void wx_table_generator::output_header(int* pos_y)
}
// Finally draw the separators above and (a double one) below them.
- do_output_horz_separator(left_margin_, x, y_top );
- do_output_horz_separator(left_margin_, x, *pos_y - 1);
- do_output_horz_separator(left_margin_, x, *pos_y );
+ if(draw_separators_)
+ {
+ do_output_horz_separator(left_margin_, x, y_top );
+ do_output_horz_separator(left_margin_, x, *pos_y - 1);
+ do_output_horz_separator(left_margin_, x, *pos_y );
+ }
}
void wx_table_generator::output_row
@@ -341,7 +350,10 @@ void wx_table_generator::output_row
int x = left_margin_;
do_output_values(x, *pos_y, values);
- do_output_horz_separator(left_margin_, x, *pos_y);
+ if(draw_separators_)
+ {
+ do_output_horz_separator(left_margin_, x, *pos_y);
+ }
}
void wx_table_generator::output_highlighted_cell
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index 7de6eeb..88b2633 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -105,6 +105,9 @@ class wx_table_generator
// output a separator after the last column.
void output_vert_separator(std::size_t before_column, int y);
+ // Disable separator lines drawn by default.
+ void disable_separators() {draw_separators_ = false;}
+
private:
// Return the font used for the headers.
wxFont get_header_font() const;
@@ -161,6 +164,11 @@ class wx_table_generator
// Maximal number of lines in any column header, initially 1 but can be
// higher if multiline headers are used.
std::size_t max_header_lines_;
+
+ // If false, separator lines are not drawn automatically (they can still be
+ // drawn by calling output_horz_separator() or output_vert_separator()
+ // explicitly).
+ bool draw_separators_ = true;
};
#endif // wx_table_generator_hpp
- [lmi-commits] [lmi] master 875ca7d 039/156: Rename StateIsTX ledger variable to StateIsTexas, (continued)
- [lmi-commits] [lmi] master 875ca7d 039/156: Rename StateIsTX ledger variable to StateIsTexas, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 31048c8 047/156: Make wx_table_generator even more customizable, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 10dd0a9 051/156: Factor enum_output_mode into a separate header to allow its reuse, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 8fa972e 052/156: Add "Tabular Detail, continued" page to the PDF illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ca6e17c 031/156: Add function generating a standard header and use it, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master c378bc5 064/156: Remove unnecessary value_cast inclusion, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 41de2e2 140/156: Add helper expand_template() method, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 3e8e257 017/156: Add pdf_illustration_regular and narrative_summary_page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 614fb47 135/156: Add supplemental reports pages to private placement illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 49cc809 072/156: Remove HTML construction helpers not needed any more, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master efc01fa 046/156: Allow disabling separator lines in wx_table_generator,
Greg Chicares <=
- [lmi-commits] [lmi] master e20544f 018/156: Add check for the ledger type, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master a0a167e 144/156: Rename "compliance_tracking_number" template to "imprimatur", Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 982c9f0 149/156: Remove consecutive blank lines from a Mustache template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ec73905 058/156: Add extra pair of braces to std::array<> initializer for clang, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 6a5cd32 079/156: Add "Table Rating" to the header if necessary, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b01d478 029/156: Resurrect ledger XML IO code as new ledger_evaluator, Greg Chicares, 2018/01/30
- [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