- Gtkmm2ext::set_size_request_to_display_given_text (bpb_entry, "999999g", 5, 5);
-
- strings.push_back (_("whole (1)"));
- strings.push_back (_("second (2)"));
- strings.push_back (_("third (3)"));
- strings.push_back (_("quarter (4)"));
- strings.push_back (_("eighth (8)"));
- strings.push_back (_("sixteenth (16)"));
- strings.push_back (_("thirty-second (32)"));
-
- set_popdown_strings (note_types, strings, true);
-
- if (note_type==1.0f)
- note_types.set_active_text (_("whole (1)"));
- else if (note_type==2.0f)
- note_types.set_active_text (_("second (2)"));
- else if (note_type==3.0f)
- note_types.set_active_text (_("third (3)"));
- else if (note_type==4.0f)
- note_types.set_active_text (_("quarter (4)"));
- else if (note_type==8.0f)
- note_types.set_active_text (_("eighth (8)"));
- else if (note_type==16.0f)
- note_types.set_active_text (_("sixteenth (16)"));
- else if (note_type==32.0f)
- note_types.set_active_text (_("thirty-second (32)"));
- else
- note_types.set_active_text (_("quarter (4)"));
-
- Label* note_label = manage(new Label(_("Note Value:"), ALIGN_LEFT, ALIGN_CENTER));
- Label* bpb_label = manage(new Label(_("Beats Per Bar:"), ALIGN_LEFT, ALIGN_CENTER));
- Table* bpb_table = manage (new Table(2, 2));
-
- bpb_table->attach (*bpb_label, 0, 1, 0, 1, FILL|EXPAND, FILL|EXPAND, 6, 6);
- bpb_table->attach (bpb_entry, 1, 2, 0, 1, FILL|EXPAND, FILL|EXPAND, 6, 6);
- bpb_table->attach (*note_label, 0, 1, 1, 2, FILL|EXPAND, FILL|EXPAND, 6, 6);
- bpb_table->attach (note_types, 1, 2, 1, 2, FILL|EXPAND, SHRINK, 6, 6);
- bpb_frame.add (*bpb_table);
+ bpb_entry.set_alignment (1.0);
+
+ note_types.insert (make_pair (_("whole"), 1.0));
+ strings.push_back (_("whole"));
+ note_types.insert (make_pair (_("second"), 2.0));
+ strings.push_back (_("second"));
+ note_types.insert (make_pair (_("third"), 3.0));
+ strings.push_back (_("third"));
+ note_types.insert (make_pair (_("quarter"), 4.0));
+ strings.push_back (_("quarter"));
+ note_types.insert (make_pair (_("eighth"), 8.0));
+ strings.push_back (_("eighth"));
+ note_types.insert (make_pair (_("sixteenth"), 16.0));
+ strings.push_back (_("sixteenth"));
+ note_types.insert (make_pair (_("thirty-second"), 32.0));
+ strings.push_back (_("thirty-second"));
+ note_types.insert (make_pair (_("sixty-fourth"), 64.0));
+ strings.push_back (_("sixty-fourth"));
+ note_types.insert (make_pair (_("one-hundred-twenty-eighth"), 128.0));
+ strings.push_back (_("one-hundred-twenty-eighth"));
+
+ set_popdown_strings (note_type, strings);
+
+ for (x = note_types.begin(); x != note_types.end(); ++x) {
+ if (x->second == divisor) {
+ note_type.set_active_text (x->first);
+ break;
+ }
+ }
+
+ if (x == note_types.end()) {
+ note_type.set_active_text (strings[3]); // "quarter"
+ }
+
+ Label* note_label = manage (new Label (_("Note value:"), ALIGN_LEFT, ALIGN_CENTER));
+ Label* bpb_label = manage (new Label (_("Beats per bar:"), ALIGN_LEFT, ALIGN_CENTER));
+ Table* table = manage (new Table (3, 2));
+ table->set_spacings (6);
+
+ table->attach (*bpb_label, 0, 1, 0, 1, FILL|EXPAND, FILL|EXPAND);
+ table->attach (bpb_entry, 1, 2, 0, 1, FILL|EXPAND, FILL|EXPAND);
+ table->attach (*note_label, 0, 1, 1, 2, FILL|EXPAND, FILL|EXPAND);
+ table->attach (note_type, 1, 2, 1, 2, FILL|EXPAND, SHRINK);
+
+ snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
+ when_bar_entry.set_text (buf);
+ when_bar_entry.set_alignment (1.0);