Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27580/src/gui

Modified Files:
        wxFiltersDialog.cpp 
Log Message:
automatically enable the condition checkbox in quick filter dialog if the user edits 
the text corresponding to it

Index: wxFiltersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFiltersDialog.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -b -u -2 -r1.116 -r1.117
--- wxFiltersDialog.cpp 11 Mar 2004 20:10:23 -0000      1.116
+++ wxFiltersDialog.cpp 19 Apr 2004 14:45:06 -0000      1.117
@@ -2175,4 +2175,5 @@
 
    // event handlers
+   void OnText(wxCommandEvent& event);
    void OnChoice(wxCommandEvent&) { DoUpdateUI(); }
    void OnUpdateOk(wxUpdateUIEvent& event);
@@ -2198,4 +2199,5 @@
 BEGIN_EVENT_TABLE(wxQuickFilterDialog, wxManuallyLaidOutDialog)
    EVT_CHOICE(-1, wxQuickFilterDialog::OnChoice)
+   EVT_TEXT(-1, wxQuickFilterDialog::OnText)
 
    EVT_UPDATE_UI(wxID_OK, wxQuickFilterDialog::OnUpdateOk)
@@ -2214,4 +2216,8 @@
    m_folder->IncRef();
 
+   // this is used in OnText() to check if we had finished with initializing
+   // the dialog
+   m_action = NULL;
+
    wxLayoutConstraints *c;
 
@@ -2222,5 +2228,5 @@
                            (
                             this, -1,
-                            _("Only if:")
+                            _("Only if all of the below conditions are true:")
                            );
 
@@ -2274,5 +2280,5 @@
    }
 
-   msg = new wxStaticText(this, -1, _("&And then:"));
+   msg = new wxStaticText(this, -1, _("&And if they are, then:"));
    c = new wxLayoutConstraints;
    c->top.Below(m_check[Filter_Max - 1], 3*LAYOUT_Y_MARGIN);
@@ -2369,4 +2375,29 @@
 }
 
+void wxQuickFilterDialog::OnText(wxCommandEvent& event)
+{
+   if ( !m_action )
+   {
+      // the dialog hasn't been fully initialized yet so this change comes from
+      // our code and not from user -- ignore it for our purposes here
+      return;
+   }
+
+   // if the user starts editing the text field, chances are that he wants to
+   // use it as the filter condition, so check the corresponding checkbox
+   // automatically to save him a few keystrokes/mouse movements
+   for ( size_t n = 0; n < Filter_Max; n++ )
+   {
+      if ( m_text[n] == event.GetEventObject() )
+      {
+         m_check[n]->SetValue(true);
+
+         return;
+      }
+   }
+
+   FAIL_MSG( _T("ignoring text event from unknown control") );
+}
+
 void wxQuickFilterDialog::OnUpdateOk(wxUpdateUIEvent& event)
 {



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to