154 |
keyboard_key_released_signal.connect( |
keyboard_key_released_signal.connect( |
155 |
sigc::mem_fun(*this, &RegionChooser::on_note_off_event) |
sigc::mem_fun(*this, &RegionChooser::on_note_off_event) |
156 |
); |
); |
157 |
|
set_tooltip_text(_("Right click here for adding new region. Use mouse pointer for moving (dragging) or resizing existing regions (by pointing at region's boundary). Right click on an existing region for more actions.")); |
158 |
} |
} |
159 |
|
|
160 |
RegionChooser::~RegionChooser() |
RegionChooser::~RegionChooser() |
330 |
cr->line_to(x + 0.5, h1 - 1); |
cr->line_to(x + 0.5, h1 - 1); |
331 |
cr->stroke(); |
cr->stroke(); |
332 |
} |
} |
333 |
|
|
334 |
|
// if there is no region yet, show the user some hint text that he may |
335 |
|
// right click on this area to create a new region |
336 |
|
if (!regions.first()) { |
337 |
|
Glib::RefPtr<Pango::Context> context = get_pango_context(); |
338 |
|
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create(context); |
339 |
|
layout->set_alignment(Pango::ALIGN_CENTER); |
340 |
|
layout->set_text(Glib::ustring("*** ") + _("Right click here to create a region.") + " ***"); |
341 |
|
layout->set_width(get_width() * Pango::SCALE); |
342 |
|
Gdk::Cairo::set_source_rgba(cr, red); |
343 |
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 16) || GTKMM_MAJOR_VERSION < 2 |
344 |
|
pango_cairo_show_layout(cr->cobj(), layout->gobj()); |
345 |
|
#else |
346 |
|
layout->show_in_cairo_context(cr); |
347 |
|
#endif |
348 |
|
} |
349 |
} |
} |
350 |
|
|
351 |
bool RegionChooser::is_black_key(int key) { |
bool RegionChooser::is_black_key(int key) { |