lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8a9969e 4/5: Improve commentary


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8a9969e 4/5: Improve commentary
Date: Sat, 21 Apr 2018 05:51:20 -0400 (EDT)

branch: master
commit 8a9969eefd21d6a6816c1f2f35bb43f78cffe7ea
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve commentary
    
    * wx_table_generator.cpp: List and describe all members accessed.
    * wx_table_generator.hpp: Correct function name in a comment.
---
 wx_table_generator.cpp | 30 ++++++++++++++++++++++++++++++
 wx_table_generator.hpp |  4 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 55d5635..97e7bb1 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -166,6 +166,36 @@ wxRect wx_table_generator::text_rect(std::size_t column, 
int y)
     return text_rect;
 }
 
+// class members used, mutably or immutably:
+//
+// const    total_width_
+// mutable  has_column_widths_
+// mutable  column_margin_
+// mutable  columns_
+//   i.e. std::vector<column_info> columns_;
+// mutable  column_info elements
+//   the only column_info member called is is_hidden()
+//
+// meanings (written before each variable, as in header documentation):
+//
+    // ctor parameter:
+    // The table has the given total width
+// const    total_width_
+    // Initialized to false in ctor. Changed to true after this function
+    // has been called.
+    // "meaning that all column_info::width_ values are now valid"
+    // in what sense are they not valid otherwise?
+    // is this "...if_necessary()" function in fact always called?
+    // is it unnecessary is certain context, or just unnecessary to
+    // call it again after it has been called once?
+// mutable  has_column_widths_
+    // spacing on both left and right of column
+    // initialized in ctor to # pixels in one em: (dc_.GetTextExtent("M").x)
+    // changed in this function and nowhere else
+// mutable  column_margin_
+    // std::vector<column_info>
+// mutable  columns_
+
 void wx_table_generator::do_compute_column_widths_if_necessary()
 {
     if(has_column_widths_)
diff --git a/wx_table_generator.hpp b/wx_table_generator.hpp
index 4131324..c5cec3f 100644
--- a/wx_table_generator.hpp
+++ b/wx_table_generator.hpp
@@ -346,8 +346,8 @@ class wx_table_generator
 
     std::vector<column_info> columns_;
 
-    // Initially false, set to true after do_compute_column_widths() call
-    // meaning that all column_info::width_ values are now valid.
+    // Initially false, set to true after 
do_compute_column_widths_if_necessary()
+    // call meaning that all column_info::width_ values are now valid.
     bool has_column_widths_;
 
     // Maximal number of lines in any column header, initially 1 but can be



reply via email to

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