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

Modified Files:
        SelectionBar.cpp SelectionBar.h 
Log Message:
Fix for typed rate not being recognized and for keys not being captured 
properly (on OSX).

Index: SelectionBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/SelectionBar.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- SelectionBar.cpp    14 Oct 2008 07:34:27 -0000      1.27
+++ SelectionBar.cpp    25 Apr 2009 17:56:04 -0000      1.28
@@ -201,7 +201,7 @@
    // We need to capture the SetFocus and KillFocus events to set up
    // for keyboard capture.  On Windows and GTK it's easy since the
    // combobox is presented as one control to hook into.
-   wxWindow *ctrl = mRateBox;
+   mRateText = mRateBox;
 
 #if defined(__WXMAC__)
    // The Mac uses a standard wxTextCtrl for the edit portion and that's
@@ -211,20 +211,20 @@
    for (unsigned int i = 0; i < kids.GetCount(); i++) {
       wxClassInfo *ci = kids[i]->GetClassInfo();
       if (ci->IsKindOf(CLASSINFO(wxTextCtrl))) {
-         ctrl = kids[i];
+         mRateText = kids[i];
          break;
       }
    }
 #endif
 
-   ctrl->Connect(wxEVT_SET_FOCUS,
-                 wxFocusEventHandler(SelectionBar::OnFocus),
-                 NULL,
-                 this);
-   ctrl->Connect(wxEVT_KILL_FOCUS,
-                 wxFocusEventHandler(SelectionBar::OnFocus),
-                 NULL,
-                 this);
+   mRateText->Connect(wxEVT_SET_FOCUS,
+                      wxFocusEventHandler(SelectionBar::OnFocus),
+                      NULL,
+                      this);
+   mRateText->Connect(wxEVT_KILL_FOCUS,
+                      wxFocusEventHandler(SelectionBar::OnFocus),
+                      NULL,
+                      this);
 
    mainSizer->Add(mRateBox, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
 
@@ -363,6 +363,7 @@
    mRightLengthButton = NULL;
 
    mRateBox = NULL;
+   mRateText = NULL;
 
    ToolBar::ReCreateButtons();
 
@@ -457,7 +458,7 @@
 
 void SelectionBar::OnRate(wxCommandEvent &evt)
 {
-   if (evt.GetString().ToDouble(&mRate) && // is a numeric value
+   if (mRateBox->GetValue().ToDouble(&mRate) && // is a numeric value
          (mRate != 0.0))
    {
       if (mLeftTime) mLeftTime->SetSampleRate(mRate);
@@ -512,8 +513,8 @@
       return;
    }
 
-   // UP/DOWN/LEFT/RIGHT for mRateBox
-   if (w == mRateBox) {
+   // UP/DOWN/LEFT/RIGHT for mRateText
+   if (w == mRateText) {
       switch (keyCode)
       {
          case WXK_LEFT:

Index: SelectionBar.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/SelectionBar.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- SelectionBar.h      29 Nov 2008 01:24:21 -0000      1.7
+++ SelectionBar.h      25 Apr 2009 17:56:04 -0000      1.8
@@ -102,6 +102,8 @@
    wxComboBox     *mRateBox;
    wxCheckBox     *mSnapTo;
 
+   wxWindow       *mRateText;
+
  public:
    TimeTextCtrl   *mLeftTime;
 


------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to