]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontpickercmn.cpp
Don't use "Cancel" button in the about dialog of the listctrl sample.
[wxWidgets.git] / src / common / fontpickercmn.cpp
index 6718668c0104d4edcf3e7414e3a1b0767699d1de..107d8c7a1407e0649fceb74ff11f0f9b062f0482 100644 (file)
@@ -125,13 +125,6 @@ void wxFontPickerCtrl::UpdatePickerFromTextCtrl()
 {
     wxASSERT(m_text);
 
-    if (m_bIgnoreNextTextCtrlUpdate)
-    {
-        // ignore this update
-        m_bIgnoreNextTextCtrlUpdate = false;
-        return;
-    }
-
     // NB: we don't use the wxFont::wxFont(const wxString &) constructor
     //     since that constructor expects the native font description
     //     string returned by wxFont::GetNativeFontInfoDesc() and not
@@ -155,11 +148,9 @@ void wxFontPickerCtrl::UpdateTextCtrlFromPicker()
     if (!m_text)
         return;     // no textctrl to update
 
-    // NOTE: this SetValue() will generate an unwanted wxEVT_COMMAND_TEXT_UPDATED
-    //       which will trigger a unneeded UpdateFromTextCtrl(); thus before using
-    //       SetValue() we set the m_bIgnoreNextTextCtrlUpdate flag...
-    m_bIgnoreNextTextCtrlUpdate = true;
-    m_text->SetValue(Font2String(M_PICKER->GetSelectedFont()));
+    // Take care to use ChangeValue() here and not SetValue() to avoid
+    // infinite recursion.
+    m_text->ChangeValue(Font2String(M_PICKER->GetSelectedFont()));
 }