[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2fd74af 3/8: Generalize class wx_table_genera
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2fd74af 3/8: Generalize class wx_table_generator |
Date: |
Thu, 17 May 2018 19:07:09 -0400 (EDT) |
branch: master
commit 2fd74affcd0cd295ce470769dcf4f8413a36b6b0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Generalize class wx_table_generator
Added a ctor argument to distinguish the use cases presently handled.
---
group_quote_pdf_gen_wx.cpp | 1 +
ledger_pdf_generator_wx.cpp | 1 +
wx_table_generator.cpp | 15 +++++++++++++++
wx_table_generator.hpp | 11 +++++++++++
4 files changed, 28 insertions(+)
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index df87f4af..e94cf7e 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -729,6 +729,7 @@ void group_quote_pdf_generator_wx::save(std::string const&
output_filename)
,pdf_writer.dc()
,pdf_writer.get_horz_margin()
,pdf_writer.get_page_width()
+ ,e_group_quote_style
);
output_aggregate_values(pdf_writer, table_gen, &pos_y);
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 12c092a..79bb8f1 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -386,6 +386,7 @@ class using_illustration_table
,writer.dc()
,writer.get_horz_margin()
,writer.get_page_width()
+ ,e_illustration_style
);
table_gen.use_condensed_style();
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 0ccc57c..966cb47 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -235,6 +235,7 @@ wx_table_generator::wx_table_generator
,wxDC& dc
,int left_margin
,int total_width
+ ,enum_pdf_table_style style
)
:dc_(dc)
,left_margin_(left_margin)
@@ -250,6 +251,20 @@ wx_table_generator::wx_table_generator
}
compute_column_widths();
+ switch(style)
+ {
+ case e_illustration_style:
+ {
+ ; // do nothing yet
+ }
+ break;
+ case e_group_quote_style:
+ {
+ ; // do nothing yet
+ }
+ break;
+ }
+
// Set a pen with 0 width to get the thin lines, and round cap style for
the
// different segments drawn in do_output_single_row() to seamlessly combine
// into a single line.
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index 4219217..6d5d733 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -41,6 +41,16 @@ struct column_parameters
std::string widest_text;
};
+/// Specialized style used as a wx_table_generator ctor argument.
+///
+/// It would be possible to derive a distinct class for each use case,
+/// but style differences are not great enough to warrant that.
+
+enum enum_pdf_table_style
+ {e_illustration_style
+ ,e_group_quote_style
+ };
+
/// Simplifies outputting tabular data on wxDC.
///
/// Several member functions reuse the same pos_y argument (which is
@@ -63,6 +73,7 @@ class wx_table_generator
,wxDC& dc
,int left_margin
,int total_width
+ ,enum_pdf_table_style style
);
wx_table_generator(wx_table_generator const&);
- [lmi-commits] [lmi] master updated (a738b9f -> d31fa0f), Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master 2fd74af 3/8: Generalize class wx_table_generator,
Greg Chicares <=
- [lmi-commits] [lmi] master 02b3f47 4/8: Generalize class wx_table_generator: pen variations, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master d31fa0f 8/8: Calculate header dimensions OAOO, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master 6d8e0ea 1/8: Move most members from derived to base class, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master 5ad29f9 6/8: Generalize class wx_table_generator more robustly, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master 8d75fd0 2/8: Eradicate unneeded class illustration_table_generator, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master 3c9cc09 5/8: Generalize class wx_table_generator: row height and boolean flags, Greg Chicares, 2018/05/17
- [lmi-commits] [lmi] master d270b21 7/8: Generally avoid regex /, $/, Greg Chicares, 2018/05/17