#include <gtkmm2ext/utils.h>
#include "tempo_dialog.h"
+#include "utils.h"
#include "i18n.h"
using namespace Gtk;
+using namespace Gtkmm2ext;
using namespace ARDOUR;
TempoDialog::TempoDialog (TempoMap& map, jack_nframes_t frame, string action)
when_table.set_col_spacings (2);
when_table.set_border_width (5);
- when_table.attach (when_bar_label, 0, 1, 0, 1, 0, Gtk::FILL|Gtk::EXPAND);
- when_table.attach (when_bar_entry, 0, 1, 1, 2, 0, Gtk::FILL|Gtk::EXPAND);
+ when_table.attach (when_bar_label, 0, 1, 0, 1, Gtk::AttachOptions(0), Gtk::FILL|Gtk::EXPAND);
+ when_table.attach (when_bar_entry, 0, 1, 1, 2, Gtk::AttachOptions(0), Gtk::FILL|Gtk::EXPAND);
- when_table.attach (when_beat_label, 1, 2, 0, 1, 0, 0);
- when_table.attach (when_beat_entry, 1, 2, 1, 2, 0, 0);
+ when_table.attach (when_beat_label, 1, 2, 0, 1, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
+ when_table.attach (when_beat_entry, 1, 2, 1, 2, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
when_frame.set_name ("MetricDialogFrame");
when_frame.add (when_table);
bpb_entry.select_region (0, -1);
Gtkmm2ext::set_size_request_to_display_given_text (bpb_entry, "999999g", 5, 5);
+ vector<string> strings;
strings.push_back (_("whole (1)"));
strings.push_back (_("second (2)"));
strings.push_back (_("thirty-second (32)"));
set_popdown_strings (note_types, strings);
-
+
if (note_type==1.0f)
- note_types.get_entry()->set_text(_("whole (1)"));
+ note_types.set_active_text (_("whole (1)"));
else if (note_type==2.0f)
- note_types.get_entry()->set_text(_("second (2)"));
+ note_types.set_active_text (_("second (2)"));
else if (note_type==3.0f)
- note_types.get_entry()->set_text(_("third (3)"));
+ note_types.set_active_text (_("third (3)"));
else if (note_type==4.0f)
- note_types.get_entry()->set_text(_("quarter (4)"));
+ note_types.set_active_text (_("quarter (4)"));
else if (note_type==8.0f)
- note_types.get_entry()->set_text(_("eighth (8)"));
+ note_types.set_active_text (_("eighth (8)"));
else if (note_type==16.0f)
- note_types.get_entry()->set_text(_("sixteenth (16)"));
+ note_types.set_active_text (_("sixteenth (16)"));
else if (note_type==32.0f)
- note_types.get_entry()->set_text(_("thirty-second (32)"));
+ note_types.set_active_text (_("thirty-second (32)"));
else
- note_types.get_entry()->set_text(_("quarter (4)"));
+ note_types.set_active_text (_("quarter (4)"));
/* strings.back() just happens to be the longest one to display */
- Gtkmm2ext::set_size_request_to_display_given_text (*(note_types.get_entry()), strings.back(), 7, 7);
+ // GTK2FIX
+ // Gtkmm2ext::set_size_request_to_display_given_text (*(note_types.get_entry()), strings.back(), 7, 7);
hspacer1.set_border_width (5);
hspacer1.pack_start (note_types, false, false);
when_table.set_col_spacings (2);
when_table.set_border_width (5);
- when_table.attach (when_bar_label, 0, 1, 0, 1, 0, Gtk::FILL|Gtk::EXPAND);
- when_table.attach (when_bar_entry, 0, 1, 1, 2, 0, Gtk::FILL|Gtk::EXPAND);
+ when_table.attach (when_bar_label, 0, 1, 0, 1, Gtk::AttachOptions(0), Gtk::FILL|Gtk::EXPAND);
+ when_table.attach (when_bar_entry, 0, 1, 1, 2, Gtk::AttachOptions(0), Gtk::FILL|Gtk::EXPAND);
- when_table.attach (when_beat_label, 1, 2, 0, 1, 0, 0);
- when_table.attach (when_beat_entry, 1, 2, 1, 2, 0, 0);
+ when_table.attach (when_beat_label, 1, 2, 0, 1, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
+ when_table.attach (when_beat_entry, 1, 2, 1, 2, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
when_frame.set_name ("MetricDialogFrame");
when_frame.add (when_table);
bpb_frame.set_name ("MetricDialogFrame");
note_frame.set_name ("MetricDialogFrame");
- note_types.get_entry()->set_name ("MetricEntry");
bpb_entry.set_name ("MetricEntry");
ok_button.set_name ("MetricButton");
cancel_button.set_name ("MetricButton");
{
double note_type = 0;
vector<const gchar *>::iterator i;
- string text = note_types.get_entry()->get_text();
+ string text = note_types.get_active_text();
for (i = strings.begin(); i != strings.end(); ++i) {
if (text == *i) {
if (sscanf (text.c_str(), "%*[^0-9]%lf", ¬e_type) != 1) {
- error << compose(_("garbaged note type entry (%1)"), text) << endmsg;
+ error << string_compose(_("garbaged note type entry (%1)"), text) << endmsg;
return 0;
} else {
break;
if (i == strings.end()) {
if (sscanf (text.c_str(), "%lf", ¬e_type) != 1) {
- error << compose(_("incomprehensible note type entry (%1)"), text) << endmsg;
+ error << string_compose(_("incomprehensible note type entry (%1)"), text) << endmsg;
return 0;
}
}