lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 728c6a9: Explain how InputSequenceEditor::rem


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 728c6a9: Explain how InputSequenceEditor::remove_row() works
Date: Fri, 22 Mar 2019 17:02:18 -0400 (EDT)

branch: master
commit 728c6a94f9595a3cf829fc09edabb27474320041
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Explain how InputSequenceEditor::remove_row() works
    
    See:
      https://lists.nongnu.org/archive/html/lmi/2019-03/msg00023.html
---
 input_sequence_entry.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index 9cde932..9919c76 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -803,6 +803,11 @@ void InputSequenceEditor::remove_row(int row)
     // remove all controls from the row
     for(int i = 0; i < Col_Max; ++i)
         {
+        // Note that the index here is constant and always refers to
+        // the first window in the given row: as the indices of the
+        // subsequent elements adjust, by decreasing by one, when we
+        // delete this index, repeatedly deleting Col_Max elements at
+        // this position results in deleting the entire row contents.
         int index = row * Col_Max;
         wxWindow* win = sizer_->GetItem(index)->GetWindow();
         LMI_ASSERT(win);



reply via email to

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