#endif
#include <math.h>
+#include <ctype.h>
#include "wx/gtk/private.h"
#include <gdk/gdkprivate.h>
gdk_event->area.height );
// Actual redrawing takes place in idle time.
- win->GtkUpdate();
+ // win->GtkUpdate();
#ifdef __WXGTK20__
(char *)"base",
0, 0, -1, -1);
}
-
-
- if (!(GTK_WIDGET_APP_PAINTABLE (widget)) &&
- (pizza->clear_on_draw))
- {
- gdk_window_clear_area( pizza->bin_window,
- rect->x, rect->y, rect->width, rect->height);
- }
#endif
+ win->m_clearRegion.Union( rect->x, rect->y, rect->width, rect->height );
win->GetUpdateRegion().Union( rect->x, rect->y, rect->width, rect->height );
- // Actual redrawing takes place in idle time.
-
+ // Update immediately, not in idle time.
win->GtkUpdate();
#ifndef __WXUNIVERSAL__
KeySym keysym = gdk_event->keyval;
- wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %d"),
+ wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"),
event.GetEventType() == wxEVT_KEY_UP ? _T("release")
: _T("press"),
keysym);
}
}
- wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %d"), key_code);
+ wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code);
// sending unknown key events doesn't really make sense
if ( !key_code )
{
wxCHECK_MSG( !m_needParent || parent, FALSE, wxT("Need complete parent.") );
- /* this turns -1 into 20 so that a minimal window is
- visible even although -1,-1 has been given as the
- size of the window. the same trick is used in other
- ports and should make debugging easier */
- m_width = WidthDefault(size.x);
+ // This turns -1 into 30 so that a minimal window is
+ // visible even although -1,-1 has been given as the
+ // size of the window. the same trick is used in other
+ // ports and should make debugging easier.
+ m_width = WidthDefault(size.x) ;
m_height = HeightDefault(size.y);
m_x = (int)pos.x;
m_y = (int)pos.y;
- /* some reasonable defaults */
+ // some reasonable defaults
if (!parent)
{
if (m_x == -1)
{
if (x != -1) m_x = x + pizza->xoffset;
if (y != -1) m_y = y + pizza->yoffset;
- if (width != -1) m_width = width;
- if (height != -1) m_height = height;
}
else
{
m_x = x + pizza->xoffset;
m_y = y + pizza->yoffset;
- m_width = width;
- m_height = height;
}
+ if (width != -1) m_width = width;
+ if (height != -1) m_height = height;
if ((sizeFlags & wxSIZE_AUTO_WIDTH) == wxSIZE_AUTO_WIDTH)
{
wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
- if (x) (*x) = gdk_string_width( font, string.mbc_str() );
+ if (x) (*x) = gdk_string_width( font, wxGTK_CONV( string ) );
if (y) (*y) = font->ascent + font->descent;
if (descent) (*descent) = font->descent;
if (externalLeading) (*externalLeading) = 0; // ??
gdk_window_warp_pointer( window, x, y );
}
+
void wxWindowGTK::Refresh( bool eraseBackground, const wxRect *rect )
{
if (!m_widget) return;
if (!m_widget->window) return;
-
+
#ifndef __WXGTK20__
if (g_isIdle)
wxapp_install_idle_handler();
// Clip to paint region in wxClientDC
m_clipPaintRegion = TRUE;
-
+
+#ifndef __WXGTK20__
if (GetThemeEnabled())
{
// find ancestor from which to steal background
}
}
else
- // if (!m_clearRegion.IsEmpty()) // always send an erase event
+#endif
+#ifdef __WXGTK20__
+ if (!m_clearRegion.IsEmpty()) // Always send an erase event under GTK 1.2
+#endif
{
wxWindowDC dc( (wxWindow*)this );
- dc.SetClippingRegion( m_clearRegion );
+ if (m_clearRegion.IsEmpty())
+ dc.SetClippingRegion( m_updateRegion );
+ else
+ dc.SetClippingRegion( m_clearRegion );
wxEraseEvent erase_event( GetId(), &dc );
erase_event.SetEventObject( this );
if (!GetEventHandler()->ProcessEvent(erase_event))
{
+#ifndef __WXGTK20__
if (!g_eraseGC)
{
g_eraseGC = gdk_gc_new( pizza->bin_window );
upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
upd ++;
}
+#endif
}
m_clearRegion.Clear();
}