Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CtrlLibraryTileView.h

Go to the documentation of this file.
00001 //
00002 // CtrlLibraryTileView.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_CTRLLIBRARYTILEVIEW_H__C409D195_CBAA_45F3_9757_AF8F0D67174C__INCLUDED_)
00023 #define AFX_CTRLLIBRARYTILEVIEW_H__C409D195_CBAA_45F3_9757_AF8F0D67174C__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "CtrlLibraryView.h"
00028 
00029 class CLibraryTileItem;
00030 class CAlbumFolder;
00031 
00032 
00033 class CLibraryTileView : public CLibraryView
00034 {
00035 // Construction
00036 public:
00037         CLibraryTileView();
00038         virtual ~CLibraryTileView();
00039 
00040 // Attributes
00041 protected:
00042         CSize                           m_szBlock;
00043         int                                     m_nColumns;
00044         int                                     m_nRows;
00045 protected:
00046         CLibraryTileItem**      m_pList;
00047         int                                     m_nCount;
00048         int                                     m_nBuffer;
00049         int                                     m_nScroll;
00050 protected:
00051         int                                     m_nSelected;
00052         CLibraryTileItem*       m_pFocus;
00053         CLibraryTileItem*       m_pFirst;
00054         CPtrList                        m_pSelTile;
00055         BOOL                            m_bDrag;
00056         CPoint                          m_ptDrag;
00057 
00058 // Operations
00059 public:
00060         virtual BOOL    CheckAvailable(CLibraryTreeItem* pSel);
00061         virtual void    Update();
00062         virtual BOOL    Select(DWORD nObject);
00063 protected:
00064         void                    Clear();
00065         int                             GetTileIndex(CLibraryTileItem* pTile) const;
00066         BOOL                    Select(CLibraryTileItem* pTile, TRISTATE bSelect = TS_TRUE);
00067         BOOL                    DeselectAll(CLibraryTileItem* pTile = NULL);
00068         BOOL                    SelectTo(CLibraryTileItem* pTile);
00069         void                    SelectTo(int nDelta);
00070         void                    Highlight(CLibraryTileItem* pTile);
00071 protected:
00072         static int                      SortList(LPCVOID pA, LPCVOID pB);
00073         void                            UpdateScroll();
00074         void                            ScrollBy(int nDelta);
00075         void                            ScrollTo(int nDelta);
00076         CLibraryTileItem*       HitTest(const CPoint& point) const;
00077         BOOL                            GetItemRect(CLibraryTileItem* pTile, CRect* pRect);
00078         void                            StartDragging(CPoint& ptMouse);
00079         CImageList*                     CreateDragImage(const CPoint& ptMouse);
00080 
00081 // Overrides
00082 public:
00083         //{{AFX_VIRTUAL(CLibraryTileView)
00084         protected:
00085         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00086         //}}AFX_VIRTUAL
00087 
00088 // Implementation
00089 protected:
00090         //{{AFX_MSG(CLibraryTileView)
00091         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00092         afx_msg void OnDestroy();
00093         afx_msg void OnSize(UINT nType, int cx, int cy);
00094         afx_msg void OnPaint();
00095         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00096         afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00097         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00098         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00099         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00100         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00101         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00102         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00103         afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00104         afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00105         afx_msg void OnUpdateLibraryAlbumOpen(CCmdUI* pCmdUI);
00106         afx_msg void OnLibraryAlbumOpen();
00107         afx_msg void OnUpdateLibraryAlbumDelete(CCmdUI* pCmdUI);
00108         afx_msg void OnLibraryAlbumDelete();
00109         afx_msg void OnUpdateLibraryAlbumProperties(CCmdUI* pCmdUI);
00110         afx_msg void OnLibraryAlbumProperties();
00111         //}}AFX_MSG
00112 
00113         DECLARE_MESSAGE_MAP()
00114 
00115 };
00116 
00117 
00118 class CLibraryTileItem
00119 {
00120 // Construction
00121 public:
00122         CLibraryTileItem(CAlbumFolder* pFolder);
00123         virtual ~CLibraryTileItem();
00124 
00125 // Attributes
00126 public:
00127         CAlbumFolder*   m_pFolder;
00128         DWORD                   m_nCookie;
00129         BOOL                    m_bSelected;
00130         CString                 m_sTitle;
00131         CString                 m_sSubtitle1;
00132         CString                 m_sSubtitle2;
00133         int                             m_nIcon32;
00134         int                             m_nIcon48;
00135         BOOL                    m_bCollection;
00136 
00137 // Operations
00138 public:
00139         BOOL    Update();
00140         void    Paint(CDC* pDC, const CRect& rcBlock, CDC* pMemDC);
00141 protected:
00142         void    DrawText(CDC* pDC, const CRect* prcClip, int nX, int nY, LPCTSTR pszText, CRect* prcUnion = NULL);
00143 
00144 };
00145 
00146 //{{AFX_INSERT_LOCATION}}
00147 
00148 #endif // !defined(AFX_CTRLLIBRARYTILEVIEW_H__C409D195_CBAA_45F3_9757_AF8F0D67174C__INCLUDED_)

Generated on Thu Dec 15 10:39:36 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2