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

Modified Files:
        Contrast.cpp Contrast.h 
Log Message:
Graying out button that don't need to be pressed.
Adding a section for 'information' and a link to WCAG (actual URL to be 
modified later).

Index: Contrast.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Contrast.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Contrast.cpp        5 Nov 2008 01:06:26 -0000       1.1
+++ Contrast.cpp        5 Nov 2008 23:29:47 -0000       1.2
@@ -26,6 +26,7 @@
 #include "../Prefs.h"
 #include "../Project.h"
 #include "../FileNames.h"
+#include "../widgets/LinkingHtmlWindow.h"
 
 #include <math.h>
 
@@ -137,6 +138,7 @@
 enum {
    ID_BUTTON_GETFOREGROUND = 10001,
    ID_BUTTON_GETBACKGROUND,
+   ID_BUTTON_GETURL,
    ID_BACKGROUNDSTART_TEXT,
    ID_BACKGROUNDEND_TEXT,
    ID_BACKGROUNDDB_TEXT,
@@ -151,6 +153,7 @@
    EVT_BUTTON(wxID_OK, ContrastDialog::OnOK)
    EVT_BUTTON(ID_BUTTON_GETFOREGROUND, ContrastDialog::OnGetForegroundDB)
    EVT_BUTTON(ID_BUTTON_GETBACKGROUND, ContrastDialog::OnGetBackgroundDB)
+   EVT_BUTTON(ID_BUTTON_GETURL, ContrastDialog::OnGetURL)
    EVT_TEXT(ID_FOREGROUNDSTART_TEXT, ContrastDialog::OnForegroundStartText)
    EVT_TEXT(ID_FOREGROUNDEND_TEXT, ContrastDialog::OnForegroundEndText)
    EVT_TEXT(ID_BACKGROUNDSTART_TEXT, ContrastDialog::OnBackgroundStartText)
@@ -167,10 +170,8 @@
    m_pButton_GetForeground = NULL;
    m_pButton_GetBackground = NULL;
 
-//   gPrefs->Read(wxT("/Contrast/foregrounddB"), &foregrounddB, 0.0);
    gPrefs->Read(wxT("/Contrast/startTimeF"), &startTimeF, 0.0);
    gPrefs->Read(wxT("/Contrast/endTimeF"), &endTimeF, 0.0);
-//   gPrefs->Read(wxT("/Contrast/backgrounddB"), &backgrounddB, 0.0);
    gPrefs->Read(wxT("/Contrast/startTimeB"), &startTimeB, 0.0);
    gPrefs->Read(wxT("/Contrast/endTimeB"), &endTimeB, 0.0);
 
@@ -180,7 +181,6 @@
    m_pEffect->SetStartTime(startTimeB);
    m_pEffect->SetEndTime(endTimeB);
    backgrounddB = m_pEffect->GetDB();
-
    Init();
 }
 
@@ -190,6 +190,7 @@
    m_pEffect->SetEndTime(endTimeF);
    foregrounddB = m_pEffect->GetDB();
    mForegroundRMSText->SetLabel(wxString::Format(_("%.1f dB"), foregrounddB));
+   m_pButton_GetForeground->Enable(false);
    results();
 }
 
@@ -199,9 +200,16 @@
    m_pEffect->SetEndTime(endTimeB);
    backgrounddB = m_pEffect->GetDB();
    mBackgroundRMSText->SetLabel(wxString::Format(_("%.1f dB"), backgrounddB));
+   m_pButton_GetBackground->Enable(false);
    results();
 }
 
+void ContrastDialog::OnGetURL(wxCommandEvent &event)
+{
+   wxString page = wxT("http://www.w3.org/TR/WCAG20/";);  // yet to determine 
where this should point
+   ::OpenInDefaultBrowser(page);
+}
+
 void ContrastDialog::OnOK(wxCommandEvent &event)
 {
    gPrefs->Write(wxT("/Contrast/startTimeF"), startTimeF);
@@ -280,6 +288,7 @@
          }
          S.EndMultiColumn();
          m_pButton_GetForeground = 
S.Id(ID_BUTTON_GETFOREGROUND).AddButton(_("Measure"));
+         m_pButton_GetForeground->Enable(false);   // Disabled as we do the 
measurement as we put up the dialog
          
mForegroundRMSText=S.Id(ID_FOREGROUNDDB_TEXT).AddVariableText(wxString::Format(wxT("%.1f
 dB"), foregrounddB));
 
          //Background
@@ -302,7 +311,7 @@
          }
          S.EndMultiColumn();
          m_pButton_GetBackground = 
S.Id(ID_BUTTON_GETBACKGROUND).AddButton(_("Measure"));
-
+         m_pButton_GetBackground->Enable(false);
          
mBackgroundRMSText=S.Id(ID_BACKGROUNDDB_TEXT).AddVariableText(wxString::Format(wxT("%.1f
 dB"), backgrounddB));
       }
       S.EndMultiColumn();
@@ -323,30 +332,41 @@
    }
    S.EndStatic();
    results();
+
+   //Information
+   S.StartStatic( _("Information") );
+   {
+      m_pButton_GetURL = S.Id(ID_BUTTON_GETURL).AddButton(_("WCAG Information 
on web"));
+   }
+   S.EndStatic();
 }
 
 void ContrastDialog::OnForegroundStartText(wxCommandEvent & event)
 {
    wxString val = mForegroundStartText->GetValue();
    val.ToDouble(&startTimeF);
+   m_pButton_GetForeground->Enable(true);
 }
 
 void ContrastDialog::OnForegroundEndText(wxCommandEvent & event)
 {
    wxString val = mForegroundEndText->GetValue();
    val.ToDouble(&endTimeF);
+   m_pButton_GetForeground->Enable(true);
 }
 
 void ContrastDialog::OnBackgroundStartText(wxCommandEvent & event)
 {
    wxString val = mBackgroundStartText->GetValue();
    val.ToDouble(&startTimeB);
+   m_pButton_GetBackground->Enable(true);
 }
 
 void ContrastDialog::OnBackgroundEndText(wxCommandEvent & event)
 {
    wxString val = mBackgroundEndText->GetValue();
    val.ToDouble(&endTimeB);
+   m_pButton_GetBackground->Enable(true);
 }
 
 void ContrastDialog::results()

Index: Contrast.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Contrast.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Contrast.h  5 Nov 2008 01:06:26 -0000       1.1
+++ Contrast.h  5 Nov 2008 23:29:47 -0000       1.2
@@ -94,6 +94,7 @@
    // handlers
    void OnGetForegroundDB( wxCommandEvent &event );
    void OnGetBackgroundDB( wxCommandEvent &event );
+   void OnGetURL(wxCommandEvent &event);
    void OnForegroundStartText(wxCommandEvent & event);
    void OnForegroundEndText(wxCommandEvent & event);
    void OnBackgroundStartText(wxCommandEvent & event);
@@ -123,6 +124,7 @@
 
    wxButton * m_pButton_GetBackground;
    wxButton * m_pButton_GetForeground;
+   wxButton * m_pButton_GetURL;
 
 private:
    DECLARE_EVENT_TABLE()


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to