Update of /cvsroot/audacity/audacity-src/src/prefs
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26552

Modified Files:
        PrefsDialog.cpp PrefsDialog.h 
Log Message:
Patch by Vidyashankar Vellal to fix P3:"Preferences Window: 
OK Button does not respond to Enter when a tab is selected in the left"

Index: PrefsDialog.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/PrefsDialog.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- PrefsDialog.cpp     27 Jul 2009 15:36:37 -0000      1.69
+++ PrefsDialog.cpp     14 Sep 2009 17:04:59 -0000      1.70
@@ -67,6 +67,7 @@
 BEGIN_EVENT_TABLE(PrefsDialog, wxDialog)
    EVT_BUTTON(wxID_OK, PrefsDialog::OnOK)
    EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
+   EVT_TREE_KEY_DOWN(wxID_ANY, PrefsDialog::OnTreeKeyDown) // Handles key 
events when tree has focus
 END_EVENT_TABLE()
 
 PrefsDialog::PrefsDialog(wxWindow * parent)
@@ -163,6 +164,14 @@
    EndModal(false);
 }
 
+void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
+{
+   if(event.GetKeyCode() == WXK_RETURN)
+      OnOK(event);
+   else
+      event.Skip(); // Ensure standard behavior when enter is not pressed
+}
+
 void PrefsDialog::OnOK(wxCommandEvent & event)
 {
    // Validate all pages first

Index: PrefsDialog.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/prefs/PrefsDialog.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- PrefsDialog.h       4 Apr 2009 10:55:56 -0000       1.10
+++ PrefsDialog.h       14 Sep 2009 17:04:59 -0000      1.11
@@ -28,6 +28,7 @@
    void OnCategoryChange(wxCommandEvent & e);
    void OnOK(wxCommandEvent & e);
    void OnCancel(wxCommandEvent & e);
+   void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when 
enter is pressed with focus on tree
 
    void SelectPageByName(wxString pageName);
    void ShowTempDirPage();


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to