First, my paint function is called by the scroll event processing function and draws the window correctly. Then the image drawn is shifted some X number of pixels in the direction of scroll and my paint function is called again. This time though the dc will only draw in the area that is blank after the draw shift. This causes the window to look like a cut running in the middle that copies a section and pastes it on the other side.
I have tried to set the clipping region on the dc by:
dc.DestroyClippingRegion();
dc.SetClippingRegion(0,0,500,500);
500x500 happens to be the size of the window as I test this. Had it worked I would have set to the actual client size, but it didn't do a damn thing.
I've followed the code through the wx event handling procedures until it enters windows land. Then put a breakpoint in wxWndProc at the start. The movement of the window image happens in windows land and then wx gets a refresh event (apparently clipped to the offending area).
Is there anything I can do to override the dc's unwillingness to draw on the entire window? My drawing algorithm is correct and would fix the problem if I could just draw the entire window.
Thanks for any help. Paint function follows:
Code: Select all
void paint(wxPaintEvent &)
{
wxPaintDC dc(window);
dc.Clear();
wxPen tpen = dc.GetPen();
wxPen pen = tpen;
pen.SetStyle(wxDOT);
dc.SetPen(pen);
wx_drawing_context ctx(dc, tracker.transform());
doc->get_grid()->draw_region(tracker.viewed_area(), ctx);
dc.SetPen(tpen);
doc->draw(ctx);
}