projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix #1637 (needs merging to 2.0.1 branch); remove debug printf
[ardour.git]
/
gtk2_ardour
/
panner2d.cc
diff --git
a/gtk2_ardour/panner2d.cc
b/gtk2_ardour/panner2d.cc
index 74da97cdec6942b1e0df7b4daf1792fb953ce108..34f367b25b1ba978f8c8c996142bcc8b66eb7ffe 100644
(file)
--- a/
gtk2_ardour/panner2d.cc
+++ b/
gtk2_ardour/panner2d.cc
@@
-15,13
+15,15
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cmath>
#include <climits>
#include <string.h>
*/
#include <cmath>
#include <climits>
#include <string.h>
+#include <gtkmm/menu.h>
+#include <gtkmm/checkmenuitem.h>
+
#include <pbd/error.h>
#include <ardour/panner.h>
#include <gtkmm2ext/gtk_ui.h>
#include <pbd/error.h>
#include <ardour/panner.h>
#include <gtkmm2ext/gtk_ui.h>
@@
-36,6
+38,7
@@
using namespace std;
using namespace Gtk;
using namespace sigc;
using namespace ARDOUR;
using namespace Gtk;
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
Panner2d::Target::Target (float xa, float ya, const char *txt)
: x (xa), y (ya), text (txt ? strdup (txt) : 0)
Panner2d::Target::Target (float xa, float ya, const char *txt)
: x (xa), y (ya), text (txt ? strdup (txt) : 0)
@@
-54,8
+57,8
@@
Panner2d::Target::~Target ()
}
}
}
}
-Panner2d::Panner2d (Panner& p, int32_t
w, int32_t
h)
- : panner (p), width (
w
), height (h)
+Panner2d::Panner2d (Panner& p, int32_t h)
+ : panner (p), width (
0
), height (h)
{
context_menu = 0;
bypass_menu_item = 0;
{
context_menu = 0;
bypass_menu_item = 0;
@@
-124,7
+127,7
@@
Panner2d::reset (uint32_t n_inputs)
}
void
}
void
-Panner2d::on_size_allocate (Gtk::Allocation alloc)
+Panner2d::on_size_allocate (Gtk::Allocation
&
alloc)
{
width = alloc.get_width();
height = alloc.get_height();
{
width = alloc.get_width();
height = alloc.get_height();
@@
-425,6
+428,11
@@
Panner2d::on_expose_event (GdkEventExpose *event)
gint x, y;
float fx, fy;
gint x, y;
float fx, fy;
+ if (layout == 0) {
+ layout = create_pango_layout ("");
+ layout->set_font_description (get_style()->get_font());
+ }
+
/* redraw the background */
get_window()->draw_rectangle (get_style()->get_bg_gc(get_state()),
/* redraw the background */
get_window()->draw_rectangle (get_style()->get_bg_gc(get_state()),
@@
-455,11
+463,10
@@
Panner2d::on_expose_event (GdkEventExpose *event)
x, y,
8, 8,
0, 360 * 64);
x, y,
8, 8,
0, 360 * 64);
- get_window().draw_text (get_style()->get_font(),
- get_style()->get_fg_gc(Gtk::STATE_NORMAL),
- x + 6, y + 6,
- puck->text,
- puck->textlen);
+
+ layout->set_text (puck->text);
+
+ get_window()->draw_layout (get_style()->get_fg_gc (STATE_NORMAL), x+6, y+6, layout);
}
}
}
}
@@
-585,7
+592,7
@@
Panner2d::show_context_menu ()
}
bypass_menu_item->set_active (panner.bypassed());
}
bypass_menu_item->set_active (panner.bypassed());
- context_menu->popup (1,
0
);
+ context_menu->popup (1,
gtk_get_current_event_time()
);
}
void
}
void