more substantive reworkings of TimeAxisView::name_(entry|label) and name editing. better, but i can still (somehow) trigger occasional misbehaviour
git-svn-id: svn://localhost/ardour2/branches/3.0@13840 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2bc6b777c6
commit
00cba5aa3b
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
VALGRIND_OPTIONS="$VALGRIND_OPTIONS --num-callers=50"
|
VALGRIND_OPTIONS="$VALGRIND_OPTIONS --num-callers=50"
|
||||||
VALGRIND_OPTIONS="$VALGRIND_OPTIONS --error-limit=no"
|
VALGRIND_OPTIONS="$VALGRIND_OPTIONS --error-limit=no"
|
||||||
VALGRIND_OPTIONS="$VALGRIND_OPTIONS --leak-check=full --leak-resolution=high"
|
#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --leak-check=full --leak-resolution=high"
|
||||||
#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --log-file=/tmp/ardour-%p.log"
|
#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --log-file=/tmp/ardour-%p.log"
|
||||||
#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --gen-suppressions=all"
|
#VALGRIND_OPTIONS="$VALGRIND_OPTIONS --gen-suppressions=all"
|
||||||
|
|
||||||
|
@ -153,11 +153,6 @@ AutomationTimeAxisView::AutomationTimeAxisView (
|
|||||||
set_height (preset_height (HeightNormal));
|
set_height (preset_height (HeightNormal));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for automation tracks, the label does not swap with an entry box. remove all that stuff */
|
|
||||||
if (name_label.get_parent()) {
|
|
||||||
hide_name_label ();
|
|
||||||
}
|
|
||||||
|
|
||||||
name_label.set_text (_name);
|
name_label.set_text (_name);
|
||||||
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
name_label.set_alignment (Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
|
||||||
name_label.set_name (X_("TrackParameterName"));
|
name_label.set_name (X_("TrackParameterName"));
|
||||||
@ -175,6 +170,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (
|
|||||||
controls_table.attach (name_label, 0, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_label, 0, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
controls_table.attach (auto_button, 6, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (auto_button, 6, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
|
|
||||||
|
name_label.show ();
|
||||||
|
|
||||||
if (_controller) {
|
if (_controller) {
|
||||||
_controller.get()->set_size_request(-1, 24);
|
_controller.get()->set_size_request(-1, 24);
|
||||||
/* add bar controller */
|
/* add bar controller */
|
||||||
@ -422,15 +419,11 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
|||||||
first_call_to_set_height = false;
|
first_call_to_set_height = false;
|
||||||
|
|
||||||
if (h >= preset_height (HeightNormal)) {
|
if (h >= preset_height (HeightNormal)) {
|
||||||
show_name_label ();
|
|
||||||
hide_name_entry ();
|
|
||||||
auto_button.show();
|
auto_button.show();
|
||||||
hide_button.show_all();
|
hide_button.show_all();
|
||||||
|
|
||||||
} else if (h >= preset_height (HeightSmall)) {
|
} else if (h >= preset_height (HeightSmall)) {
|
||||||
controls_table.hide_all ();
|
controls_table.hide_all ();
|
||||||
hide_name_entry ();
|
|
||||||
hide_name_label ();
|
|
||||||
auto_button.hide();
|
auto_button.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,8 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
|
|||||||
{
|
{
|
||||||
RouteUI::set_route (rt);
|
RouteUI::set_route (rt);
|
||||||
|
|
||||||
|
show_name_label ();
|
||||||
|
|
||||||
gm.set_controls (_route, _route->shared_peak_meter(), _route->amp());
|
gm.set_controls (_route, _route->shared_peak_meter(), _route->amp());
|
||||||
gm.get_level_meter().set_no_show_all();
|
gm.get_level_meter().set_no_show_all();
|
||||||
gm.get_level_meter().setup_meters(50);
|
gm.get_level_meter().setup_meters(50);
|
||||||
@ -321,15 +323,15 @@ RouteTimeAxisView::label_view ()
|
|||||||
{
|
{
|
||||||
string x = _route->name();
|
string x = _route->name();
|
||||||
|
|
||||||
if (x != name_entry.get_text()) {
|
if (name_entry && x != name_entry->get_text()) {
|
||||||
name_entry.set_text (x);
|
name_entry->set_text (x);
|
||||||
|
ARDOUR_UI::instance()->set_tip (*name_entry, Glib::Markup::escape_text(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x != name_label.get_text()) {
|
if (x != name_label.get_text()) {
|
||||||
name_label.set_text (x);
|
name_label.set_text (x);
|
||||||
}
|
}
|
||||||
|
|
||||||
ARDOUR_UI::instance()->set_tip (name_entry, Glib::Markup::escape_text(x));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1288,7 +1290,7 @@ RouteTimeAxisView::name_entry_changed ()
|
|||||||
{
|
{
|
||||||
TimeAxisView::name_entry_changed ();
|
TimeAxisView::name_entry_changed ();
|
||||||
|
|
||||||
string x = name_entry.get_text ();
|
string x = name_entry->get_text ();
|
||||||
|
|
||||||
if (x == _route->name()) {
|
if (x == _route->name()) {
|
||||||
return;
|
return;
|
||||||
@ -1297,18 +1299,18 @@ RouteTimeAxisView::name_entry_changed ()
|
|||||||
strip_whitespace_edges (x);
|
strip_whitespace_edges (x);
|
||||||
|
|
||||||
if (x.length() == 0) {
|
if (x.length() == 0) {
|
||||||
name_entry.set_text (_route->name());
|
name_entry->set_text (_route->name());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_session->route_name_internal (x)) {
|
if (_session->route_name_internal (x)) {
|
||||||
ARDOUR_UI::instance()->popup_error (string_compose (_("You cannot create a track with that name as it is reserved for %1"),
|
ARDOUR_UI::instance()->popup_error (string_compose (_("You cannot create a track with that name as it is reserved for %1"),
|
||||||
PROGRAM_NAME));
|
PROGRAM_NAME));
|
||||||
name_entry.grab_focus ();
|
name_entry->grab_focus ();
|
||||||
} else if (RouteUI::verify_new_route_name (x)) {
|
} else if (RouteUI::verify_new_route_name (x)) {
|
||||||
_route->set_name (x);
|
_route->set_name (x);
|
||||||
} else {
|
} else {
|
||||||
name_entry.grab_focus ();
|
name_entry->grab_focus ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,18 +70,19 @@ PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
|
|||||||
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
|
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
|
||||||
: AxisView (sess)
|
: AxisView (sess)
|
||||||
, controls_table (2, 8)
|
, controls_table (2, 8)
|
||||||
|
, name_entry (0)
|
||||||
|
, _name_editing (false)
|
||||||
, height (0)
|
, height (0)
|
||||||
, last_name_entry_key_press_event (0)
|
|
||||||
, display_menu (0)
|
, display_menu (0)
|
||||||
, parent (rent)
|
, parent (rent)
|
||||||
, selection_group (0)
|
, selection_group (0)
|
||||||
, _hidden (false)
|
, _hidden (false)
|
||||||
, in_destructor (false)
|
, in_destructor (false)
|
||||||
, name_packing (NamePackingBits (0))
|
|
||||||
, _size_menu (0)
|
, _size_menu (0)
|
||||||
, _canvas_display (0)
|
, _canvas_display (0)
|
||||||
, _y_position (0)
|
, _y_position (0)
|
||||||
, _editor (ed)
|
, _editor (ed)
|
||||||
|
, last_name_entry_key_press_event (0)
|
||||||
, control_parent (0)
|
, control_parent (0)
|
||||||
, _order (0)
|
, _order (0)
|
||||||
, _effective_height (0)
|
, _effective_height (0)
|
||||||
@ -89,6 +90,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
|||||||
, _preresize_cursor (0)
|
, _preresize_cursor (0)
|
||||||
, _have_preresize_cursor (false)
|
, _have_preresize_cursor (false)
|
||||||
, _ghost_group (0)
|
, _ghost_group (0)
|
||||||
|
, _ebox_release_can_act (true)
|
||||||
{
|
{
|
||||||
if (extra_height == 0) {
|
if (extra_height == 0) {
|
||||||
compute_heights ();
|
compute_heights ();
|
||||||
@ -106,23 +108,9 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
|||||||
_ghost_group->lower_to_bottom();
|
_ghost_group->lower_to_bottom();
|
||||||
_ghost_group->show();
|
_ghost_group->show();
|
||||||
|
|
||||||
/*
|
|
||||||
Create the standard LHS Controls
|
|
||||||
We create the top-level container and name add the name label here,
|
|
||||||
subclasses can add to the layout as required
|
|
||||||
*/
|
|
||||||
|
|
||||||
name_entry.set_name ("EditorTrackNameDisplay");
|
|
||||||
name_entry.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_release), false);
|
|
||||||
name_entry.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_press), false);
|
|
||||||
name_entry.signal_key_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_key_release));
|
|
||||||
name_entry.signal_activate().connect (sigc::mem_fun(*this, &TimeAxisView::name_entry_activated));
|
|
||||||
name_entry.signal_focus_in_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_in));
|
|
||||||
name_entry.signal_focus_out_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_out));
|
|
||||||
Gtkmm2ext::set_size_request_to_display_given_text (name_entry, N_("gTortnam"), 10, 10); // just represents a short name
|
|
||||||
|
|
||||||
name_label.set_name ("TrackLabel");
|
name_label.set_name ("TrackLabel");
|
||||||
name_label.set_alignment (0.0, 0.5);
|
name_label.set_alignment (0.0, 0.5);
|
||||||
|
ARDOUR_UI::instance()->set_tip (name_label, _("Track/Bus name (double click to edit)"));
|
||||||
|
|
||||||
/* typically, either name_label OR name_entry are visible,
|
/* typically, either name_label OR name_entry are visible,
|
||||||
but not both. its up to derived classes to show/hide them as they
|
but not both. its up to derived classes to show/hide them as they
|
||||||
@ -358,27 +346,23 @@ TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
|
|||||||
bool
|
bool
|
||||||
TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
|
TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
|
||||||
{
|
{
|
||||||
if (event->button == 1) {
|
if ((event->button == 1 && event->type == GDK_2BUTTON_PRESS) || Keyboard::is_edit_event (event)) {
|
||||||
if (event->type == GDK_2BUTTON_PRESS) {
|
|
||||||
/* see if it is inside the name label */
|
/* see if it is inside the name label */
|
||||||
if (name_label.is_ancestor (controls_ebox)) {
|
if (name_label.is_ancestor (controls_ebox)) {
|
||||||
int nlx;
|
int nlx;
|
||||||
int nly;
|
int nly;
|
||||||
controls_ebox.translate_coordinates (name_label, event->x, event->y, nlx, nly);
|
controls_ebox.translate_coordinates (name_label, event->x, event->y, nlx, nly);
|
||||||
Gtk::Allocation a = name_label.get_allocation ();
|
Gtk::Allocation a = name_label.get_allocation ();
|
||||||
if (nlx > 0 && nlx < a.get_width() &&
|
if (nlx > 0 && nlx < a.get_width() && nly > 0 && nly < a.get_height()) {
|
||||||
nly > 0 && nly < a.get_height()) {
|
begin_name_edit ((GdkEvent*) event);
|
||||||
hide_name_label ();
|
_ebox_release_can_act = false;
|
||||||
show_name_entry ();
|
|
||||||
if (can_edit_name()) {
|
|
||||||
name_entry.grab_focus ();
|
|
||||||
name_entry.start_editing ((GdkEvent*) event);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_ebox_release_can_act = true;
|
||||||
|
|
||||||
if (maybe_set_cursor (event->y) > 0) {
|
if (maybe_set_cursor (event->y) > 0) {
|
||||||
_resize_drag_start = event->y_root;
|
_resize_drag_start = event->y_root;
|
||||||
@ -473,6 +457,10 @@ TimeAxisView::controls_ebox_button_release (GdkEventButton* ev)
|
|||||||
_resize_drag_start = -1;
|
_resize_drag_start = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_ebox_release_can_act) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
switch (ev->button) {
|
switch (ev->button) {
|
||||||
case 1:
|
case 1:
|
||||||
selection_click (ev);
|
selection_click (ev);
|
||||||
@ -555,8 +543,6 @@ TimeAxisView::set_height (uint32_t h)
|
|||||||
/* resize the selection rect */
|
/* resize the selection rect */
|
||||||
show_selection (_editor.get_selection().time);
|
show_selection (_editor.get_selection().time);
|
||||||
}
|
}
|
||||||
|
|
||||||
show_name_label ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -566,9 +552,11 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
|||||||
|
|
||||||
switch (ev->keyval) {
|
switch (ev->keyval) {
|
||||||
case GDK_Escape:
|
case GDK_Escape:
|
||||||
name_entry.select_region (0,0);
|
// revert back to the way it was because
|
||||||
|
// name_entry_changed() will still be called as we drop focus.
|
||||||
|
name_entry->set_text (name_label.get_text());
|
||||||
|
// moving the focus will trigger everything else
|
||||||
controls_ebox.grab_focus ();
|
controls_ebox.grab_focus ();
|
||||||
name_entry_changed ();
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Shift+Tab Keys Pressed. Note that for Shift+Tab, GDK actually
|
/* Shift+Tab Keys Pressed. Note that for Shift+Tab, GDK actually
|
||||||
@ -578,12 +566,12 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
|||||||
case GDK_ISO_Left_Tab:
|
case GDK_ISO_Left_Tab:
|
||||||
case GDK_Tab:
|
case GDK_Tab:
|
||||||
{
|
{
|
||||||
name_entry_changed ();
|
|
||||||
TrackViewList const & allviews = _editor.get_track_views ();
|
TrackViewList const & allviews = _editor.get_track_views ();
|
||||||
TrackViewList::const_iterator i = find (allviews.begin(), allviews.end(), this);
|
TrackViewList::const_iterator i = find (allviews.begin(), allviews.end(), this);
|
||||||
|
|
||||||
if (ev->keyval == GDK_Tab) {
|
if (ev->keyval == GDK_Tab) {
|
||||||
if (i != allviews.end()) {
|
if (i != allviews.end()) {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (++i == allviews.end()) {
|
if (++i == allviews.end()) {
|
||||||
return true;
|
return true;
|
||||||
@ -624,16 +612,21 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* moving the focus will trigger everything else that is needed */
|
||||||
|
|
||||||
if ((i != allviews.end()) && (*i != this) && !(*i)->hidden()) {
|
if ((i != allviews.end()) && (*i != this) && !(*i)->hidden()) {
|
||||||
(*i)->name_entry.grab_focus();
|
|
||||||
_editor.ensure_time_axis_view_is_visible (**i);
|
_editor.ensure_time_axis_view_is_visible (**i);
|
||||||
|
(*i)->begin_name_edit ((GdkEvent*) ev);
|
||||||
|
} else {
|
||||||
|
controls_ebox.grab_focus ();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GDK_Up:
|
case GDK_Up:
|
||||||
case GDK_Down:
|
case GDK_Down:
|
||||||
name_entry_changed ();
|
controls_ebox.grab_focus ();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -661,33 +654,68 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
|||||||
name_entry_key_timeout = Glib::signal_timeout().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_key_timed_out), name_entry_timeout);
|
name_entry_key_timeout = Glib::signal_timeout().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_key_timed_out), name_entry_timeout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
void
|
||||||
TimeAxisView::name_entry_focus_in (GdkEventFocus*)
|
TimeAxisView::begin_name_edit (GdkEvent* event)
|
||||||
{
|
{
|
||||||
name_entry.select_region (0, -1);
|
if (_name_editing) {
|
||||||
name_entry.set_state (STATE_SELECTED);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (can_edit_name()) {
|
||||||
|
|
||||||
|
_name_editing = true;
|
||||||
|
|
||||||
|
show_name_entry ();
|
||||||
|
name_entry->select_region (0, -1);
|
||||||
|
name_entry->set_state (STATE_SELECTED);
|
||||||
|
name_entry->grab_focus ();
|
||||||
|
name_entry->start_editing (event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::end_name_edit (bool push_focus)
|
||||||
|
{
|
||||||
|
if (!_name_editing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (can_edit_name()) {
|
||||||
|
|
||||||
|
_name_editing = false;
|
||||||
|
|
||||||
|
last_name_entry_key_press_event = 0;
|
||||||
|
name_entry_key_timeout.disconnect ();
|
||||||
|
|
||||||
|
if (push_focus) {
|
||||||
|
controls_ebox.grab_focus ();
|
||||||
|
}
|
||||||
|
|
||||||
|
show_name_label ();
|
||||||
|
name_entry_changed ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::name_entry_changed ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
TimeAxisView::name_entry_focus_in (GdkEventFocus* ev)
|
||||||
|
{
|
||||||
|
begin_name_edit ((GdkEvent*) ev);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TimeAxisView::name_entry_focus_out (GdkEventFocus*)
|
TimeAxisView::name_entry_focus_out (GdkEventFocus*)
|
||||||
{
|
{
|
||||||
cerr << "NEFO\n";
|
end_name_edit (false);
|
||||||
|
|
||||||
/* clean up */
|
|
||||||
|
|
||||||
last_name_entry_key_press_event = 0;
|
|
||||||
name_entry_key_timeout.disconnect ();
|
|
||||||
name_entry.select_region (0,0);
|
|
||||||
name_entry.set_state (STATE_NORMAL);
|
|
||||||
|
|
||||||
/* do the real stuff */
|
|
||||||
|
|
||||||
name_entry_changed ();
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -701,15 +729,7 @@ TimeAxisView::name_entry_key_timed_out ()
|
|||||||
void
|
void
|
||||||
TimeAxisView::name_entry_activated ()
|
TimeAxisView::name_entry_activated ()
|
||||||
{
|
{
|
||||||
controls_ebox.grab_focus();
|
end_name_edit (true);
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
TimeAxisView::name_entry_changed ()
|
|
||||||
{
|
|
||||||
cerr << "swithcing back to name labnel\n";
|
|
||||||
hide_name_entry ();
|
|
||||||
show_name_label ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -1160,9 +1180,12 @@ TimeAxisView::compute_heights ()
|
|||||||
void
|
void
|
||||||
TimeAxisView::show_name_label ()
|
TimeAxisView::show_name_label ()
|
||||||
{
|
{
|
||||||
if (!(name_packing & NameLabelPacked) && name_label.get_parent() == 0) {
|
if (name_entry && name_entry->is_ancestor (name_hbox)) {
|
||||||
|
name_hbox.remove (*name_entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!name_label.is_ancestor (name_hbox) && name_label.get_parent() == 0) {
|
||||||
name_hbox.pack_start (name_label, true, true);
|
name_hbox.pack_start (name_label, true, true);
|
||||||
name_packing = NamePackingBits (name_packing | NameLabelPacked);
|
|
||||||
name_hbox.show ();
|
name_hbox.show ();
|
||||||
name_label.show ();
|
name_label.show ();
|
||||||
}
|
}
|
||||||
@ -1171,29 +1194,35 @@ TimeAxisView::show_name_label ()
|
|||||||
void
|
void
|
||||||
TimeAxisView::show_name_entry ()
|
TimeAxisView::show_name_entry ()
|
||||||
{
|
{
|
||||||
if (!(name_packing & NameEntryPacked)) {
|
if (!name_entry) {
|
||||||
name_hbox.pack_start (name_entry, true, true);
|
/*
|
||||||
name_packing = NamePackingBits (name_packing | NameEntryPacked);
|
Create the standard LHS Controls
|
||||||
name_hbox.show ();
|
We create the top-level container and name add the name label here,
|
||||||
name_entry.show ();
|
subclasses can add to the layout as required
|
||||||
}
|
*/
|
||||||
|
|
||||||
|
name_entry = new Gtkmm2ext::FocusEntry;
|
||||||
|
|
||||||
|
name_entry->set_name ("EditorTrackNameDisplay");
|
||||||
|
name_entry->signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_release), false);
|
||||||
|
name_entry->signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_button_press), false);
|
||||||
|
name_entry->signal_key_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_key_release));
|
||||||
|
name_entry->signal_activate().connect (sigc::mem_fun(*this, &TimeAxisView::name_entry_activated));
|
||||||
|
name_entry->signal_focus_in_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_in));
|
||||||
|
name_entry->signal_focus_out_event().connect (sigc::mem_fun (*this, &TimeAxisView::name_entry_focus_out));
|
||||||
|
Gtkmm2ext::set_size_request_to_display_given_text (*name_entry, N_("gTortnam"), 10, 10); // just represents a short name
|
||||||
|
|
||||||
|
name_entry->set_text (name_label.get_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
if (name_label.is_ancestor (name_hbox)) {
|
||||||
TimeAxisView::hide_name_label ()
|
|
||||||
{
|
|
||||||
if (name_packing & NameLabelPacked) {
|
|
||||||
name_hbox.remove (name_label);
|
name_hbox.remove (name_label);
|
||||||
name_packing = NamePackingBits (name_packing & ~NameLabelPacked);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
if (!name_entry->is_ancestor (name_hbox) && name_label.get_parent() == 0) {
|
||||||
TimeAxisView::hide_name_entry ()
|
name_hbox.pack_start (*name_entry, true, true);
|
||||||
{
|
name_hbox.show ();
|
||||||
if (name_packing & NameEntryPacked) {
|
name_entry->show ();
|
||||||
name_hbox.remove (name_entry);
|
|
||||||
name_packing = NamePackingBits (name_packing & ~NameEntryPacked);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +116,6 @@ class TimeAxisView : public virtual AxisView
|
|||||||
|
|
||||||
void idle_resize (uint32_t);
|
void idle_resize (uint32_t);
|
||||||
|
|
||||||
void hide_name_label ();
|
|
||||||
void hide_name_entry ();
|
|
||||||
void show_name_label ();
|
void show_name_label ();
|
||||||
void show_name_entry ();
|
void show_name_entry ();
|
||||||
|
|
||||||
@ -206,13 +204,24 @@ class TimeAxisView : public virtual AxisView
|
|||||||
Gtk::VBox controls_vbox;
|
Gtk::VBox controls_vbox;
|
||||||
Gtk::VBox time_axis_vbox;
|
Gtk::VBox time_axis_vbox;
|
||||||
Gtk::HBox name_hbox;
|
Gtk::HBox name_hbox;
|
||||||
Gtk::Frame name_frame;
|
Gtkmm2ext::FocusEntry* name_entry;
|
||||||
Gtkmm2ext::FocusEntry name_entry;
|
Gtk::Label name_label;
|
||||||
|
bool _name_editing;
|
||||||
uint32_t height; /* in canvas units */
|
uint32_t height; /* in canvas units */
|
||||||
|
|
||||||
std::string controls_base_unselected_name;
|
std::string controls_base_unselected_name;
|
||||||
std::string controls_base_selected_name;
|
std::string controls_base_selected_name;
|
||||||
|
Gtk::Menu* display_menu; /* The standard LHS Track control popup-menus */
|
||||||
|
TimeAxisView* parent;
|
||||||
|
ArdourCanvas::Group* selection_group;
|
||||||
|
std::list<GhostRegion*> ghosts;
|
||||||
|
std::list<SelectionRect*> free_selection_rects;
|
||||||
|
std::list<SelectionRect*> used_selection_rects;
|
||||||
|
bool _hidden;
|
||||||
|
bool in_destructor;
|
||||||
|
Gtk::Menu* _size_menu;
|
||||||
|
ArdourCanvas::Group* _canvas_display;
|
||||||
|
double _y_position;
|
||||||
|
PublicEditor& _editor;
|
||||||
|
|
||||||
virtual bool can_edit_name() const;
|
virtual bool can_edit_name() const;
|
||||||
|
|
||||||
@ -224,6 +233,9 @@ class TimeAxisView : public virtual AxisView
|
|||||||
bool name_entry_key_timed_out ();
|
bool name_entry_key_timed_out ();
|
||||||
guint32 last_name_entry_key_press_event;
|
guint32 last_name_entry_key_press_event;
|
||||||
|
|
||||||
|
void begin_name_edit (GdkEvent*);
|
||||||
|
void end_name_edit (bool push_focus);
|
||||||
|
|
||||||
/* derived classes can override these */
|
/* derived classes can override these */
|
||||||
|
|
||||||
virtual void name_entry_changed ();
|
virtual void name_entry_changed ();
|
||||||
@ -255,14 +267,6 @@ class TimeAxisView : public virtual AxisView
|
|||||||
*/
|
*/
|
||||||
virtual bool handle_display_menu_map_event (GdkEventAny * /*ev*/) { return false; }
|
virtual bool handle_display_menu_map_event (GdkEventAny * /*ev*/) { return false; }
|
||||||
|
|
||||||
/* The standard LHS Track control popup-menus */
|
|
||||||
|
|
||||||
Gtk::Menu *display_menu;
|
|
||||||
|
|
||||||
Gtk::Label name_label;
|
|
||||||
|
|
||||||
TimeAxisView* parent;
|
|
||||||
|
|
||||||
Children children;
|
Children children;
|
||||||
bool is_child (TimeAxisView*);
|
bool is_child (TimeAxisView*);
|
||||||
|
|
||||||
@ -271,32 +275,15 @@ class TimeAxisView : public virtual AxisView
|
|||||||
|
|
||||||
/* selection display */
|
/* selection display */
|
||||||
|
|
||||||
ArdourCanvas::Group *selection_group;
|
|
||||||
|
|
||||||
std::list<GhostRegion*> ghosts;
|
|
||||||
|
|
||||||
std::list<SelectionRect*> free_selection_rects;
|
|
||||||
std::list<SelectionRect*> used_selection_rects;
|
|
||||||
|
|
||||||
virtual void selection_click (GdkEventButton*);
|
virtual void selection_click (GdkEventButton*);
|
||||||
|
|
||||||
bool _hidden;
|
|
||||||
bool in_destructor;
|
|
||||||
NamePackingBits name_packing;
|
|
||||||
|
|
||||||
void color_handler ();
|
void color_handler ();
|
||||||
|
|
||||||
void conditionally_add_to_selection ();
|
void conditionally_add_to_selection ();
|
||||||
|
|
||||||
void build_size_menu ();
|
void build_size_menu ();
|
||||||
Gtk::Menu* _size_menu;
|
|
||||||
|
|
||||||
ArdourCanvas::Group* _canvas_display;
|
|
||||||
double _y_position;
|
|
||||||
PublicEditor& _editor;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ArdourCanvas::Group* _canvas_background;
|
ArdourCanvas::Group* _canvas_background;
|
||||||
Gtk::VBox* control_parent;
|
Gtk::VBox* control_parent;
|
||||||
int _order;
|
int _order;
|
||||||
@ -305,13 +292,13 @@ private:
|
|||||||
GdkCursor* _preresize_cursor;
|
GdkCursor* _preresize_cursor;
|
||||||
bool _have_preresize_cursor;
|
bool _have_preresize_cursor;
|
||||||
ArdourCanvas::Group* _ghost_group;
|
ArdourCanvas::Group* _ghost_group;
|
||||||
|
bool _ebox_release_can_act;
|
||||||
|
|
||||||
void compute_heights ();
|
|
||||||
static uint32_t button_height;
|
static uint32_t button_height;
|
||||||
static uint32_t extra_height;
|
static uint32_t extra_height;
|
||||||
|
|
||||||
static int const _max_order;
|
static int const _max_order;
|
||||||
|
|
||||||
|
void compute_heights ();
|
||||||
bool maybe_set_cursor (int y);
|
bool maybe_set_cursor (int y);
|
||||||
|
|
||||||
}; /* class TimeAxisView */
|
}; /* class TimeAxisView */
|
||||||
|
Loading…
Reference in New Issue
Block a user