Update of /cvsroot/mahogany/M/src/wx/generic
In directory sc8-pr-cvs1:/tmp/cvs-serv10787/src/wx/generic

Modified Files:
        persctrl.cpp 
Log Message:
don't let the user to choose 'No' button when the 'don't ask again' checkbox is 
checked for the msg boxes which can't be disabled on 'No'

Index: persctrl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/wx/generic/persctrl.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -b -u -2 -r1.85 -r1.86
--- persctrl.cpp        28 Sep 2003 15:11:19 -0000      1.85
+++ persctrl.cpp        1 Oct 2003 23:44:24 -0000       1.86
@@ -1575,9 +1575,9 @@
     // callbacks
     void OnCheckBox(wxCommandEvent& event)
-        { EnableRadioBtns(event.IsChecked()); }
+        { UpdateUIOnCheck(event.IsChecked()); }
     void OnButton(wxCommandEvent& event);
 
 private:
-    void EnableRadioBtns(bool enable);
+    void UpdateUIOnCheck(bool checked);
 
 
@@ -1587,4 +1587,5 @@
     wxRadioButton *m_radiobuttons[6]; // should be enough choices...
 
+    bool m_dontDisableOnNo;
 
     DECLARE_EVENT_TABLE()
@@ -1617,4 +1618,5 @@
     m_chkDisable = NULL;
     m_countRadioBtns = 0;
+    m_dontDisableOnNo = params.dontDisableOnNo;
 
     // the dialog consists of the main, msg box, part and optionally a lower
@@ -1711,5 +1713,5 @@
         const bool enable = params.indexDisable != -1;
         m_chkDisable->SetValue(enable);
-        EnableRadioBtns(enable);
+        UpdateUIOnCheck(enable);
 
         sizerTop->Add(sizerDontShow, 0, wxALIGN_CENTER | wxALL, LAYOUT_Y_MARGIN);
@@ -1741,9 +1743,18 @@
 }
 
-void wxPMessageDialog::EnableRadioBtns(bool enable)
+void wxPMessageDialog::UpdateUIOnCheck(bool checked)
 {
     for ( size_t n = 0; n < m_countRadioBtns; n++ )
     {
-        m_radiobuttons[n]->Enable(enable);
+        m_radiobuttons[n]->Enable(checked);
+    }
+
+    if ( m_dontDisableOnNo )
+    {
+        wxWindow *win = FindWindow(wxID_NO);
+        if ( win )
+        {
+            win->Enable(!checked);
+        }
     }
 }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to