// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "dcscreen.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
#include "wx/window.h"
+#include "wx/frame.h"
#include "wx/dcscreen.h"
#include "wx/utils.h"
&gcvalues);
m_backgroundPixel = (int) gcvalues.background;
- m_ok = TRUE;
+ m_ok = true;
}
wxScreenDC::~wxScreenDC()
{
+ EndDrawingOnTop();
}
bool wxScreenDC::StartDrawingOnTop(wxWindow* window)
wxRect rect;
int x, y, width, height;
window->GetPosition(& x, & y);
- if (window->GetParent())
+ if (window->GetParent() && !window->IsKindOf(CLASSINFO(wxFrame)))
window->GetParent()->ClientToScreen(& x, & y);
window->GetSize(& width, & height);
rect.x = x; rect.y = y;
bool wxScreenDC::StartDrawingOnTop(wxRect* rect)
{
if (sm_overlayWindow)
- return FALSE;
+ return false;
Display *dpy = (Display*) wxGetDisplay();
Pixmap screenPixmap = RootWindow(dpy, DefaultScreen(dpy));
if (sm_overlayWindow)
{
XMapWindow(dpy, (Window) sm_overlayWindow);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
bool wxScreenDC::EndDrawingOnTop()
{
XDestroyWindow((Display*) wxGetDisplay(), (Window) sm_overlayWindow);
sm_overlayWindow = 0;
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}