if (g_isIdle)
wxapp_install_idle_handler();
+#ifdef __WXGTK20__
+ // This callback gets called in drawing-idle time under
+ // GTK 2.0, so we don't need to defer anything to idle
+ // time anymore.
+
+ GtkPizza *pizza = GTK_PIZZA( widget );
+ if (gdk_event->window != pizza->bin_window) return FALSE;
+
#if 0
if (win->GetName())
{
}
#endif
-#ifdef __WXGTK20__
- // This callback gets called in drawing-idle time under
- // GTK 2.0, so we don't need to defer anything to idle
- // time anymore.
-
win->GetUpdateRegion() = wxRegion( gdk_event->region );
win->GtkSendPaintEvents();
- // Draw window less widgets
+ // Let parent window draw window less widgets
(* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, gdk_event);
#else
// This gets called immediately after an expose event
// win->GtkUpdate();
#endif
-
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
if ( !ret &&
(gdk_event->keyval == GDK_Escape) )
{
- wxCommandEvent new_event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
- new_event.SetEventObject( win );
- ret = win->GetEventHandler()->ProcessEvent( new_event );
+ // however only do it if we have a Cancel button in the dialog,
+ // otherwise the user code may get confused by the events from a
+ // non-existing button and, worse, a wxButton might get button event
+ // from another button which is not really expected
+ wxWindow *winForCancel = win,
+ *btnCancel = NULL;
+ while ( winForCancel )
+ {
+ btnCancel = winForCancel->FindWindow(wxID_CANCEL);
+ if ( btnCancel )
+ {
+ // found a cancel button
+ break;
+ }
+
+ if ( winForCancel->IsTopLevel() )
+ {
+ // no need to look further
+ break;
+ }
+
+ // maybe our parent has a cancel button?
+ winForCancel = winForCancel->GetParent();
+ }
+
+ if ( btnCancel )
+ {
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ event.SetEventObject(btnCancel);
+ ret = btnCancel->GetEventHandler()->ProcessEvent(event);
+ }
}
// Doesn't work.
win->m_oldVerticalPos = adjust->value;
+#ifndef __WXGTK20__
GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(win->m_widget);
+#endif
wxEventType command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->vscrollbar));
int value = (int)(adjust->value+0.5);
float diff = adjust->value - win->m_oldHorizontalPos;
if (fabs(diff) < 0.2) return;
+#ifndef __WXGTK20__
GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(win->m_widget);
+#endif
wxEventType command = GtkScrollWinTypeToWx(GET_SCROLL_TYPE(sw->hscrollbar));
win->m_oldHorizontalPos = adjust->value;
PangoLayout *layout = pango_layout_new(context);
pango_layout_set_font_description(layout, desc);
{
+#if wxUSE_UNICODE
const wxCharBuffer data = wxConvUTF8.cWC2MB( string );
pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
+#else
+ const wxWCharBuffer wdata = wxConvLocal.cMB2WC( string );
+ const wxCharBuffer data = wxConvUTF8.cWC2MB( wdata );
+ pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
+#endif
}
PangoLayoutLine *line = (PangoLayoutLine *)pango_layout_get_lines(layout)->data;
GetClientSize( &cw, &ch );
m_clearRegion.Intersect( 0, 0, cw, ch );
}
+#endif
+
m_clipPaintRegion = TRUE;
gtk_pizza_scroll( GTK_PIZZA(m_wxwindow), -dx, -dy );
m_clipPaintRegion = FALSE;
-#else
-
- gdk_window_scroll( GTK_PIZZA(m_wxwindow)->bin_window, dx, dy );
-
- GTK_PIZZA(m_wxwindow)->xoffset += dx;
- GTK_PIZZA(m_wxwindow)->yoffset += dy;
-
-#endif
-
}