#include "gdk/gdkkeysyms.h"
#include "wx/gtk/win_gtk.h"
+#if (GTK_MINOR_VERSION == 0)
+#include "gdk/gdkx.h"
+#endif
+
//-----------------------------------------------------------------------------
// documentation on internals
//-----------------------------------------------------------------------------
// key event conversion routines
//-----------------------------------------------------------------------------
+#if (GTK_MINOR_VERSION == 0)
+static guint
+gdk_keyval_to_upper (guint keyval)
+{
+ if (keyval)
+ {
+ KeySym lower_val = 0;
+ KeySym upper_val = 0;
+
+ XConvertCase (keyval, &lower_val, &upper_val);
+ return upper_val;
+ }
+ return 0;
+}
+#endif
+
static long map_to_unmodified_wx_keysym( KeySym keysym )
{
guint key_code = 0;
case GDK_KP_Down: key_code = WXK_NUMPAD_DOWN; break;
case GDK_KP_Prior: key_code = WXK_NUMPAD_PRIOR; break;
// case GDK_KP_Page_Up: key_code = WXK_NUMPAD_PAGEUP; break;
- case GDK_KP_Next: key_code = WXK_NUMPAD_PRIOR; break;
+ case GDK_KP_Next: key_code = WXK_NUMPAD_NEXT; break;
// case GDK_KP_Page_Down: key_code = WXK_NUMPAD_PAGEDOWN; break;
case GDK_KP_End: key_code = WXK_NUMPAD_END; break;
case GDK_KP_Begin: key_code = WXK_NUMPAD_BEGIN; break;
case GDK_KP_Down: key_code = WXK_DOWN; break;
case GDK_KP_Prior: key_code = WXK_PRIOR; break;
// case GDK_KP_Page_Up: key_code = WXK_PAGEUP; break;
- case GDK_KP_Next: key_code = WXK_PRIOR; break;
+ case GDK_KP_Next: key_code = WXK_NEXT; break;
// case GDK_KP_Page_Down: key_code = WXK_PAGEDOWN; break;
case GDK_KP_End: key_code = WXK_END; break;
case GDK_KP_Begin: key_code = WXK_HOME; break;
if (scroll_window->hscrollbar_visible)
{
dh += 15; /* dh += hscrollbar->allocation.height; */
- dw += scroll_class->scrollbar_spacing;
+ dh += scroll_class->scrollbar_spacing;
}
}
printf( "ControlUp.\n" );
printf( "\n" );
*/
-
int x = 0;
int y = 0;
GdkModifierType state;
}
}
- // win is a control: tab can be propagated up
+ /* win is a control: tab can be propagated up */
if ( (!ret) &&
((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab)) &&
(win->HasFlag(wxTE_PROCESS_TAB) == 0))
ret = win->GetEventHandler()->ProcessEvent( new_event );
}
+ /* generate wxID_CANCEL if <esc> has been pressed (typically in dialogs) */
if ( (!ret) &&
(gdk_event->keyval == GDK_Escape) )
{
new_event.SetEventObject( win );
ret = win->GetEventHandler()->ProcessEvent( new_event );
}
+
+#if (GTK_MINOR_VERSION > 0)
+ /* pressing F10 will activate the menu bar of the top frame */
+ if ( (!ret) &&
+ (gdk_event->keyval == GDK_F10) )
+ {
+ wxWindow *ancestor = win;
+ while (ancestor)
+ {
+ if (wxIsKindOf(ancestor,wxFrame))
+ {
+ wxFrame *frame = (wxFrame*) ancestor;
+ wxMenuBar *menubar = frame->GetMenuBar();
+ if (menubar)
+ {
+ wxNode *node = menubar->GetMenus().First();
+ if (node)
+ {
+ wxMenu *firstMenu = (wxMenu*) node->Data();
+ // doesn't work correctly
+ // gtk_menu_item_select( GTK_MENU_ITEM(firstMenu->m_owner) );
+ // ret = TRUE;
+ break;
+ }
+ }
+ }
+ ancestor = ancestor->GetParent();
+ }
+ }
+#endif
/*
Damn, I forgot why this didn't work, but it didn't work.
gdk_window_set_cursor( widget->window, win->GetCursor().GetCursor() );
wxMouseEvent event( wxEVT_ENTER_WINDOW );
+#if (GTK_MINOR_VERSION > 0)
event.SetTimestamp( gdk_event->time );
+#endif
event.SetEventObject( win );
int x = 0;
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
wxMouseEvent event( wxEVT_LEAVE_WINDOW );
+#if (GTK_MINOR_VERSION > 0)
event.SetTimestamp( gdk_event->time );
+#endif
event.SetEventObject( win );
int x = 0;
win->SetForegroundColour( win->GetForegroundColour() );
win->SetCursor( win->GetCursor() );
+
+ wxWindowCreateEvent event( win );
+ event.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( event );
return FALSE;
}
int border = 0;
- if (GTK_WIDGET_HAS_DEFAULT(m_widget))
+ if (GTK_WIDGET_CAN_DEFAULT(m_widget))
{
/* the default button has a border around it */
border = 5;
if (scroll_window->hscrollbar_visible)
{
dh += 15; /* dh += hscrollbar->allocation.height; */
- dw += scroll_class->scrollbar_spacing;
+ dh += scroll_class->scrollbar_spacing;
}
}