switch editor-canvas to no-autoclear mode

svn: r12169
This commit is contained in:
Matthew Flatt 2008-10-29 21:36:58 +00:00
parent e8e94bb82d
commit ac9944a818
2 changed files with 34 additions and 2 deletions

View File

@ -183,7 +183,7 @@ wxMediaCanvas::wxMediaCanvas(wxWindow *parent,
+ wxOVERRIDE_KEY_TRANSLATIONS
+ INIT_SB
+ (style & wxINVISIBLE ? wxINVISIBLE : 0)
+ (style & wxTRANSPARENT_WIN ? wxTRANSPARENT_WIN : 0)
+ (style & wxTRANSPARENT_WIN ? wxTRANSPARENT_WIN : wxNO_AUTOCLEAR)
+ (style & wxCONTROL_BORDER ? wxCONTROL_BORDER : 0)
+ (style & wxCOMBO_SIDE ? wxCOMBO_SIDE : 0)
+ (style & wxRESIZE_CORNER ? wxRESIZE_CORNER : 0)),
@ -352,7 +352,7 @@ void wxMediaCanvas::ResetSize()
ResetVisual(FALSE);
#if defined(wx_mac)
{
if (0) {
wxDC *adc;
wxColor *bg;
bg = GetCanvasBackground();
@ -824,6 +824,37 @@ void wxMediaCanvas::Redraw(double localx, double localy, double fw, double fh)
GetView(&x, &y, &w, &h);
/* Clear the margins */
if (xmargin || ymargin) {
wxDC *adc;
wxColor *bg;
bg = GetCanvasBackground();
if (bg) {
wxBrush *b, *ob;
wxPen *p, *op;
int cw, ch;
GetClientSize(&cw, &ch);
b = wxTheBrushList->FindOrCreateBrush(bg, wxSOLID);
p = wxThePenList->FindOrCreatePen("BLACK", 0, wxTRANSPARENT);
adc = GetDC();
ob = adc->GetBrush();
op = adc->GetPen();
adc->SetBrush(b);
adc->SetPen(p);
adc->DrawRectangle(0, 0, xmargin, ch);
adc->DrawRectangle(cw-xmargin, 0, cw, ch);
adc->DrawRectangle(0, 0, cw, ymargin);
adc->DrawRectangle(0, ch-ymargin, cw, ch);
adc->SetBrush(ob);
adc->SetPen(op);
}
}
right = x + w;
bottom = y + h;

View File

@ -740,6 +740,7 @@ void wxCanvas::DoPaint()
DeleteObject(paint_rgn);
} else {
/* We ignore the clipping region because... it's simpler? */
SetRectRgn(need_update, 0, 0, 0, 0);
if (!(wstyle & wxNO_AUTOCLEAR)) {
/* The erase through OnEraseBkgnd() was confine to the clipping