(gcombo->button, &entry_req );
requisition->width = w - entry_req.width;
- requisition->height = entry_req.height+4; // TODO: why +4?
+ requisition->height = entry_req.height;
}
}
// "event" of m_wxwindow
//-----------------------------------------------------------------------------
+#ifndef __WXGTK20__
+
// GTK thinks it is clever and filters out a certain amount of "unneeded"
// expose events. We need them, of course, so we override the main event
// procedure in GtkWidget by giving our own handler for all system events.
}
}
+#endif // !GTK+ 2
+
//-----------------------------------------------------------------------------
// "draw" of m_wxwindow
//-----------------------------------------------------------------------------
void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect )
{
- if (!m_widget) return;
- if (!m_widget->window) return;
+ if (!m_widget)
+ return;
+ if (!m_widget->window)
+ return;
#ifndef __WXGTK20__
if (g_isIdle)
wxapp_install_idle_handler();
- wxRect myRect(0,0,0,0);
+ wxRect myRect;
if (m_wxwindow && rect)
{
myRect.SetSize(wxSize( m_wxwindow->allocation.width,
m_wxwindow->allocation.height));
- myRect.Intersect(*rect);
- if (!myRect.width || !myRect.height)
+ if ( myRect.Intersect(*rect).IsEmpty() )
+ {
// nothing to do, rectangle is empty
return;
+ }
+
rect = &myRect;
}
+ // schedule the area for later updating in GtkUpdate()
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
if (rect)
{
- // Schedule for later Updating in ::Update() or ::OnInternalIdle().
m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height );
}
else
{
- // Schedule for later Updating in ::Update() or ::OnInternalIdle().
m_clearRegion.Clear();
m_clearRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height );
}
{
if (m_wxwindow)
{
- // Schedule for later Updating in ::Update() or ::OnInternalIdle().
m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
}
else
{
if (m_wxwindow)
{
- // Schedule for later Updating in ::Update() or ::OnInternalIdle().
m_updateRegion.Clear();
m_updateRegion.Union( 0, 0, m_wxwindow->allocation.width, m_wxwindow->allocation.height );
}
gtk_widget_draw( m_widget, (GdkRectangle*) NULL );
}
}
-#else
+#else // GTK+ 2
if (m_wxwindow)
{
+ GdkRectangle gdk_rect,
+ *p;
if (rect)
{
- GdkRectangle gdk_rect;
gdk_rect.x = rect->x;
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
- gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, &gdk_rect, TRUE );
+ p = &gdk_rect;
}
- else
+ else // invalidate everything
{
- gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, NULL, TRUE );
+ p = NULL;
}
+
+ gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, p, TRUE );
}
-#endif
+#endif // GTK+ 1/2
}
void wxWindowGTK::Update()
if (!m_updateRegion.IsEmpty())
GtkSendPaintEvents();
#endif
+
+ // for consistency with other platforms (and also because it's convenient
+ // to be able to update an entire TLW by calling Update() only once), we
+ // should also update all our children here
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ node->GetData()->GtkUpdate();
+ }
}
void wxWindowGTK::GtkSendPaintEvents()
{
if (m_wxwindow)
gtk_widget_modify_style(m_wxwindow, style);
- gtk_widget_modify_style(m_widget, style);
+ else
+ gtk_widget_modify_style(m_widget, style);
}
bool wxWindowGTK::SetBackgroundStyle(wxBackgroundStyle style)