20 |
#include "regionchooser.h" |
#include "regionchooser.h" |
21 |
#include <gdkmm/cursor.h> |
#include <gdkmm/cursor.h> |
22 |
#include <gtkmm/stock.h> |
#include <gtkmm/stock.h> |
23 |
|
#include <gtkmm/spinbutton.h> |
24 |
|
#include <gtkmm/dialog.h> |
25 |
#include <libintl.h> |
#include <libintl.h> |
26 |
|
#include <math.h> |
27 |
|
|
28 |
#define _(String) gettext(String) |
#define _(String) gettext(String) |
29 |
|
|
85 |
|
|
86 |
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | |
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | |
87 |
Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK); |
Gdk::POINTER_MOTION_MASK | Gdk::POINTER_MOTION_HINT_MASK); |
88 |
|
|
89 |
|
dimensionManager.articulation_changed_signal.connect( |
90 |
|
sigc::mem_fun(*this, &RegionChooser::on_dimension_manager_changed) |
91 |
|
); |
92 |
} |
} |
93 |
|
|
94 |
RegionChooser::~RegionChooser() |
RegionChooser::~RegionChooser() |
425 |
|
|
426 |
void RegionChooser::show_region_properties() |
void RegionChooser::show_region_properties() |
427 |
{ |
{ |
428 |
|
if (!region) return; |
429 |
|
Gtk::Dialog dialog("Region Properties", true /*modal*/); |
430 |
|
// add "Keygroup" checkbox |
431 |
|
Gtk::CheckButton checkBoxKeygroup("Member of a Keygroup (Exclusive Group)"); |
432 |
|
checkBoxKeygroup.set_active(region->KeyGroup); |
433 |
|
dialog.get_vbox()->pack_start(checkBoxKeygroup); |
434 |
|
checkBoxKeygroup.show(); |
435 |
|
// add "Keygroup" spinbox |
436 |
|
Gtk::Adjustment adjustment(1, 1, pow(2,32)); |
437 |
|
Gtk::SpinButton spinBox(adjustment); |
438 |
|
if (region->KeyGroup) spinBox.set_value(region->KeyGroup); |
439 |
|
dialog.get_vbox()->pack_start(spinBox); |
440 |
|
spinBox.show(); |
441 |
|
// add OK and CANCEL buttons to the dialog |
442 |
|
dialog.add_button(Gtk::Stock::OK, 0); |
443 |
|
dialog.add_button(Gtk::Stock::CANCEL, 1); |
444 |
|
dialog.show_all_children(); |
445 |
|
if (!dialog.run()) { // OK selected ... |
446 |
|
region->KeyGroup = |
447 |
|
(checkBoxKeygroup.get_active()) ? spinBox.get_value_as_int() : 0; |
448 |
|
} |
449 |
} |
} |
450 |
|
|
451 |
void RegionChooser::add_region() |
void RegionChooser::add_region() |
477 |
if (!region) return; |
if (!region) return; |
478 |
dimensionManager.show(region); |
dimensionManager.show(region); |
479 |
} |
} |
480 |
|
|
481 |
|
void RegionChooser::on_dimension_manager_changed() { |
482 |
|
sel_changed_signal.emit(); |
483 |
|
} |