Set button labels sanely.
authorNick Mainsbridge <beatroute@iprimus.com.au>
Sat, 22 Apr 2006 16:49:51 +0000 (16:49 +0000)
committerNick Mainsbridge <beatroute@iprimus.com.au>
Sat, 22 Apr 2006 16:49:51 +0000 (16:49 +0000)
git-svn-id: svn://localhost/trunk/ardour2@464 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui2.cc
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/option_editor.cc
gtk2_ardour/panner_ui.cc
gtk2_ardour/plugin_ui.cc

index 847b1b236bec7024b74b69383aa1b8fc1fd4ad88..4198e7db50676fb539dfb2a44ee0adccf432f651 100644 (file)
@@ -807,10 +807,10 @@ ARDOUR_UI::set_shuttle_units (ShuttleUnits u)
 {
        switch ((shuttle_units = u)) {
        case Percentage:
-               static_cast<Label*>(shuttle_units_button.get_child())->set_text ("% ");
+               shuttle_units_button.set_label("% ");
                break;
        case Semitones:
-               static_cast<Label*>(shuttle_units_button.get_child())->set_text (_("st"));
+               shuttle_units_button.set_label(_("st"));
                break;
        }
 }
index 0c4a5fce5c7b8a98d9fedb18ea1e06fcfd77a518..3831e253b4029d3104c98bca900baef7e9b53bba 100644 (file)
@@ -209,7 +209,7 @@ AutomationTimeAxisView::automation_state_changed ()
 
        switch (state & (Off|Play|Touch|Write)) {
        case Off:
-               static_cast<Gtk::Label*>(auto_button.get_child())->set_text (_("off"));
+               auto_button.set_label (_("off"));
                if (auto_off_item) {
                        ignore_state_request = true;
                        auto_off_item->set_active (true);
@@ -220,7 +220,7 @@ AutomationTimeAxisView::automation_state_changed ()
                }
                break;
        case Play:
-               static_cast<Gtk::Label*>(auto_button.get_child())->set_text (_("play"));
+               auto_button.set_label (_("play"));
                if (auto_play_item) {
                        ignore_state_request = true;
                        auto_play_item->set_active (true);
@@ -231,7 +231,7 @@ AutomationTimeAxisView::automation_state_changed ()
                }
                break;
        case Write:
-               static_cast<Gtk::Label*>(auto_button.get_child())->set_text (_("write"));
+               auto_button.set_label (_("write"));
                if (auto_write_item) {
                        ignore_state_request = true;
                        auto_write_item->set_active (true);
@@ -242,7 +242,7 @@ AutomationTimeAxisView::automation_state_changed ()
                }
                break;
        case Touch:
-               static_cast<Gtk::Label*>(auto_button.get_child())->set_text (_("touch"));
+               auto_button.set_label (_("touch"));
                if (auto_touch_item) {
                        ignore_state_request = true;
                        auto_touch_item->set_active (true);
@@ -253,7 +253,7 @@ AutomationTimeAxisView::automation_state_changed ()
                }
                break;
        default:
-               static_cast<Gtk::Label*>(auto_button.get_child())->set_text (_("???"));
+               auto_button.set_label (_("???"));
                break;
        }
 }
index 1a65a56eb8d07da08157674a058cf07f1c5983b3..ef04579c2db716fa81587121c49dae81df5f8c86 100644 (file)
@@ -928,10 +928,10 @@ MixerStrip::gain_automation_style_changed ()
 {
        switch (_width) {
        case Wide:
-               static_cast<Gtk::Label*> (gain_automation_style_button.get_child())->set_text (astyle_string(_route.gain_automation_curve().automation_style()));
+               gain_automation_style_button.set_label (astyle_string(_route.gain_automation_curve().automation_style()));
                break;
        case Narrow:
-               static_cast<Gtk::Label*> (gain_automation_style_button.get_child())->set_text (short_astyle_string(_route.gain_automation_curve().automation_style()));
+               gain_automation_style_button.set_label  (short_astyle_string(_route.gain_automation_curve().automation_style()));
                break;
        }
 }
@@ -945,10 +945,10 @@ MixerStrip::gain_automation_state_changed ()
 
        switch (_width) {
        case Wide:
-               static_cast<Gtk::Label*> (gain_automation_state_button.get_child())->set_text (astate_string(_route.gain_automation_curve().automation_state()));
+               gain_automation_state_button.set_label (astate_string(_route.gain_automation_curve().automation_state()));
                break;
        case Narrow:
-               static_cast<Gtk::Label*> (gain_automation_state_button.get_child())->set_text (short_astate_string(_route.gain_automation_curve().automation_state()));
+               gain_automation_state_button.set_label (short_astate_string(_route.gain_automation_curve().automation_state()));
                break;
        }
 
@@ -978,10 +978,10 @@ MixerStrip::pan_automation_style_changed ()
        
        switch (_width) {
        case Wide:
-               static_cast<Gtk::Label*> (pan_automation_style_button.get_child())->set_text (astyle_string(_route.panner().automation_style()));
+               pan_automation_style_button.set_label (astyle_string(_route.panner().automation_style()));
                break;
        case Narrow:
-               static_cast<Gtk::Label*> (pan_automation_style_button.get_child())->set_text (short_astyle_string(_route.panner().automation_style()));
+               pan_automation_style_button.set_label (short_astyle_string(_route.panner().automation_style()));
                break;
        }
 }
@@ -995,10 +995,10 @@ MixerStrip::pan_automation_state_changed ()
 
        switch (_width) {
        case Wide:
-               static_cast<Gtk::Label*> (pan_automation_state_button.get_child())->set_text (astate_string(_route.panner().automation_state()));
+               pan_automation_state_button.set_label (astate_string(_route.panner().automation_state()));
                break;
        case Narrow:
-               static_cast<Gtk::Label*> (pan_automation_state_button.get_child())->set_text (short_astate_string(_route.panner().automation_state()));
+               pan_automation_state_button.set_label (short_astate_string(_route.panner().automation_state()));
                break;
        }
 
index 9bd22ca5902c0c573d448ea745d9e6c18bc11781..b50b71f14303e2b922f59582afd2848e33fecc2e 100644 (file)
@@ -611,10 +611,10 @@ void
 OptionEditor::map_port_online (MIDI::Port* port, ToggleButton* tb)
 {
        if (port->input()->offline()) {
-               static_cast<Label*>(tb->get_child())->set_text (_("offline"));
+               tb->set_label (_("offline"));
                tb->set_active (false);
        } else {
-               static_cast<Label*>(tb->get_child())->set_text (_("online"));
+               tb->set_label (_("online"));
                tb->set_active (true);
        }
 }
index 401d707b28b88242e044e190e06daec93314696f..64cf7782c185fbdeb6adcd19faa6e53d848a05e0 100644 (file)
@@ -184,7 +184,7 @@ PannerUI::set_width (Width w)
                for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
                                (*i)->set_size_request (61, 15);
                }
-               static_cast<Gtk::Label*> (panning_link_button.get_child())->set_text (_("link"));
+               panning_link_button.set_label (_("link"));
                break;
        case Narrow:
                panning_viewport.set_size_request (31, 61);
@@ -194,7 +194,7 @@ PannerUI::set_width (Width w)
                for (vector<BarController*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
                                (*i)->set_size_request (31, 15);
                }
-               static_cast<Gtk::Label*> (panning_link_button.get_child())->set_text (_("L"));
+               panning_link_button.set_label (_("L"));
                break;
        }
 
index 00b5ad2dc7f68e55ea07ade9abf833af0fa6e69a..e0d22d8834d8f904a16c2b22510cc21d5f4484b4 100644 (file)
@@ -388,19 +388,19 @@ PluginUI::automation_state_changed (ControlUI* cui)
 
        switch (insert.get_port_automation_state (cui->port_index) & (Off|Play|Touch|Write)) {
        case Off:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("off"));
+               cui->automate_button.set_label (_("off"));
                break;
        case Play:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("play"));
+               cui->automate_button.set_label (_("play"));
                break;
        case Write:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("write"));
+               cui->automate_button.set_label (_("write"));
                break;
        case Touch:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("touch"));
+               cui->automate_button.set_label (_("touch"));
                break;
        default:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("???"));
+               cui->automate_button.set_label (_("???"));
                break;
        }
 }