1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2014 Andreas Persson |
* Copyright (C) 2006-2015 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
25 |
#include <cmath> |
#include <cmath> |
26 |
|
|
27 |
#include <glibmm/convert.h> |
#include <glibmm/convert.h> |
28 |
|
#include <gtkmm/box.h> |
29 |
#include <gtkmm/adjustment.h> |
#include <gtkmm/adjustment.h> |
30 |
#include <gtkmm/alignment.h> |
#include <gtkmm/alignment.h> |
|
#include <gtkmm/box.h> |
|
31 |
#include <gtkmm/checkbutton.h> |
#include <gtkmm/checkbutton.h> |
32 |
#include <gtkmm/comboboxtext.h> |
#include <gtkmm/comboboxtext.h> |
33 |
#include <gtkmm/frame.h> |
#include <gtkmm/frame.h> |
68 |
sigc::signal<void> sig_changed; |
sigc::signal<void> sig_changed; |
69 |
}; |
}; |
70 |
|
|
71 |
|
class ReadOnlyLabelWidget : public LabelWidget { |
72 |
|
public: |
73 |
|
Gtk::Label text; |
74 |
|
|
75 |
|
ReadOnlyLabelWidget(const char* leftHandText); |
76 |
|
ReadOnlyLabelWidget(const char* leftHandText, const char* rightHandText); |
77 |
|
}; |
78 |
|
|
79 |
class NumEntry : public LabelWidget { |
class NumEntry : public LabelWidget { |
80 |
protected: |
protected: |
81 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
87 |
Gtk::SpinButton spinbutton; |
Gtk::SpinButton spinbutton; |
88 |
Gtk::HBox box; |
Gtk::HBox box; |
89 |
|
|
90 |
int round_to_int(double x) { |
static int round_to_int(double x) { |
91 |
return int(x < 0.0 ? x - 0.5 : x + 0.5); |
return int(x < 0.0 ? x - 0.5 : x + 0.5); |
92 |
} |
} |
93 |
public: |
public: |
268 |
ChoiceEntryLeverageCtrl(const char* labelText); |
ChoiceEntryLeverageCtrl(const char* labelText); |
269 |
gig::leverage_ctrl_t get_value() const { return value; } |
gig::leverage_ctrl_t get_value() const { return value; } |
270 |
void set_value(gig::leverage_ctrl_t value); |
void set_value(gig::leverage_ctrl_t value); |
271 |
|
void set_tip(const Glib::ustring& tip_text) { |
272 |
|
combobox.set_tooltip_text(tip_text); |
273 |
|
} |
274 |
}; |
}; |
275 |
|
|
276 |
|
|
449 |
|
|
450 |
void get_key_range(NoteEntry* eKeyRangeLow, |
void get_key_range(NoteEntry* eKeyRangeLow, |
451 |
NoteEntry* eKeyRangeHigh, |
NoteEntry* eKeyRangeHigh, |
452 |
gig::range_t M::* range) { |
gig::range_t M::* range) const { |
453 |
eKeyRangeLow->set_value((m->*range).low); |
eKeyRangeLow->set_value((m->*range).low); |
454 |
eKeyRangeHigh->set_value((m->*range).high); |
eKeyRangeHigh->set_value((m->*range).high); |
455 |
} |
} |