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

Modified Files:
        ControlToolBar.cpp 
Log Message:
Fix toolbars to update tooltips when the language changes.


Index: ControlToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ControlToolBar.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- ControlToolBar.cpp  26 May 2009 08:43:27 -0000      1.38
+++ ControlToolBar.cpp  29 May 2009 17:10:06 -0000      1.39
@@ -125,8 +125,7 @@
 AButton *ControlToolBar::MakeButton(teBmps eFore, teBmps eDisabled,
                                     int id,
                                     bool processdownevents,
-                                    const wxChar *label,
-                                    const wxChar *tip)
+                                    const wxChar *label)
 {
    AButton *r = ToolBar::MakeButton(
       bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredHiliteLarge,
@@ -137,10 +136,6 @@
    r->SetLabel(label);
    r->SetFocusRect( r->GetRect().Deflate( 12, 12 ) );
 
-#if wxUSE_TOOLTIPS
-   r->SetToolTip(tip);
-#endif
-
    return r;
 }
 
@@ -172,30 +167,30 @@
    MakeButtonBackgroundsLarge();
 
    mPause = MakeButton(bmpPause,bmpPauseDisabled,
-      ID_PAUSE_BUTTON,  true,  _("Pause"), _("Pause"));
+      ID_PAUSE_BUTTON,  true,  _("Pause"));
 
    mPlay = MakeButton( bmpPlay, bmpPlayDisabled, 
-      ID_PLAY_BUTTON, true, _("Play"), _("Play (Shift for Loop Play)"));
+      ID_PLAY_BUTTON, true, _("Play"));
 
    MakeLoopImage();
 
    mStop = MakeButton( bmpStop, bmpStopDisabled ,
-      ID_STOP_BUTTON, false, _("Stop"), _("Stop"));
+      ID_STOP_BUTTON, false, _("Stop"));
 
    mRewind = MakeButton(bmpRewind, bmpRewindDisabled,
-      ID_REW_BUTTON, false, _("Start"), _("Skip to Start"));
+      ID_REW_BUTTON, false, _("Start"));
 
    mFF = MakeButton(bmpFFwd, bmpFFwdDisabled,
-      ID_FF_BUTTON, false, _("End"), _("Skip to End"));
+      ID_FF_BUTTON, false, _("End"));
 
    mRecord = MakeButton(bmpRecord, bmpRecordDisabled,
-      ID_RECORD_BUTTON, true, _("Record"), _("Record (Shift for Append 
Record)"));
+      ID_RECORD_BUTTON, true, _("Record"));
 
    mBatch = MakeButton(bmpCleanSpeech,bmpCleanSpeechDisabled,
-      ID_BATCH_BUTTON, false, _("Clean Speech"), _("Clean Speech"));
+      ID_BATCH_BUTTON, false, _("Clean Speech"));
 
 #if wxUSE_TOOLTIPS
-// MB: Should make this a pref
+   RegenerateToolsTooltips();
    wxToolTip::Enable(true);     
    wxToolTip::SetDelay(1000);
 #endif
@@ -204,11 +199,26 @@
    ArrangeButtons();
 }
 
+void ControlToolBar::RegenerateToolsTooltips()
+{
+#if wxUSE_TOOLTIPS
+   mPause->SetToolTip(_("Pause"));
+   mPlay->SetToolTip(_("Play (Shift for Loop Play)"));
+   mStop->SetToolTip(_("Stop"));
+   mRewind->SetToolTip(_("Skip to Start"));
+   mFF->SetToolTip(_("Skip to End"));
+   mRecord->SetToolTip(_("Record (Shift for Append Record)"));
+   mBatch->SetToolTip(_("Clean Speech"));
+#endif
+}
+
 void ControlToolBar::UpdatePrefs()
 {
    bool updated = false;
    bool active;
 
+   RegenerateToolsTooltips();
+
    gPrefs->Read( wxT("/GUI/ErgonomicTransportButtons"), &active, true );
    if( mErgonomicTransportButtons != active )
    {
@@ -228,6 +238,12 @@
       ReCreateButtons();
       Updated();
    }
+
+   // Set label to pull in language change
+   SetLabel(_("Control"));
+
+   // Give base class a chance
+   ToolBar::UpdatePrefs();
 }
 
 void ControlToolBar::ArrangeButtons()
@@ -295,7 +311,7 @@
 void ControlToolBar::ReCreateButtons()
 {
    // ToolBar::ReCreateButtons() will get rid of its sizer and
-   // since we've attach our sizer to it, ours will get deleted too
+   // since we've attached our sizer to it, ours will get deleted too
    // so clean ours up first.
    if( mSizer )
    {
@@ -305,6 +321,8 @@
    }
 
    ToolBar::ReCreateButtons();
+
+   RegenerateToolsTooltips();
 }
 
 void ControlToolBar::Repaint( wxDC *dc )


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to