return;
}
- if (win->HasFlag(wxSUNKEN_BORDER))
+ if (win->HasFlag(wxSUNKEN_BORDER) || win->HasFlag(wxBORDER_THEME))
{
gtk_draw_shadow( widget->style,
widget->window,
// make it extern because wxStaticText needs to disconnect this one
extern "C" {
-void wxgtk_window_size_request_callback(GtkWidget *widget,
+void wxgtk_window_size_request_callback(GtkWidget *WXUNUSED(widget),
GtkRequisition *requisition,
wxWindow *win)
{
extern "C" {
static
-void wxgtk_combo_size_request_callback(GtkWidget *widget,
+void wxgtk_combo_size_request_callback(GtkWidget *WXUNUSED(widget),
GtkRequisition *requisition,
wxComboBox *win)
{
//-----------------------------------------------------------------------------
extern "C" {
-static int gtk_window_expose_callback( GtkWidget *widget,
+static int gtk_window_expose_callback( GtkWidget *WXUNUSED(widget),
GdkEventExpose *gdk_event,
wxWindow *win )
{
event.m_rawCode = (wxUint32) gdk_event->keyval;
event.m_rawFlags = 0;
#if wxUSE_UNICODE
- event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval);
+#if 0
+ // this is not gtk1.x
+ event.m_uniChar = gdk_keyval_to_unicode(gdk_event->keyval);
+#endif
#endif
wxGetMousePosition( &x, &y );
win->ScreenToClient( &x, &y );
bool ret = false;
bool return_after_IM = false;
- if( wxTranslateGTKKeyEventToWx(event, win, gdk_event) == false )
+ if ( wxTranslateGTKKeyEventToWx(event, win, gdk_event) )
{
// Emit KEY_DOWN event
- ret = win->GetEventHandler()->ProcessEvent( event );
+ ret = win->HandleWindowEvent( event );
}
else
{
if (parent)
{
event.SetEventType( wxEVT_CHAR_HOOK );
- ret = parent->GetEventHandler()->ProcessEvent( event );
+ ret = parent->HandleWindowEvent( event );
}
if (!ret)
{
event.SetEventType(wxEVT_CHAR);
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
return true;
if (command != -1)
{
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
- ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
+ ret = ancestor->HandleWindowEvent( command_event );
break;
}
if (ancestor->IsTopLevel())
if (parent)
{
event.SetEventType( wxEVT_CHAR_HOOK );
- ret = parent->GetEventHandler()->ProcessEvent( event );
+ ret = parent->HandleWindowEvent( event );
}
if (!ret)
{
event.SetEventType(wxEVT_CHAR);
- ret = win->GetEventHandler()->ProcessEvent( event );
+ ret = win->HandleWindowEvent( event );
}
}
}
// CTRL-TAB changes the (parent) window, i.e. switch notebook page
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
new_event.SetCurrentFocus( win );
- ret = win->GetParent()->GetEventHandler()->ProcessEvent( new_event );
+ ret = win->GetParent()->HandleWindowEvent( new_event );
}
// generate wxID_CANCEL if <esc> has been pressed (typically in dialogs)
{
wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
eventClick.SetEventObject(btnCancel);
- ret = btnCancel->GetEventHandler()->ProcessEvent(eventClick);
+ ret = btnCancel->HandleWindowEvent(eventClick);
}
}
return FALSE;
}
- if ( !win->GetEventHandler()->ProcessEvent( event ) )
+ if ( !win->HandleWindowEvent( event ) )
return FALSE;
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
g_lastButtonNumber = gdk_event->button;
- if (win->m_wxwindow && (g_focusWindow != win) && win->AcceptsFocus())
+ if (win->m_wxwindow && (g_focusWindow != win) && win->IsFocusable())
{
gtk_widget_grab_focus( win->m_wxwindow );
/*
}
g_lastMouseEvent = (GdkEvent*) gdk_event;
-
+
wxMouseEvent event( event_type );
InitMouseEvent( win, event, gdk_event );
}
}
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->HandleWindowEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
g_lastMouseEvent = NULL;
win->GetId(),
win->ClientToScreen(event.GetPosition()));
evtCtx.SetEventObject(win);
- return win->GetEventHandler()->ProcessEvent(evtCtx);
+ return win->HandleWindowEvent(evtCtx);
}
return FALSE;
}
g_lastMouseEvent = (GdkEvent*) gdk_event;
-
+
wxMouseEvent event( event_type );
InitMouseEvent( win, event, gdk_event );
if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->HandleWindowEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
return TRUE;
: wxEVT_LEAVE_WINDOW);
InitMouseEvent(win, eventM, gdk_event);
eventM.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(eventM);
+ win->HandleWindowEvent(eventM);
}
}
else // no capture
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
}
- bool ret = win->GetEventHandler()->ProcessEvent( event );
+ bool ret = win->HandleWindowEvent( event );
g_lastMouseEvent = NULL;
if ( ret )
// Notify the parent keeping track of focus for the kbd navigation
// purposes that we got it.
wxChildFocusEvent eventChildFocus(win);
- (void)win->GetEventHandler()->ProcessEvent(eventChildFocus);
+ (void)win->HandleWindowEvent(eventChildFocus);
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
eventFocus.SetEventObject(win);
- return win->GetEventHandler()->ProcessEvent(eventFocus);
+ return win->HandleWindowEvent(eventFocus);
}
extern "C" {
//-----------------------------------------------------------------------------
extern "C" {
-static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win )
+static gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget),
+ GdkEventFocus *WXUNUSED(gdk_event),
+ wxWindowGTK *win )
{
DEBUG_MAIN_THREAD
// process it too as otherwise bad things happen, especially in GTK2
// where the text control simply aborts the program if it doesn't get
// the matching focus out event
- (void)win->GetEventHandler()->ProcessEvent( event );
+ (void)win->HandleWindowEvent( event );
}
return FALSE;
event.m_x = x + pt.x;
event.m_y = y + pt.y;
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->HandleWindowEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
return TRUE;
event.m_x = x + pt.x;
event.m_y = y + pt.y;
- if (win->GetEventHandler()->ProcessEvent( event ))
+ if (win->HandleWindowEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
return TRUE;
wxScrollWinEvent event( command, value, wxVERTICAL );
event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
wxScrollWinEvent event( command, value, wxHORIZONTAL );
event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
wxScrollWinEvent event( command, value, dir );
event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
win->m_isScrolling = false;
extern "C" {
static gint
-gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
+gtk_window_realized_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
{
DEBUG_MAIN_THREAD
wxWindowCreateEvent event( win );
event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
return FALSE;
}
{
wxSizeEvent event( win->GetSize(), win->GetId() );
event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
}
extern "C" {
static
void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
- GtkAllocation* WXUNUSED_UNLESS_XIM(alloc),
+ GtkAllocation* WXUNUSED(alloc),
wxWindowGTK* WXUNUSED_UNLESS_XIM(win) )
{
if (g_isIdle)
long style,
const wxString &name )
{
+ // Get default border
+ wxBorder border = GetBorder(style);
+ style &= ~wxBORDER_MASK;
+ style |= border;
+
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
{
gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_OUT );
}
- else if (HasFlag(wxSUNKEN_BORDER))
+ else if (HasFlag(wxSUNKEN_BORDER) || HasFlag(wxBORDER_THEME))
{
gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_IN );
}
{
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
+ HandleWindowEvent( event );
}
m_resizing = false;
}
}
- if (wxUpdateUIEvent::CanUpdate(this))
+ if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
int dh = 0;
#ifndef __WXUNIVERSAL__
- if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
+ if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER) || HasFlag(wxBORDER_THEME))
{
/* when using GTK 1.2 we set the shadow border size to 2 */
dw += 2 * 2;
int dh = 0;
#ifndef __WXUNIVERSAL__
- if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER))
+ if (HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER) || HasFlag(wxBORDER_THEME))
{
/* when using GTK 1.2 we set the shadow border size to 2 */
dw += 2 * 2;
wxShowEvent eventShow(GetId(), show);
eventShow.SetEventObject(this);
- GetEventHandler()->ProcessEvent(eventShow);
+ HandleWindowEvent(eventShow);
return true;
}
}
}
}
- else
-
- // if (!m_clearRegion.IsEmpty()) // Always send an erase event under GTK 1.2
+ else // Always send an erase event under GTK 1.2
{
wxWindowDC dc( (wxWindow*)this );
- if (m_clearRegion.IsEmpty())
- dc.SetClippingRegion( m_updateRegion );
- else
- dc.SetClippingRegion( m_clearRegion );
+ dc.SetDeviceClippingRegion( m_clearRegion.IsEmpty() ? m_updateRegion
+ : m_clearRegion );
wxEraseEvent erase_event( GetId(), &dc );
erase_event.SetEventObject( this );
- if (!GetEventHandler()->ProcessEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM)
+ if (!HandleWindowEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM)
{
if (!g_eraseGC)
{
wxNcPaintEvent nc_paint_event( GetId() );
nc_paint_event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( nc_paint_event );
+ HandleWindowEvent( nc_paint_event );
wxPaintEvent paint_event( GetId() );
paint_event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( paint_event );
+ HandleWindowEvent( paint_event );
m_clipPaintRegion = false;
if (g_eraseGC)
gdk_gc_unref( g_eraseGC );
}
+
+GdkWindow* wxWindowGTK::GTKGetDrawingWindow() const
+{
+ GdkWindow* window = NULL;
+ if (m_wxwindow)
+ window = GTK_PIZZA(m_wxwindow)->bin_window;
+ return window;
+}