void xywnd_motion(gdouble x, gdouble y, guint state, void* data)
{
if(reinterpret_cast<XYWnd*>(data)->chaseMouseMotion(static_cast<int>(x), static_cast<int>(y)))
void xywnd_motion(gdouble x, gdouble y, guint state, void* data)
{
if(reinterpret_cast<XYWnd*>(data)->chaseMouseMotion(static_cast<int>(x), static_cast<int>(y)))
g_signal_connect(G_OBJECT(m_gl_widget), "button_press_event", G_CALLBACK(xywnd_button_press), this);
g_signal_connect(G_OBJECT(m_gl_widget), "button_release_event", G_CALLBACK(xywnd_button_release), this);
g_signal_connect(G_OBJECT(m_gl_widget), "button_press_event", G_CALLBACK(xywnd_button_press), this);
g_signal_connect(G_OBJECT(m_gl_widget), "button_release_event", G_CALLBACK(xywnd_button_release), this);
g_signal_connect(G_OBJECT(m_gl_widget), "motion_notify_event", G_CALLBACK(DeferredMotion::gtk_motion), &m_deferred_motion);
g_signal_connect(G_OBJECT(m_gl_widget), "scroll_event", G_CALLBACK(xywnd_wheel_scroll), this);
g_signal_connect(G_OBJECT(m_gl_widget), "motion_notify_event", G_CALLBACK(DeferredMotion::gtk_motion), &m_deferred_motion);
g_signal_connect(G_OBJECT(m_gl_widget), "scroll_event", G_CALLBACK(xywnd_wheel_scroll), this);
// draw coordinate text if needed
if ( g_xywindow_globals_private.show_coordinates) {
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
// draw coordinate text if needed
if ( g_xywindow_globals_private.show_coordinates) {
glColor4fv(vector4_to_array(Vector4(g_xywindow_globals.color_gridtext, 1.0f)));
- // why does this not work on windows:
- // float offx = m_vOrigin[nDim2] + h - (1 + GlobalOpenGL().m_fontAscent) / m_fScale;
- float offx = m_vOrigin[nDim2] + h - 13 / m_fScale;
- float offy = m_vOrigin[nDim1] - w + 1 / m_fScale;
+ float offx = m_vOrigin[nDim2] + h - (4 + GlobalOpenGL().m_font->getPixelAscent()) / m_fScale;
+ float offy = m_vOrigin[nDim1] - w + 4 / m_fScale;
- g_pParentWnd->GetXYWnd()->PositionView(position);
- g_pParentWnd->GetXZWnd()->PositionView(position);
- g_pParentWnd->GetYZWnd()->PositionView(position);
+ if(g_pParentWnd->GetXYWnd())
+ g_pParentWnd->GetXYWnd()->PositionView(position);
+ if(g_pParentWnd->GetXZWnd())
+ g_pParentWnd->GetXZWnd()->PositionView(position);
+ if(g_pParentWnd->GetYZWnd())
+ g_pParentWnd->GetYZWnd()->PositionView(position);
GlobalCommands_insert("NextView", FreeCaller<XY_Next>(), Accelerator(GDK_Tab, (GdkModifierType)GDK_CONTROL_MASK));
GlobalCommands_insert("ZoomIn", FreeCaller<XY_ZoomIn>(), Accelerator(GDK_Delete));
GlobalCommands_insert("ZoomOut", FreeCaller<XY_ZoomOut>(), Accelerator(GDK_Insert));
GlobalCommands_insert("NextView", FreeCaller<XY_Next>(), Accelerator(GDK_Tab, (GdkModifierType)GDK_CONTROL_MASK));
GlobalCommands_insert("ZoomIn", FreeCaller<XY_ZoomIn>(), Accelerator(GDK_Delete));
GlobalCommands_insert("ZoomOut", FreeCaller<XY_ZoomOut>(), Accelerator(GDK_Insert));
- GlobalCommands_insert("ViewTop", FreeCaller<XY_Top>());
- GlobalCommands_insert("ViewSide", FreeCaller<XY_Side>());
- GlobalCommands_insert("ViewFront", FreeCaller<XY_Front>());
+ GlobalCommands_insert("ViewTop", FreeCaller<XY_Top>(), Accelerator(GDK_KP_Home));
+ GlobalCommands_insert("ViewSide", FreeCaller<XY_Side>(), Accelerator(GDK_KP_Page_Down));
+ GlobalCommands_insert("ViewFront", FreeCaller<XY_Front>(), Accelerator(GDK_KP_End));
GlobalCommands_insert("Zoom100", FreeCaller<XY_Zoom100>());
GlobalCommands_insert("CenterXYView", FreeCaller<XY_Focus>(), Accelerator(GDK_Tab, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
GlobalCommands_insert("Zoom100", FreeCaller<XY_Zoom100>());
GlobalCommands_insert("CenterXYView", FreeCaller<XY_Focus>(), Accelerator(GDK_Tab, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));