lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Sat, 28 May 2016 01:28:06 +0000 (UTC)

branch: master
commit b27a3affc3a9bdb1b985c81420758f46c98ac5dc
Author: Gregory W. Chicares <address@hidden>
Date:   Sat May 28 01:22:32 2016 +0000

    Refactor for simplicity
    
    Use TransferDataFromWindow() to get data from InputSequenceEditor.
    
    This is much cleaner than the EndModal() hack.
---
 input_sequence_entry.cpp |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index a53f1b4..5e05fea 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -206,7 +206,7 @@ class InputSequenceEditor
     void sequence(InputSequence const& s);
     std::string sequence_string();
 
-    virtual void EndModal(int retCode);
+    virtual bool TransferDataFromWindow();
 
   private:
     // Helper class ensuring that only one relayout is really done during its
@@ -1294,14 +1294,17 @@ void InputSequenceEditor::UponAddRow(wxCommandEvent& 
event)
     update_diagnostics();
 }
 
-void InputSequenceEditor::EndModal(int retCode)
+bool InputSequenceEditor::TransferDataFromWindow()
 {
+    if(!wxDialog::TransferDataFromWindow())
+        return false;
+
     // We need to set the value as soon as possible -- when used in 
wxDataViewCtrl, the value
     // is read from editor control as soon as focus changes, which is before 
ShowModal() returns.
-    if(associated_text_ctrl_ && retCode == wxID_OK)
+    if(associated_text_ctrl_)
         associated_text_ctrl_->SetValue(sequence_string());
 
-    wxDialog::EndModal(retCode);
+    return true;
 }
 
 class InputSequenceTextCtrl



reply via email to

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