void CGuiFolder::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default if (nIDEvent == 1) { CRect rc; CPoint pt(GetMessagePos()); ScreenToClient (&pt); GetClientRect(&rc); if (m_ultimoFolderResal != -1) { CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[m_ultimoFolderResal]; rc=cfd->m_rect; } if (!rc.PtInRect(pt)) { if (m_ultimoFolderResal != -1) { CFolderBar* cfd=(CFolderBar*) m_ArrayFolder[m_ultimoFolderResal]; CClientDC dc(this); DrawFolder(cfd,mFlat); m_ultimoFolderResal=-1; } KillTimer(1); } } CWnd::OnTimer(nIDEvent); }
void CGuiFolder::OnPaint() { CPaintDC dc(this); // device context for painting CRect mrect; int m_iNumFolder=m_ArrayFolder.GetSize(); //mrect.InflateRect(1,1); //GetClientRect(mrect); //dc.Draw3dRect(mrect, ::GetSysColor(COLOR_BTNSHADOW),::GetSysColor(COLOR_BTNHIGHLIGHT)); for ( int iCont=0; iCont< m_iNumFolder; iCont++) { m_iWhatFolderIsDrawNow=iCont; if (m_iSelected== iCont) DrawFolder((CFolderBar*) m_ArrayFolder[iCont],mFlat); else DrawFolder((CFolderBar*) m_ArrayFolder[iCont],mFlat); } }
void CGuiFolder::SelectFolder(int m_iNumFolder) { CFolderBar* cf = (CFolderBar*) m_ArrayFolder[m_iNumFolder]; if (cf) { DrawFolder(cf,mFlat); m_itemp = m_iSelected; m_iSelected = m_iNumFolder; EfectoScroll(); } }
void CGuiFolder::OnMouseMove(UINT nFlags, CPoint point) { int m_iNumBotton= m_ArrayFolder.GetSize(); static int m_AntTecla=-1; for( int iCont=0; iCont< m_iNumBotton;iCont++) { CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont]; m_iWhatFolderIsDrawNow=iCont; if (cit->m_rect.PtInRect(point)) { if (m_ultimoFolderResal==m_AntTecla && (m_ultimoFolderResal!=-1 && m_AntTecla !=-1)) return; else { if (m_ultimoFolderResal != -1) { CFolderBar* cit1=(CFolderBar*)m_ArrayFolder[m_ultimoFolderResal]; DrawFolder(cit1,mFlat); } } DrawFolder(cit,mNormal); m_AntTecla=m_ultimoFolderResal; m_ultimoFolderResal=iCont; SetTimer(1,100,NULL); return; } } if (m_ultimoFolderResal != -1) { CFolderBar* cit1=(CFolderBar*)m_ArrayFolder[m_ultimoFolderResal]; DrawFolder(cit1,mFlat); m_ultimoFolderResal=-1; } m_AntTecla=-1; CWnd::OnMouseMove(nFlags, point); }
void CGuiFolder::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default int m_iNumBotton=m_ArrayFolder.GetSize(); for( int iCont=0; iCont< m_iNumBotton;iCont++) { CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont]; if (cit->m_rect.PtInRect(point)) { DrawFolder(cit,mPush); } } CWnd::OnLButtonDown(nFlags, point); }
void CGuiFolder::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default int m_iNumBotton=m_ArrayFolder.GetSize(); for( int iCont=0; iCont< m_iNumBotton;iCont++) { CFolderBar* cit=(CFolderBar*)m_ArrayFolder[iCont]; if (cit->m_rect.PtInRect(point)) { DrawFolder(cit,mFlat); m_itemp=m_iSelected; m_iSelected=iCont; EfectoScroll(); } } CWnd::OnLButtonUp(nFlags, point); }
void CIMToolWin::DrawAll(CDC *pDC) { CDC memDC; memDC.CreateCompatibleDC(pDC); CRect rcClient; GetClientRect(rcClient); CBitmap bm; bm.CreateCompatibleBitmap(pDC, rcClient.Width(), rcClient.Height()); CBitmap *oldBitmap = memDC.SelectObject(&bm); //背景色 PaintGradiantRect(&memDC,rcClient,StartBgColor,EndBgColor,false); int i; for (i = folders.size() - 1; i >= 0; i--) DrawFolder(&memDC, i); pDC->BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memDC, 0, 0, SRCCOPY); memDC.SelectObject(oldBitmap); }