- 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);
-
- 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)"));
-
- /* strings.back() just happens to be the longest one to display */
- // 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);
- vspacer1.set_border_width (5);
- vspacer1.pack_start (hspacer1, false, false);
-
- hspacer2.set_border_width (5);
- hspacer2.pack_start (bpb_entry, false, false);
- vspacer2.set_border_width (5);
- vspacer2.pack_start (hspacer2, false, false);
-
- note_frame.add (vspacer1);
- bpb_frame.add (vspacer2);
+ 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"
+ }
+
+ strings.clear();
+
+ lock_styles.insert (make_pair (_("music"), MusicTime));
+ strings.push_back (_("music"));
+ lock_styles.insert (make_pair (_("audio"), AudioTime));
+ strings.push_back (_("audio"));
+ set_popdown_strings (lock_style, strings);
+ LockStyles::iterator ls;
+ for (ls = lock_styles.begin(); ls != lock_styles.end(); ++ls) {
+ if (ls->second == style) {
+ lock_style.set_active_text (ls->first);
+ break;
+ }
+ }
+ if (ls == lock_styles.end()) {
+ lock_style.set_active_text (strings[0]); // "music"
+ }
+
+ Label* note_label = manage (new Label (_("Note value:"), ALIGN_LEFT, ALIGN_CENTER));
+ Label* lock_label = manage (new Label (_("Lock style:"), ALIGN_LEFT, ALIGN_CENTER));
+ Label* bpb_label = manage (new Label (_("Beats per bar:"), ALIGN_LEFT, ALIGN_CENTER));
+ Table* table = manage (new Table (3, 3));
+ 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, FILL|EXPAND);
+
+ snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
+ when_bar_entry.set_text (buf);
+ when_bar_entry.set_alignment (1.0);