13
0

Small tempo/meter dialog useability changes

git-svn-id: svn://localhost/trunk/ardour2@469 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Nick Mainsbridge 2006-04-25 00:51:30 +00:00
parent 028e1ebc4a
commit 39f32134de
3 changed files with 46 additions and 4 deletions

View File

@ -468,6 +468,9 @@ ARDOUR_UI::ask_about_saving_session (const string & what)
prompt_label.set_text (prompt);
prompt_label.set_name (X_("PrompterLabel"));
prompt_label.set_alignment(ALIGN_LEFT, ALIGN_TOP);
dimage->set_alignment(ALIGN_CENTER, ALIGN_TOP)
;
dhbox.set_homogeneous (false);
dhbox.pack_start (*dimage, false, false, 5);
dhbox.pack_start (prompt_label, true, false, 5);

View File

@ -93,13 +93,28 @@ TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
get_vbox()->pack_start (bpm_frame, false, false);
add_button (Stock::OK, RESPONSE_ACCEPT);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::APPLY, RESPONSE_ACCEPT);
set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
set_default_response (RESPONSE_ACCEPT);
get_vbox()->show_all();
bpm_entry.show();
set_name ("MetricDialog");
bpm_entry.signal_activate().connect (bind (mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
bpm_entry.signal_key_release_event().connect (mem_fun (*this, &TempoDialog::bpm_key_release));
}
bool
TempoDialog::bpm_key_release (GdkEventKey* ev)
{
if (bpm_entry.get_text() != "") {
set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
} else {
set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
}
return false;
}
double
@ -197,7 +212,7 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
/* 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);
//Gtkmm2ext::set_size_request_to_display_given_text (note_types, "thirty-second (32)", 7, 7);
hspacer1.set_border_width (5);
hspacer1.pack_start (note_types, false, false);
@ -243,7 +258,6 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
get_vbox()->pack_start (when_frame, false, false);
}
get_vbox()->pack_start (bpb_frame, false, false);
get_vbox()->pack_start (note_frame, false, false);
@ -251,13 +265,35 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
note_frame.set_name ("MetricDialogFrame");
bpb_entry.set_name ("MetricEntry");
add_button (Stock::OK, RESPONSE_ACCEPT);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::APPLY, RESPONSE_ACCEPT);
set_response_sensitive (RESPONSE_ACCEPT, false);
set_default_response (RESPONSE_ACCEPT);
get_vbox()->show_all ();
bpb_entry.show ();
set_name ("MetricDialog");
bpb_entry.signal_activate().connect (bind (mem_fun (*this, &MeterDialog::response), RESPONSE_ACCEPT));
bpb_entry.signal_key_release_event().connect (mem_fun (*this, &MeterDialog::bpb_key_release));
note_types.signal_changed().connect (mem_fun (*this, &MeterDialog::note_types_change));
}
bool
MeterDialog::bpb_key_release (GdkEventKey* ev)
{
if (bpb_entry.get_text() != "") {
set_response_sensitive (RESPONSE_ACCEPT, true);
} else {
set_response_sensitive (RESPONSE_ACCEPT, false);
}
return false;
}
void
MeterDialog::note_types_change ()
{
set_response_sensitive (Gtk::RESPONSE_ACCEPT, true);
}
double

View File

@ -41,6 +41,7 @@ struct TempoDialog : public ArdourDialog
private:
void init (const ARDOUR::BBT_Time& start, double, bool);
bool bpm_key_release (GdkEventKey* );
};
struct MeterDialog : public ArdourDialog
@ -73,6 +74,8 @@ struct MeterDialog : public ArdourDialog
private:
void init (const ARDOUR::BBT_Time&, double, double, bool);
bool bpb_key_release (GdkEventKey* );
void note_types_change ();
};
#endif /* __ardour_gtk_tempo_dialog_h__ */