// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
{
- wxLogDebug("There were memory leaks.\n");
+ wxLogDebug("There were memory leaks.");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
{
wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, window, event);
+
+ wxLogDebug( "OnKey from %s", win->GetName().c_str() );
// We didn't process wxEVT_KEY_DOWN, so send
// wxEVT_CHAR
{
if (win)
{
- // Schedule update for later
win->GetUpdateRegion().Union( event->xexpose.x, event->xexpose.y,
event->xexpose.width, event->xexpose.height);
+
+ win->GetClearRegion().Union( event->xexpose.x, event->xexpose.y,
+ event->xexpose.width, event->xexpose.height);
+
+ // if (event->xexpose.count == 0)
+ // win->Update();
}
return;
{
if (win && event->xfocus.detail != NotifyPointer)
{
+ wxLogDebug( "FocusIn from %s", win->GetName().c_str() );
+
wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId());
focusEvent.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(focusEvent);
{
if (win && event->xfocus.detail != NotifyPointer)
{
+ wxLogDebug( "FocusOut from %s\n", win->GetName().c_str() );
+
wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId());
focusEvent.SetEventObject(win);
win->GetEventHandler()->ProcessEvent(focusEvent);
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
m_backgroundColour.CalcPixel( (WXColormap) cm );
- m_hasBgCol = TRUE;
m_foregroundColour = *wxBLACK;
m_foregroundColour.CalcPixel( (WXColormap) cm );
-
Window parentWindow = (Window) parent->GetMainWindow();
if (pos2.y == -1)
pos2.y = 100;
- Window window = XCreateSimpleWindow(
+ Window xwindow = XCreateSimpleWindow(
xdisplay, parentWindow,
pos2.x, pos2.y, size2.x, size2.y, 0,
m_backgroundColour.GetPixel(),
m_backgroundColour.GetPixel() );
- m_mainWidget = (WXWindow) window;
+ m_mainWidget = (WXWindow) xwindow;
// Select event types wanted
- XSelectInput( wxGlobalDisplay(), window,
+ XSelectInput( xdisplay, xwindow,
ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask |
KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
PropertyChangeMask);
- wxAddWindowToTable(window, (wxWindow*) this);
+ wxAddWindowToTable( xwindow, (wxWindow*) this );
// Is a subwindow, so map immediately
m_isShown = TRUE;
- XMapWindow(wxGlobalDisplay(), window);
+ XMapWindow( xdisplay, xwindow );
// Without this, the cursor may not be restored properly (e.g. in splitter
// sample).
SetCursor(*wxSTANDARD_CURSOR);
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+
+ // Set background to None which will prevent X11 from clearing the
+ // background comletely.
+ XSetWindowBackgroundPixmap( xdisplay, xwindow, None );
// Don't call this, it can have nasty repercussions for composite controls,
// for example
if (wxWindowIsVisible(xwindow))
{
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
- m_needsInputFocus = FALSE;
+ m_needsInputFocus = FALSE;
}
else
{
- m_needsInputFocus = TRUE;
+ m_needsInputFocus = TRUE;
}
}
{
if (!m_updateRegion.IsEmpty())
{
+ // Actually send erase and paint events.
X11SendPaintEvents();
}
}
{
m_clipPaintRegion = TRUE;
- // if (!m_clearRegion.IsEmpty())
+ if (!m_clearRegion.IsEmpty())
{
wxWindowDC dc( (wxWindow*)this );
dc.SetClippingRegion( m_clearRegion );
if (!GetEventHandler()->ProcessEvent(erase_event))
{
+ printf( "Hallo!\n" );
+ Window xwindow = (Window) GetMainWindow();
+ Display *xdisplay = wxGlobalDisplay();
+ GC xgc = XCreateGC( xdisplay, xwindow, 0, NULL );
+ XSetFillStyle( xdisplay, xgc, FillSolid );
+ XSetForeground( xdisplay, xgc, m_backgroundColour.GetPixel() );
wxRegionIterator upd( m_clearRegion );
while (upd)
{
- XClearArea( wxGlobalDisplay(), (Window) m_mainWidget,
- upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight(), False );
+ XFillRectangle( xdisplay, xwindow, xgc,
+ upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
upd ++;
}
}
{
wxWindowBase::SetBackgroundColour(col);
- if (!GetMainWindow())
- return FALSE;
-
Display *xdisplay = (Display*) wxGlobalDisplay();
int xscreen = DefaultScreen( xdisplay );
Colormap cm = DefaultColormap( xdisplay, xscreen );
- wxColour colour( col );
- colour.CalcPixel( (WXColormap) cm );
+ m_backgroundColour.CalcPixel( (WXColormap) cm );
+ if (!GetMainWindow())
+ return FALSE;
+
+/*
XSetWindowAttributes attrib;
attrib.background_pixel = colour.GetPixel();
(Window) GetMainWindow(),
CWBackPixel,
& attrib);
+*/
return TRUE;
}