//*********************************************************************************************************** void CBCGPBaseVisualCtrl::OnPaint() { CPaintDC dc(this); // device context for painting if (m_pGM == NULL) { m_pGM = CBCGPGraphicsManager::CreateInstance(); } if (m_pGM == NULL) { return; } double dblMemDCScale = m_pGM->IsSupported(BCGP_GRAPHICS_MANAGER_SCALING) ? 1.0 : m_dblScale; CBCGPMemDC memDC (dc, this, 0, dblMemDCScale); CDC* pDC = &memDC.GetDC (); CRect rectClip(0, 0, 0, 0); if (!IsDirty()) { dc.GetClipBox(rectClip); } DoPaint(pDC, rectClip); }
LRESULT CWindowWithShadow::CWndShadow::HandleMessage( UINT uMsg, WPARAM wParam, LPARAM lParam ) { if (uMsg == WM_CREATE) { //MoveWindow(GetHWND(), 0, 0, 100, 100, TRUE); //DoPaint(NULL); } else if (uMsg == WM_DESTROY) { if (m_hmpOffscreen) { ::SelectObject(m_hDcOffScreen, m_hbmpOffscreenOld); ::DeleteObject(m_hmpOffscreen); ::DeleteDC(m_hDcOffScreen); } if (m_hDcPaint) ReleaseDC(GetHWND(), m_hDcPaint); } else if (uMsg == WM_ERASEBKGND) { return 1; } else if (uMsg == WM_PAINT) { //COMMON_TRACE(L"pait"); RECT rcPaint; if (GetRectNeedUpdate(&rcPaint) && IsRectEmpty(&rcPaint) == FALSE) { DoPaint(&rcPaint); } //return ; } return __super::HandleMessage(uMsg,wParam,lParam); }
void CCatchScreenDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { if(!m_BackgroundBitmap.GetSafeHandle()) { return; } CPaintDC dc(this); DoPaint(dc); //DrawTip(); CDialog::OnPaint(); } }
void CExtLabel::OnPaint() { ASSERT_VALID( this ); DWORD dwWndStyle = GetStyle(); DWORD dwWndType = (dwWndStyle&SS_TYPEMASK); if( dwWndType == SS_BLACKRECT || dwWndType == SS_GRAYRECT || dwWndType == SS_WHITERECT || dwWndType == SS_BLACKFRAME || dwWndType == SS_GRAYFRAME || dwWndType == SS_WHITEFRAME || dwWndType == SS_USERITEM || dwWndType == SS_OWNERDRAW || dwWndType == SS_BITMAP || dwWndType == SS_ENHMETAFILE || dwWndType == SS_ETCHEDHORZ || dwWndType == SS_ETCHEDVERT || dwWndType == SS_ETCHEDFRAME ) { Default(); return; } CPaintDC dcPaint( this ); CRect rcClient; GetClientRect( &rcClient ); if( rcClient.IsRectEmpty() ) return; DoPaint( &dcPaint, rcClient ); }
LRESULT CALLBACK WndProc (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { case WM_COMMAND: return DoWMCommand(wParam, hWnd); case WM_LBUTTONDOWN: DoLButtonDown(hWnd,lParam); break; case WM_LBUTTONUP: DoLButtonUp(hWnd,lParam); break; case WM_MOUSEMOVE: DoMouseMove(hWnd,lParam); break; case WM_PAINT: DoPaint(hWnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd,Message,wParam,lParam); } return 0; }
LRESULT CMainDlg::OnPaint(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // wParam not NULL means some sub window want get its background brush. if (wParam != NULL) { Graphics g((HDC)wParam); DoPaint(g); } else { CPaintDC dc(m_hWnd); Graphics g(dc.m_hDC); DoPaint(g); } return 0; }
void CLibraryHeaderPanel::OnPaint() { CPaintDC dc( this ); CRect rcClient; GetClientRect( &rcClient ); if ( rcClient.IsRectEmpty() ) return; if ( rcClient.Width() > m_szBuffer.cx || rcClient.Height() > m_szBuffer.cy ) { if ( m_bmBuffer.m_hObject != NULL ) { m_dcBuffer.SelectObject( m_hBuffer ); m_dcBuffer.DeleteDC(); m_bmBuffer.DeleteObject(); } m_szBuffer = rcClient.Size(); m_bmBuffer.CreateCompatibleBitmap( &dc, m_szBuffer.cx, m_szBuffer.cy ); m_dcBuffer.CreateCompatibleDC( &dc ); m_hBuffer = (HBITMAP)m_dcBuffer.SelectObject( &m_bmBuffer )->m_hObject; } if ( ! CoolInterface.DrawWatermark( &m_dcBuffer, &rcClient, &m_bmWatermark, 0, 0 ) ) { m_dcBuffer.FillSolidRect( &rcClient, Skin.m_crBannerBack ); } DoPaint( &m_dcBuffer, rcClient ); dc.BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &m_dcBuffer, 0, 0, SRCCOPY ); }
//***************************************************************************** void CBCGPStatic::OnPaint() { if (!m_bVisualManagerStyle && !m_bOnGlass) { Default (); return; } const DWORD dwStyle = GetStyle (); if ((dwStyle & SS_ICON) == SS_ICON || (dwStyle & SS_BLACKRECT) == SS_BLACKRECT || (dwStyle & SS_GRAYRECT) == SS_GRAYRECT || (dwStyle & SS_WHITERECT) == SS_WHITERECT || (dwStyle & SS_BLACKFRAME) == SS_BLACKFRAME || (dwStyle & SS_GRAYFRAME) == SS_GRAYFRAME || (dwStyle & SS_WHITEFRAME) == SS_WHITEFRAME || (dwStyle & SS_USERITEM) == SS_USERITEM || (dwStyle & SS_ETCHEDHORZ) == SS_ETCHEDHORZ || (dwStyle & SS_ETCHEDVERT) == SS_ETCHEDVERT) { Default (); return; } CPaintDC dc(this); // device context for painting CBCGPMemDC memDC (dc, this); CDC* pDC = &memDC.GetDC (); globalData.DrawParentBackground (this, pDC); DoPaint(pDC); }
void CSplashDlg::Step(LPCTSTR pszText) { m_sState.Format( _T("¼ÓÔØ %s..."), pszText ); CClientDC dc( this ); DoPaint( &dc ); }
void CDockBar::OnPaint() { // background is already filled in grey CPaintDC dc(this); if (IsVisible() && GetDockedVisibleCount() != 0) DoPaint(&dc); // delegate to paint helper }
BOOL CArbitraryEnergyView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) { // TODO: 在此添加消息处理程序代码和/或调用默认值 C3DWindow::OnMouseWheel(zDelta); DoPaint(); return __super::OnMouseWheel(nFlags, zDelta, pt); }
void CArbitraryEnergyView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 C3DWindow::OnLeftButtonDown(point.x,point.y); DoPaint(); __super::OnLButtonDown(nFlags, point); }
void cbSplashScreen::OnPaint(wxPaintEvent &) { // an obscure statement in the wxWidgets book says to // allocate the DC even if you don't paint to avoid // a paint loop. //pecan 2006/04/3 wxPaintDC paint_dc(this); DoPaint(paint_dc); }
LONG CSplashDlg::OnPrintClient(WPARAM wParam, LPARAM lParam) { LONG lResult = Default(); CDC* pDC = CDC::FromHandle( (HDC)wParam ); DoPaint( pDC ); return lResult; }
//***************************************************************************** LRESULT CBCGPStatic::OnPrint(WPARAM wp, LPARAM lp) { const DWORD dwStyle = GetStyle (); if ((dwStyle & SS_ICON) == SS_ICON || (dwStyle & SS_BLACKRECT) == SS_BLACKRECT || (dwStyle & SS_GRAYRECT) == SS_GRAYRECT || (dwStyle & SS_WHITERECT) == SS_WHITERECT || (dwStyle & SS_BLACKFRAME) == SS_BLACKFRAME || (dwStyle & SS_GRAYFRAME) == SS_GRAYFRAME || (dwStyle & SS_WHITEFRAME) == SS_WHITEFRAME || (dwStyle & SS_USERITEM) == SS_USERITEM) { return Default(); } DWORD dwFlags = (DWORD)lp; #ifndef _BCGSUITE_ BOOL bIsHorz = TRUE; if (m_bBackstageMode && !IsOwnerDrawSeparator(bIsHorz)) { if ((dwFlags & PRF_CLIENT) == PRF_CLIENT) { CDC* pDC = CDC::FromHandle((HDC) wp); ASSERT_VALID(pDC); DoPaint(pDC); } return 0; } #endif if ((dwFlags & PRF_NONCLIENT) == PRF_NONCLIENT) { CDC* pDC = CDC::FromHandle((HDC) wp); ASSERT_VALID(pDC); #ifndef _BCGSUITE_ if (IsOwnerDrawSeparator(bIsHorz)) { CRect rect; GetWindowRect (rect); rect.bottom -= rect.top; rect.right -= rect.left; rect.left = rect.top = 0; CBCGPVisualManager::GetInstance ()->OnDrawDlgSeparator(pDC, this, rect, bIsHorz); } #endif } return Default(); }
int DispPaint() { // Stop function from being reentered static unsigned char ReEntry=0; int Ret=0; if (ReEntry) return 1; ReEntry=1; Ret=DoPaint(); ReEntry=0; return Ret; }
//************************************************************************** void CBCGPProgressCtrl::OnPaint() { CPaintDC dc(this); // device context for painting CBCGPMemDC memDC (dc, this); CDC* pDC = &memDC.GetDC (); DoPaint(pDC); }
void CControlBar::OnPaint() { // background is already filled in gray CPaintDC dc(this); // erase background now if (IsVisible()) DoPaint(&dc); // delegate to paint helper }
LRESULT CPreviewClientWindow::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CPaintDC dc(m_hWnd); dc.SetViewportOrg(-m_scrlX, -m_scrlY); DoPaint(dc.m_hDC); return 0; }
void cbSplashScreen::OnEraseBackground(wxEraseEvent &event) { wxDC *dc = event.GetDC(); if (dc) { DoPaint(*dc); // why not? :) } }
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { PAINTSTRUCT ps; HDC hdc; switch(msg) { case WM_PAINT: hdc = BeginPaint(hwnd, &ps); DoPaint(hdc); EndPaint(hwnd, &ps); break; case WM_NCHITTEST: return HTCLIENT; case WM_LBUTTONUP: if ( pcp != 0 ) { pcp->screen.x = current_target_location.x * TRANSFORMATION_UNITS_PER_PIXEL; pcp->screen.y = current_target_location.y * TRANSFORMATION_UNITS_PER_PIXEL; pcp->device.x = GET_X_LPARAM(lp); pcp->device.y = GET_Y_LPARAM(lp); } if ( ++current_target == total_targets ) { TRANSFORMATION_COEFFICIENTS tc; #if 0 CalcTransformationCoefficientsSimple(&cps, &tc); printf("%d %d %d %d %d %d %d\n", tc.a, tc.b, tc.c, tc.d, tc.e, tc.f, tc.s); CalcTransformationCoefficientsBetter(&cps, &tc); printf("%d %d %d %d %d %d %d\n", tc.a, tc.b, tc.c, tc.d, tc.e, tc.f, tc.s); CalcTransformationCoefficientsEvenBetter(&cps, &tc); printf("%d %d %d %d %d %d %d\n", tc.a, tc.b, tc.c, tc.d, tc.e, tc.f, tc.s); #endif CalcTransformationCoefficientsBest(&cps, &tc); printf("%d %d %d %d %d %d %d\n", tc.a, tc.b, tc.c, tc.d, tc.e, tc.f, tc.s); InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); PostQuitMessage(0); break; } InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); break; default: return DefWindowProc(hwnd, msg, wp, lp); } return 0; }
void CArbitraryEnergyView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 if(nFlags&MK_LBUTTON) { C3DWindow::OnMouseDrag(point.x,point.y); DoPaint(); } __super::OnMouseMove(nFlags, point); }
void CArbitraryEnergyView::OnDraw(CDC* pDC) { CArbitraryEnergyDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; // TODO: add draw code for native data here DoPaint(*pDC); }
MsgRouting AwtLabel::WmPrintClient(HDC hDC, LPARAM) { RECT r; // obtain valid DC from GDI stack ::RestoreDC(hDC, -1); ::GetClipBox(hDC, &r); DoPaint(hDC, r); return mrConsume; }
LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) { DoPaint(); RECT rcClient = { 0 }; ::GetClientRect(m_hWnd, &rcClient); ::ValidateRect(m_hWnd, &rcClient); bHandled = FALSE; return S_OK; }
void CSkinHeaderCtrl::OnPaint() { CPaintDC dc(this); // device context for painting if(m_HeaderShow) DoPaint(&dc); else { CRect Rect; GetClientRect(Rect); dc.FillSolidRect(Rect,RGB(255,255,255)); } }
LRESULT CFileTreeView::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CFileTreeView* pT = static_cast<CFileTreeView*>(this); ATLASSERT(::IsWindow(pT->m_hWnd)); PAINTSTRUCT ps; BeginPaint(&ps); DoPaint(ps.hdc, ps.rcPaint); EndPaint(&ps); return 0; }
void CCoolBarCtrl::DoPaint(CDC* pDC) { ASSERT_VALID( this ); ASSERT_VALID( pDC ); CRect rc; GetClientRect( &rc ); if ( m_bBuffered || m_bmImage.m_hObject != NULL ) { CDC* pBuffer = CoolInterface.GetBuffer( *pDC, rc.Size() ); if ( CoolInterface.DrawWatermark( pBuffer, &rc, &m_bmImage ) ) { CalcInsideRect( rc, FALSE ); rc.left -= m_cyTopBorder; rc.top -= m_cxLeftBorder; rc.right += m_cyBottomBorder; rc.bottom += m_cxRightBorder; } else { DrawBorders( pBuffer, rc ); } DoPaint( pBuffer, rc, TRUE ); GetClientRect( &rc ); pDC->BitBlt( 0, 0, rc.Width(), rc.Height(), pBuffer, 0, 0, SRCCOPY ); pBuffer->SelectClipRgn( NULL ); } else { DrawBorders( pDC, rc ); DoPaint( pDC, rc, FALSE ); pDC->FillSolidRect( &rc, CoolInterface.m_crMidtone ); } }
void CArbitraryEnergyView::OnTimer(UINT_PTR nIDEvent) { // TODO: 在此添加消息处理程序代码和/或调用默认值 g_dialog_tool.m_edit_display_max=m_round_face_max; g_dialog_tool.m_edit_display_min=m_round_face_min; g_dialog_tool.m_edit_display_middle=(m_round_face_max+m_round_face_min)/2; g_dialog_tool.m_edit_display_unit.SetWindowText(m_round_face_string); if(!g_simulate.m_updating_statistic) { DoPaint(); g_dialog_tool.Update(); } __super::OnTimer(nIDEvent); }
void Ctrl::WndUpdate0r(const Rect& r) { GuiLock __; Rect rr = r + GetRect().TopLeft(); bool dummy; Vector<Rect> h; h <<= invalid; invalid = Intersect(invalid, rr, dummy); FBInitUpdate(); DoPaint(); invalid <<= h; Subtract(invalid, rr); FBFlush(); }