summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a9f994d)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11976
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_MGLDC = mgldc;
m_OwnsMGLDC = OwnsMGLDC;
m_ok = TRUE;
m_MGLDC = mgldc;
m_OwnsMGLDC = OwnsMGLDC;
m_ok = TRUE;
-
- if ( mgldc->getDC()->a.clipRegion )
- {
- MGLRegion clip;
- mgldc->getClipRegion(clip);
- m_globalClippingRegion = wxRegion(clip);
- // FIXME_MGL -- reuse wxWindows::m_updateRegion ?
- m_currentClippingRegion = m_globalClippingRegion;
- m_clipping = TRUE;
- }
+
+ if ( !m_globalClippingRegion.IsNull() )
+ SetClippingRegion(m_globalClippingRegion);
- m_MGLDC->setClipRect(MGLRect(0, 0, m_MGLDC->sizex(), m_MGLDC->sizey()));
+ m_MGLDC->setClipRect(MGLRect(0, 0, m_MGLDC->sizex()+1, m_MGLDC->sizey()+1));
m_clipping = FALSE;
m_currentClippingRegion.Clear();
}
m_clipping = FALSE;
m_currentClippingRegion.Clear();
}
void wxDC::DoGetSize(int *w, int *h) const
{
void wxDC::DoGetSize(int *w, int *h) const
{
- if (w) *w = m_MGLDC->sizex();
- if (h) *h = m_MGLDC->sizey();
+ if (w) *w = m_MGLDC->sizex()+1;
+ if (h) *h = m_MGLDC->sizey()+1;
}
void wxDC::DoGetSizeMM(int *width, int *height) const
}
void wxDC::DoGetSizeMM(int *width, int *height) const
if ( dc )
{
m_inPaintHandler = TRUE;
if ( dc )
{
m_inPaintHandler = TRUE;
+
+ m_globalClippingRegion = win->GetUpdateRegion();
SetMGLDC(dc, FALSE);
}
else
{
m_inPaintHandler = FALSE;
SetMGLDC(dc, FALSE);
}
else
{
m_inPaintHandler = FALSE;
- SetMGLDC(new MGLDevCtx(MGL_wmBeginPaint(m_wnd->GetHandle())), TRUE);
+
+ dc = new MGLDevCtx(MGL_wmBeginPaint(win->GetHandle()));
+
+ MGLRegion clip;
+ dc->getClipRegion(clip);
+ m_globalClippingRegion = wxRegion(clip);
+ SetMGLDC(dc, TRUE);
// TRUE means that dtor will delete MGLDevCtx object
// but it won't destroy MGLDC returned by MGL_wmBeginPaint because
// ~MGLDevCtx() doesn't call destroy()
// TRUE means that dtor will delete MGLDevCtx object
// but it won't destroy MGLDC returned by MGL_wmBeginPaint because
// ~MGLDevCtx() doesn't call destroy()
wxWindowDC::~wxWindowDC()
{
wxWindowDC::~wxWindowDC()
{
- if ( m_inPaintHandler )
- {
- // This is neccessary so that subsequently created wxPaintDCs won't get
- // confused about clipping. Another reason is that the same MGL dc is reused
- // for wxEraseEvent, wxNcPaintEvent and wxPaintEvent
- DestroyClippingRegion();
- }
- else
+ if ( !m_inPaintHandler )
{
GetMGLDC()->setDC(NULL);
MGL_wmEndPaint(m_wnd->GetHandle());
{
GetMGLDC()->setDC(NULL);
MGL_wmEndPaint(m_wnd->GetHandle());
wxClientDC::wxClientDC(wxWindow *win) : wxWindowDC(win)
{
wxRect r = m_wnd->GetClientRect();
wxClientDC::wxClientDC(wxWindow *win) : wxWindowDC(win)
{
wxRect r = m_wnd->GetClientRect();
+ m_globalClippingRegion.Intersect(r);
SetDeviceOrigin(r.x, r.y);
}
SetDeviceOrigin(r.x, r.y);
}
size.y = sizeDpy.y / 5;
}
size.y = sizeDpy.y / 5;
}
- wxWindow::Create(parent, id, pos, sizeOrig, style, name);
+ wxWindow::Create(NULL, id, pos, sizeOrig, style, name);
+ SetParent(parent);
+ if ( parent )
+ parent->AddChild(this);
wxTopLevelWindows.Append(this);
wxTopLevelWindows.Append(this);
void wxDisplaySize(int *width, int *height)
{
wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
void wxDisplaySize(int *width, int *height)
{
wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
- if (width) *width = g_displayDC->sizex();
- if (height) *height = g_displayDC->sizey();
+ if (width) *width = g_displayDC->sizex()+1;
+ if (height) *height = g_displayDC->sizey()+1;
}
void wxDisplaySizeMM(int *width, int *height)
{
wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
if ( width )
}
void wxDisplaySizeMM(int *width, int *height)
{
wxASSERT_MSG( g_displayDC, wxT("MGL display DC not created yet.") );
if ( width )
- *width = g_displayDC->sizex() * 25/72;
+ *width = (g_displayDC->sizex()+1) * 25/72;
- *height = g_displayDC->sizey() * 25/72;
+ *height = (g_displayDC->sizey()+1) * 25/72;
// FIXME_MGL -- what about returning *real* monitor dimensions?
}
// FIXME_MGL -- what about returning *real* monitor dimensions?
}
+#if 0 // FIXME_MGL -- debugging stuff!
+ dc->setColorRGB(255,0,255);
+ dc->fillRect(-1000,-1000,2000,2000);
+ wxUsleep(100);
+#endif
+
MGLRegion clip;
dc->getClipRegion(clip);
m_updateRegion = wxRegion(clip);
MGLRegion clip;
dc->getClipRegion(clip);
m_updateRegion = wxRegion(clip);