lmi-commits
[Top][All Lists]
Advanced

[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&);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]