// the event handler executed when the window background must be painted void wxWindow::OnErase(wxEraseEvent& event) { if ( !m_renderer ) { event.Skip(); return; } DoDrawBackground(*event.GetDC()); #if wxUSE_SCROLLBAR // if we have both scrollbars, we also have a square in the corner between // them which we must paint if ( m_scrollbarVert && m_scrollbarHorz ) { wxSize size = GetSize(); wxRect rectClient = GetClientRect(), rectBorder = m_renderer->GetBorderDimensions(GetBorder()); wxRect rectCorner; rectCorner.x = rectClient.GetRight() + 1; rectCorner.y = rectClient.GetBottom() + 1; rectCorner.SetRight(size.x - rectBorder.width); rectCorner.SetBottom(size.y - rectBorder.height); if ( GetUpdateRegion().Contains(rectCorner) ) { m_renderer->DrawScrollCorner(*event.GetDC(), rectCorner); } } #endif // wxUSE_SCROLLBAR }
void BaseToolBarControl::onEraseBG(wxEraseEvent& event) { if (!m_imgBg.getImg() || !m_imgBg->IsOk()) { event.Skip(); } else { wxDC *dc = event.GetDC(); wxBitmap temp(m_imgBg->Scale(GetSize().GetWidth(), GetSize().GetHeight())); dc->DrawBitmap(temp, 0,0, false); } }
void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event) { if (event.GetDC() && m_bitmap.IsOk()) { wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0); } else { wxClientDC dc(this); if (m_bitmap.IsOk()) wxDrawSplashBitmap(dc, m_bitmap, 0, 0); } }
void ClientStateIndicator::OnEraseBackground(wxEraseEvent& event){ CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); wxASSERT(pSkinSimple); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); event.Skip(false); wxDC *dc; dc=event.GetDC(); dc->SetBackground(wxBrush(this->GetBackgroundColour(),wxSOLID)); dc->Clear(); dc->DrawBitmap(*(pSkinSimple->GetWorkunitAreaBackgroundImage()->GetBitmap()), 0, 0); }
void CNoFlickerListCtrl::OnEraseBackground(wxEraseEvent &evt) { //wxDC *pdc=evt.GetDC(); evt.Skip(); }
void AboutBox::OnEraseBackground(wxEraseEvent& event) { wxPoint ptWnd; wxSize seWnd; ptWnd = wxPoint(-1,-1);//GetPosition(); seWnd = GetClientSize(); wxDC *pDC = event.GetDC(); if (pDC) { pDC->SetBrush(m_brGrey); pDC->DrawRectangle(ptWnd.x, ptWnd.y, 2+seWnd.GetWidth(), 2+seWnd.GetHeight()); pDC->SetBrush(m_brStipple); pDC->DrawRectangle(m_rect1.GetX(), m_rect1.GetY(), m_rect1.GetWidth(), m_rect1.GetHeight()); pDC->SetBrush(m_brWhite); pDC->DrawRectangle(m_rect2.GetX(), m_rect2.GetY(), m_rect2.GetWidth(), m_rect2.GetHeight()); pDC->SetBrush(wxNullBrush); } else { wxClientDC dc(this); dc.SetBrush(m_brGrey); dc.DrawRectangle(ptWnd.x, ptWnd.y, 2+seWnd.GetWidth(), 2+seWnd.GetHeight()); dc.SetBrush(m_brStipple); dc.DrawRectangle(m_rect1.GetX(), m_rect1.GetY(), m_rect1.GetWidth(), m_rect1.GetHeight()); dc.SetBrush(m_brWhite); dc.DrawRectangle(m_rect2.GetX(), m_rect2.GetY(), m_rect2.GetWidth(), m_rect2.GetHeight()); dc.SetBrush(wxNullBrush); } }
void CPanelPreferences::OnEraseBackground( wxEraseEvent& event ) { if (!m_backgroundBitmap) { MakeBackgroundBitmap(); } // Create a buffered device context to reduce flicker wxSize sz = GetClientSize(); wxBufferedDC dc(event.GetDC(), sz, wxBUFFER_CLIENT_AREA); #if TEST_BACKGROUND_WITH_MAGENTA_FILL // Fill the dialog with a magenta color so people can detect when something // is wrong dc.SetBrush(wxBrush(wxColour(255,0,255))); dc.SetPen(wxPen(wxColour(255,0,255))); dc.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight()); #else CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); wxASSERT(pSkinSimple); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); wxColour bgColor(*pSkinSimple->GetDialogBackgroundImage()->GetBackgroundColor()); SetBackgroundColour(bgColor); #endif if (m_backgroundBitmap->IsOk()) { dc.DrawBitmap(*m_backgroundBitmap, 0, 0); } }
// -------------------------------------------------------------------------------- // void guSplashFrame::OnEraseBackground( wxEraseEvent &event ) { wxDC * dc = event.GetDC(); if( dc ) { dc->DrawBitmap( * m_Bitmap, 0, 0, false ); } }
void CScrolledTextBox::OnEraseBackground(wxEraseEvent& event) { wxDC *dc = event.GetDC(); wxPoint p = GetParent()->GetPosition(); wxRect r = GetRect(); r.Offset(p); wxBitmap backgroundBitmap = ((CSimpleTaskPanel*)GetGrandParent())->GetBackgroundBmp().GetSubBitmap(r); dc->DrawBitmap(backgroundBitmap, 0, 0); }
void DispLoading::onEraseBG( wxEraseEvent& event ) { wxDC *dc = event.GetDC(); if (!m_imgHandle.getImg() || !m_imgHandle->IsOk()) { dc->SetTextForeground(wxColor(0,0,0)); dc->Clear(); return; } int h = GetSize().GetHeight(); int w = GetSize().GetWidth(); int iw = m_imgHandle->GetSize().GetWidth(); //size 7 const int l_start = 0; const int l_width = 2; //size 6 const int m_start = 2; const int m_width = 15; //size 7 with 1 pix gap const int r_start = 17; const int r_width = 2; wxBitmap tmpBmp(w, h); wxMemoryDC tmpDC(tmpBmp); tmpDC.SetBrush(wxBrush(wxColor(255,0,255))); tmpDC.SetPen( wxPen(wxColor(255,0,255),1) ); tmpDC.DrawRectangle(0,0,w,h); wxImage scaled = m_imgHandle->Scale(iw, h); if (scaled.IsOk()) { wxBitmap left = wxBitmap(scaled.GetSubImage( wxRect(l_start,0,l_width,h)) ); wxBitmap right = wxBitmap(scaled.GetSubImage( wxRect(r_start,0,r_width,h)) ); wxBitmap center(w-(l_width+r_width),h); wxColor c(255,0,255); gcImage::tileImg(center, wxBitmap(scaled.GetSubImage( wxRect(m_start,0,m_width,h)) ), &c); tmpDC.DrawBitmap(left, l_start,0,true); tmpDC.DrawBitmap(center, m_start,0,true); tmpDC.DrawBitmap(right, w-r_width,0,true); } tmpDC.SelectObject(wxNullBitmap); dc->DrawBitmap(tmpBmp, 0,0, true); wxRegion region = wxRegion(tmpBmp, wxColor(255,0,255), 1); SetShape(region, this); }
void CPanelPreferences::OnEraseBackground( wxEraseEvent& event ) { CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); wxASSERT(pSkinSimple); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); wxMemoryDC memDC; wxCoord w, h, x, y; // Get the desired background bitmap wxBitmap bmp(*pSkinSimple->GetDialogBackgroundImage()->GetBitmap()); // Dialog dimensions wxSize sz = GetClientSize(); // Create a buffered device context to reduce flicker wxBufferedDC dc(event.GetDC(), sz, wxBUFFER_CLIENT_AREA); // bitmap dimensions w = bmp.GetWidth(); h = bmp.GetHeight(); #if TEST_BACKGROUND_WITH_MAGENTA_FILL // Fill the dialog with a magenta color so people can detect when something // is wrong dc.SetBrush(wxBrush(wxColour(255,0,255))); dc.SetPen(wxPen(wxColour(255,0,255))); dc.DrawRectangle(0, 0, sz.GetWidth(), sz.GetHeight()); #else wxColour bgColor(*pSkinSimple->GetDialogBackgroundImage()->GetBackgroundColor()); SetBackgroundColour(bgColor); #endif // Is the bitmap smaller than the window? if ( (w < sz.x) || (h < sz.y) ) { // Check to see if they need to be rescaled to fit in the window wxImage img = bmp.ConvertToImage(); img.Rescale((int) sz.x, (int) sz.y); // Draw our cool background (centered) dc.DrawBitmap(wxBitmap(img), 0, 0); } else { // Snag the center of the bitmap and use it // for the background image x = wxMax(0, (w - sz.x)/2); y = wxMax(0, (h - sz.y)/2); // Select the desired bitmap into the memory DC so we can take // the center chunk of it. memDC.SelectObject(bmp); // Draw the center chunk on the window dc.Blit(0, 0, w, h, &memDC, x, y, wxCOPY); // Drop the bitmap memDC.SelectObject(wxNullBitmap); } }
void cbSplashScreen::OnEraseBackground(wxEraseEvent &event) { wxDC *dc = event.GetDC(); if (dc) { DoPaint(*dc); // why not? :) } }
void CProjectsComponent::OnEraseBackground(wxEraseEvent& event){ CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple(); wxASSERT(pSkinSimple); wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple)); wxDC* dc = event.GetDC(); dc->DrawBitmap(*pSkinSimple->GetProjectAreaBackgroundImage()->GetBitmap(), 0, 0); }
// Avoid unnecessary drawing due to Mac progress indicator's animation void CSimpleTaskPanel::OnEraseBackground(wxEraseEvent& event) { wxRect clipRect; wxDC *dc = event.GetDC(); if (m_ProgressBar->IsShown()) { // if (m_progressBarRect == NULL) { m_progressBarRect = new wxRect(m_ProgressBar->GetRect()); m_progressBarRect->Inflate(1, 0); // } dc->GetClippingBox(&clipRect.x, &clipRect.y, &clipRect.width, &clipRect.height); if (clipRect.IsEmpty() || m_progressBarRect->Contains(clipRect)) { return; } } // CSimplePanelBase::OnEraseBackground(event); event.Skip(); }
void CTaskDetailReport::OnErase( wxEraseEvent& event ) { //KDE下,白色会变灰色底 event.Skip(); /* wxPaintDC pdc( this ); pdc.SetBackground( *wxWHITE_BRUSH ); pdc.Clear(); */ }
void wxEmulatorContainer::OnEraseBackground(wxEraseEvent& event) { wxDC* dc wxDUMMY_INITIALIZE(NULL); if (event.GetDC()) { dc = event.GetDC(); } else { dc = new wxClientDC(this); } dc->SetBackground(wxBrush(wxGetApp().m_emulatorInfo.m_emulatorBackgroundColour, wxSOLID)); dc->Clear(); if (!event.GetDC()) delete dc; }
void CTransparentCheckBox::OnEraseBackground(wxEraseEvent& event) { if (m_pParentsBgBmp && *m_pParentsBgBmp) { wxMemoryDC memDC(**m_pParentsBgBmp); wxSize sz = GetClientSize(); wxDC *dc = event.GetDC(); wxCoord x=0, y=0, xx, yy; wxWindow* win = this; do { win->GetPosition(&xx, &yy); x += xx; y += yy; win = win->GetParent(); } while (!win->IsTopLevel()); dc->Blit(0, 0, sz.GetWidth(), sz.GetHeight(), &memDC, x, y, wxCOPY); } else { event.Skip(); } }
void wxControl::OnEraseBackground( wxEraseEvent& rEvent ) { RECTL vRect; HPS hPS = rEvent.GetDC()->GetHPS(); SIZEL vSize = {0,0}; ::GpiSetPS(hPS, &vSize, PU_PELS | GPIF_DEFAULT); ::WinQueryWindowRect((HWND)GetHwnd(), &vRect); ::WinFillRect(hPS, &vRect, GetBackgroundColour().GetPixel()); } // end of wxControl::OnEraseBackground
void MyCanvas::OnEraseBackground(wxEraseEvent& event) { if (wxGetApp().GetBackgroundBitmap().Ok()) { wxSize sz = GetClientSize(); wxRect rect(0, 0, sz.x, sz.y); if (event.GetDC()) { wxGetApp().TileBitmap(rect, *(event.GetDC()), wxGetApp().GetBackgroundBitmap()); } else { wxClientDC dc(this); wxGetApp().TileBitmap(rect, dc, wxGetApp().GetBackgroundBitmap()); } } else event.Skip(); // The official way of doing it }
// We don't reliably get EraseBackground events under Linux, // so there is a workaround at CSimplePanelBase::MakeBGBitMap() void CSimpleGUIPanel::OnEraseBackground(wxEraseEvent& event) { wxDC *dc = event.GetDC(); #ifdef __WXMAC__ // Avoid unnecessary drawing due to Mac progress indicator's animation wxRect clipRect; wxRect taskRect = m_taskPanel->GetRect(); dc->GetClippingBox(&clipRect.x, &clipRect.y, &clipRect.width, &clipRect.height); if (clipRect.IsEmpty() || taskRect.Contains(clipRect)) { return; } #endif dc->DrawBitmap(m_bmpBg, 0, 0); }
void wxPanel::OnEraseBackground(wxEraseEvent& event) { wxDC& dc = *event.GetDC(); const wxSize clientSize = GetClientSize(); const wxSize bitmapSize = m_bitmapBg.GetSize(); for ( int x = 0; x < clientSize.x; x += bitmapSize.x ) { for ( int y = 0; y < clientSize.y; y += bitmapSize.y ) { dc.DrawBitmap(m_bitmapBg, x, y); } } }
void wxVideoTerminal::OnEraseBackground(wxEraseEvent &evt) { wxDC *p_dc = evt.GetDC(); wxSize sz = p_dc->GetSize(); p_dc->SetBrush( brushes[0] ); if (mp_bitmap) { wxSize sz_bmp = mp_bitmap->GetSize(); if (sz_bmp.x < sz.x) p_dc->DrawRectangle(wxPoint(sz_bmp.x,0), wxSize(sz.x-sz_bmp.x,sz.y)); if (sz_bmp.y < sz.y) p_dc->DrawRectangle(wxPoint(0,sz_bmp.y), wxSize(sz.x, sz.y-sz_bmp.y)); } else { p_dc->DrawRectangle(wxPoint(0,0), sz); } }
void MusikFXDialog::OnEraseBackground( wxEraseEvent& event ) { // empty => no background erasing to avoid flicker wxDC * TheDC = event.GetDC(); wxColour BGColor = GetBackgroundColour(); wxBrush MyBrush(BGColor ,wxSOLID); TheDC->SetBackground(MyBrush); wxCoord width,height; TheDC->GetSize(&width,&height); wxCoord x,y,w,h; TheDC->GetClippingBox(&x,&y,&w,&h); // Now declare the Clipping Region which is // what needs to be repainted wxRegion MyRegion(x,y,w,h); //Get all the windows(controls) rect's on the dialog wxWindowList & children = GetChildren(); for ( wxWindowList::Node *node = children.GetFirst(); node; node = node->GetNext() ) { wxWindow *current = (wxWindow *)node->GetData(); // now subtract out the controls rect from the //clipping region MyRegion.Subtract(current->GetRect()); } // now destroy the old clipping region TheDC->DestroyClippingRegion(); //and set the new one TheDC->SetClippingRegion(MyRegion); TheDC->Clear(); }
void frmDebugger::OnEraseBackground(wxEraseEvent &event) { event.Skip(); }
void uwHexCtrl::OnErase( wxEraseEvent& event ) { event.Skip(); }
void frmMain::OnEraseBackground(wxEraseEvent &event) { event.Skip(); }
void CSlideShowPanel::OnEraseBackground(wxEraseEvent& event) { wxDC *dc = event.GetDC(); wxRect r = GetRect(); wxBitmap backgroundBitmap = ((CSimpleTaskPanel*)GetParent())->GetBackgroundBmp().GetSubBitmap(r); dc->DrawBitmap(backgroundBitmap, 0, 0); }
void GlCanvas::OnEraseBackground (wxEraseEvent &event) { event.Skip (); }
void LeafPanel::OnEraseBackground( wxEraseEvent& event ) { event.Skip(false); }
void wxsDrawingWindow::OnEraseBack(wxEraseEvent& event) { // Let the background be cleared when screenshoot is in progress if ( m_DuringFetch ) event.Skip(); }