void CGuiPanelWnd::OnNcPaint() { // TODO: Add your message handler code here // Tomo la misma rutina que se desarrolla para la clase // CGuiToolBarWnd. CRect rcWindow; CRect rcClient; CWindowDC dc(this); CDC m_dc; //contexto de dispositivo en memoria CBitmap m_bitmap; //la idea es tomar el area de la ventana y area cliente , luego debemos //igualar el area de coordenadas de ventana al cliente GetWindowRect(&rcWindow); GetClientRect(&rcClient); ScreenToClient(rcWindow); rcClient.OffsetRect(-rcWindow.TopLeft()); rcWindow.OffsetRect(-rcWindow.TopLeft()); m_dc.CreateCompatibleDC(&dc); m_bitmap.CreateCompatibleBitmap(&dc,rcWindow.Width(),rcWindow.Height()); CBitmap *m_OldBitmap=m_dc.SelectObject(&m_bitmap); //aqui debe utilizarse la brocha que define GuiDrawLayer, si no hacemos la siguiente //linea usted vera un horrible color negro, a cambio del dibujo. CBrush cb; cb.CreateSolidBrush(GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style)); m_dc.FillRect(rcWindow, &cb); DrawGripper(&m_dc,&rcWindow); dc.IntersectClipRect(rcWindow); dc.ExcludeClipRect(rcClient);//asi evitamos el parpadeo dc.BitBlt(rcWindow.left,rcWindow.top,rcWindow.Width(),rcWindow.Height(),&m_dc,0,0,SRCCOPY); m_dc.SelectObject(m_OldBitmap); m_bitmap.DeleteObject(); m_dc.DeleteDC(); }
void CControlBar::DoPaint( CDC *pDC ) /***********************************/ { CRect rect; GetClientRect( &rect ); DrawBorders( pDC, rect ); DrawGripper( pDC, rect ); }
void CWinXPToolbar::DoPaint(CDC* pDC) { ASSERT_VALID(this); ASSERT_VALID(pDC); //Paint the client area CRect rect; GetClientRect(rect); DrawBorders(pDC, rect); DrawGripper(pDC, rect); }
void CControlBar::DoPaint(CDC* pDC) { ASSERT_VALID(this); ASSERT_VALID(pDC); // paint inside client area CRect rect; GetClientRect(rect); DrawBorders(pDC, rect); DrawGripper(pDC, rect); }
/** * @brief Toolbar paint function. */ void ToolBarXPThemes::DoPaint(CDC* pDC) { ASSERT_VALID(this); ASSERT_VALID(pDC); // Paint inside the client area. CRect rect; GetClientRect(rect); DrawBorders(pDC, rect); DrawGripper(pDC, rect); }
void CCoolDialogBar::OnNcPaint() { EraseNonClient(); CWindowDC dc(this); dc.Draw3dRect(m_rectBorder, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); DrawGripper(dc); CRect pRect; GetClientRect( &pRect ); InvalidateRect( &pRect, TRUE ); }
void CControlBar::EraseNonClient() /********************************/ { CWindowDC dc( this ); CRect rectClient; CRect rectWindow; GetClientRect( &rectClient ); ClientToScreen( &rectClient ); GetWindowRect( &rectWindow ); rectClient.OffsetRect( -rectWindow.left, -rectWindow.top ); rectWindow.OffsetRect( -rectWindow.left, -rectWindow.top ); dc.ExcludeClipRect( &rectClient ); DrawBorders( &dc, rectWindow ); DrawGripper( &dc, rectWindow ); }
void COXSizeControlBar::EraseNonClient() { // get window DC that is clipped to the non-client area CWindowDC dc(this); CRect rectClient; GetClientRect(rectClient); CRect rectWindow; GetWindowRect(rectWindow); ScreenToClient(rectWindow); CSize sizeOffset(-rectWindow.left, -rectWindow.top); rectClient+=sizeOffset; rectWindow+=sizeOffset; // erase parts not drawn dc.ExcludeClipRect(rectClient); dc.IntersectClipRect(rectWindow); CRect rect; dc.GetClipBox(&rect); GetDockbarSkin()->DrawNonClientArea(&dc, rectWindow, this); RecalcLayout(); if(IsGripper()) { DrawGripper(&dc); } if(IsCloseBtn()) { DrawCloseBtn(&dc); } if(IsResizeBtn()) { DrawResizeBtn(&dc); } // Draw the border if (m_bClientBorder) { CBrush brBorder; brBorder.CreateSolidBrush(GetDockbarSkin()->GetClientBorderColor()); rectClient.InflateRect(1, 1); dc.FrameRect(rectClient, &brBorder); } }
void CCJToolBar::EraseNonClient(BOOL) { // get window DC that is clipped to the non-client area CWindowDC dc(this); CRect rectClient; GetClientRect(rectClient); CRect rectWindow; GetWindowRect(rectWindow); ScreenToClient(rectWindow); rectClient.OffsetRect(-rectWindow.left, -rectWindow.top); dc.ExcludeClipRect(rectClient); // draw borders in non-client area // draw borders in non-client area rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top); DrawBorders(&dc, rectWindow); // erase parts not drawn dc.IntersectClipRect(rectWindow); SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC); DrawGripper(dc); }
void CContainer::OnNcPaint(HRGN hRgn) { // TODO: Add your message handler code here // Do not call CControlBar::OnNcPaint() for painting messages // Tomo la misma rutina que se desarrolla para la clase // CGuiToolBarWnd. CRect rcWindow; CRect rcClient; CGDI dc(::GetWindowDC(GetSafeHwnd())); CGDI m_dc; //contexto de dispositivo en memoria CBitmap m_bitmap; //la idea es tomar el area de la ventana y area cliente , luego debemos //igualar el area de coordenadas de ventana al cliente GetWindowRect(&rcWindow); GetClientRect(&rcClient); ScreenToClient(rcWindow); ::OffsetRect(rcClient, -rcWindow.left,-rcWindow.top); ::OffsetRect(rcWindow, -rcWindow.left,-rcWindow.top); m_dc.CreateCompatibleDC(dc.m_hDC); m_bitmap.CreateCompatibleBitmap(dc.m_hDC,rcWindow.Width(),rcWindow.Height()); CBitmap m_OldBitmap((HBITMAP)m_dc.SelectObject(&m_bitmap)); CBrush cb; cb.CreateSolidBrush(CDrawLayer::GetRGBColorFace()); m_dc.FillRect(rcWindow, &cb); if (m_bCaption) DrawGripper(&m_dc,rcWindow); dc.IntersectClipRect(rcWindow); dc.ExcludeClipRect(rcClient);//asi evitamos el parpadeo dc.BitBlt(rcWindow.left,rcWindow.top,rcWindow.Width(),rcWindow.Height(),m_dc.m_hDC,0,0,SRCCOPY); m_dc.SelectObject(&m_OldBitmap); m_bitmap.DeleteObject(); m_dc.DeleteDC(); cb.DeleteObject (); dc.DeleteDC(); }
void CGuiToolBarWnd::OnNcPaint() { CRect rcWindow; CRect rcClient; CWindowDC dc(this); GetWindowRect(&rcWindow); GetClientRect(&rcClient); rcClient.OffsetRect(-rcWindow.TopLeft()); rcWindow.OffsetRect(-rcWindow.TopLeft()); ScreenToClient(rcWindow); rcClient.OffsetRect(-rcWindow.left,-rcWindow.top); //if (!m_bIsXp) if (m_dwStyle & CBRS_ORIENT_HORZ && !(m_dwStyle & CBRS_FLOATING)) {rcClient.top+=2;rcClient.left+=1;} dc.ExcludeClipRect(rcClient); rcWindow.OffsetRect(-rcWindow.left, -rcWindow.top); rcWindow.DeflateRect(1,1); //pintamos la izquierda dc.FillSolidRect(0,0,rcWindow.right+1,rcWindow.bottom+2,::GetSysColor(COLOR_BTNFACE)); dc.FillSolidRect(0,rcWindow.top+1,rcWindow.right+1,1,::GetSysColor(COLOR_BTNFACE)); //pintamos el borde inferior dc.FillSolidRect(1,rcWindow.bottom-1,rcWindow.right+1,rcWindow.bottom-1,::GetSysColor(COLOR_BTNFACE)); dc.FillSolidRect(0,rcWindow.bottom+1,rcWindow.right+1,rcWindow.bottom+1,::GetSysColor(COLOR_BTNFACE )); //pintamos la derecha dc.FillSolidRect(rcWindow.right,0,rcWindow.right-1,rcWindow.bottom,::GetSysColor(COLOR_BTNFACE)); dc.FillSolidRect(rcWindow.right+1,-1,rcWindow.right+4,rcWindow.bottom+4,::GetSysColor(COLOR_BTNFACE )); dc.IntersectClipRect(rcWindow); CBrush cb; cb.CreateSolidBrush(GuiDrawLayer::GetRGBColorXP()); dc.FillRect(rcWindow,&cb); DrawGripper(&dc,&rcWindow); }
void CWinXPToolbar::EraseNonClient(void) { //Get DC that is clipped to the non-client area CWindowDC dc(this); CRect rectClient; GetClientRect(rectClient); CRect rectWindow; GetWindowRect(rectWindow); ScreenToClient(rectWindow); rectClient.OffsetRect(-rectWindow.left, -rectWindow.top); dc.ExcludeClipRect(rectClient); //Draw borders in the nclient area rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top); DrawBorders(&dc, rectWindow); //Erase parts that don't get drawn dc.IntersectClipRect(rectWindow); SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC); //Draw the gripper DrawGripper(&dc, rectWindow); }
/** * @brief Toolbar Erase non-client area and draw gripper. */ void ToolBarXPThemes::EraseNonClient() { // Get window DC that is clipped to the non-client area. CWindowDC dc(this); CRect rectClient; GetClientRect(rectClient); CRect rectWindow; GetWindowRect(rectWindow); ScreenToClient(rectWindow); rectClient.OffsetRect(-rectWindow.left, -rectWindow.top); dc.ExcludeClipRect(rectClient); // Draw the borders in the non-client area. rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top); DrawBorders(&dc, rectWindow); // Erase the parts that are not drawn. dc.IntersectClipRect(rectWindow); SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC); // Draw the gripper in the non-client area. DrawGripper(&dc, rectWindow); }
void CGuiMiniFrame::OnNcPaint() { CGuiControlBar* pBar=(CGuiControlBar* )GetChildWnd(); if (!pBar) return; if (IsGuiControlBar==TRUE && !pBar->IsAutoHide()) { CMiniDockFrameWnd::OnNcPaint(); return; } //if (!pBar->GetComplete()) return; CRect rcWindow; CRect rcClient; CWindowDC dc(this); CDC m_dc; //contexto de dispositivo en memoria CBitmap m_bitmap; CPen Dark(PS_SOLID,1,GuiDrawLayer::GetRGBColorShadow(GuiDrawLayer::m_Style)); //la idea es tomar el area de la ventana y area cliente , luego debemos //igualar el area de coordenadas de ventana al cliente GetWindowRect(&rcWindow); GetClientRect(&rcClient); int nSize=rcClient.right; ScreenToClient(rcWindow); rcClient.OffsetRect(-rcWindow.TopLeft()); rcWindow.OffsetRect(-rcWindow.TopLeft()); m_dc.CreateCompatibleDC(&dc); m_bitmap.CreateCompatibleBitmap(&dc,rcWindow.Width(),rcWindow.Height()); CBitmap *m_OldBitmap=m_dc.SelectObject(&m_bitmap); //aqui debe utilizarse la brocha que define GuiDrawLayer, si no hacemos la siguiente //linea usted vera un horrible color negro, a cambio del dibujo. CBrush cb; COLORREF clrBrush; if(IsGuiControlBar!=TRUE ) clrBrush= GuiDrawLayer::GetRGBColorShadow(GuiDrawLayer::m_Style); else clrBrush=GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style); cb.CreateSolidBrush(clrBrush); m_dc.FillRect(rcWindow, &cb); if (IsGuiControlBar==TRUE && pBar->IsAutoHide()) { CRect m_rc=rcWindow; if (pBar->GetLastDocking() == CBRS_ALIGN_LEFT) { m_rc.left=m_rc.right-1; m_rc.top+=3; cb.DeleteObject(); cb.CreateSolidBrush(RGB(0,0,0)); } if (pBar->GetLastDocking() == CBRS_ALIGN_RIGHT) { m_rc.right=m_rc.left+1; m_rc.top+=2; cb.DeleteObject(); cb.CreateSolidBrush(GuiDrawLayer::GetRGBColorBTNHigh()); } if (pBar->GetLastDocking() == CBRS_ALIGN_TOP) { m_rc.top=m_rc.bottom-1; cb.DeleteObject(); cb.CreateSolidBrush(RGB(0,0,0)); } m_dc.FillRect(m_rc, &cb); } CRect rcCaption=rcClient; rcCaption.InflateRect(1,1); if(IsGuiControlBar!=TRUE ) dc.Draw3dRect(rcCaption,GuiDrawLayer::GetRGBColorBTNHigh(),GuiDrawLayer::GetRGBColorBTNHigh()); DrawGripper(&m_dc,&rcClient); dc.IntersectClipRect(rcWindow); dc.ExcludeClipRect(rcClient);//asi evitamos el parpadeo //rcWindow.InflateRect(1,1); dc.BitBlt(rcWindow.left,rcWindow.top,rcWindow.Width(),rcWindow.Height(),&m_dc,0,0,SRCCOPY); ReleaseDC(&dc); m_dc.SelectObject(m_OldBitmap); m_bitmap.DeleteObject(); m_dc.DeleteDC(); // SetTimer(1,200,NULL); // TODO: Add your message handler code here // Do not call CMiniDockFrameWnd::OnNcPaint() for painting messages }
void CCJControlBar::OnPaint() { CPaintDC dc(this); // device context for painting DrawGripper(&dc); }