TitledPicsWnd.h
上传用户:cuiyan8037
上传日期:2007-01-01
资源大小:215k
文件大小:3k
源码类别:
ListView/ListBox
开发平台:
Visual C++
- // TitledPicsWnd.h : header file
- //
- // Notification messages.
- #define TPWN_SELCHANGE 1
- #define TPWN_DBLCLK 2
- #define TPWN_CLICK 3
- #define TPWN_RCLICK 4
- // Other data.
- #define TPW_NONE -1
- #define TPW_SIZE_BESTFIT -1
- #define TPW_SIZE_DEFAULT_SPACING 2
- #define TPW_NUM_LINESTEXT 2
- #define TPW_BITMAPTYPE_RESOURCE (DWORD)0
- #define TPW_BITMAPTYPE_OBJECT (DWORD)1
- /////////////////////////////////////////////////////////////////////////////
- // CTitledPicsWnd view
- class CTitledPicsWnd : public CScrollView
- {
- public:
- UINT GetSelectedBitmapType(void); UINT GetSelectedBitmapID(void); CBitmap * GetSelectedBitmapPointer(void); CString GetSelectedTitle(void); void SetSel(int iIndex); int GetSel(void); void StretchBitmaps(BOOL bStretch = TRUE); CTitledPicsWnd();
- virtual ~CTitledPicsWnd();
- DECLARE_DYNCREATE(CTitledPicsWnd)
- // Attributes
- public:
- void SetSpacing(UINT uSpacing); UINT GetSize(void); void SetSize(UINT uNewSize); void RemoveAll(void); void RemoveAt(UINT uIndex, UINT uCount = 1); int Add(CBitmap *pBmp, CString strTitle); int Add(UINT uBmpID, CString strTitle); void SetSectionSize(int cx, int cy);
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTitledPicsWnd)
- public:
- virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- protected:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual void OnInitialUpdate(); // first time after construct
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- // Generated message map functions
- //{{AFX_MSG(CTitledPicsWnd)
- afx_msg void OnDestroy();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- COLORREF m_dwWndBkgndColour; BOOL m_bWantsBestFit; void NotifyParent(UINT uNotifyCode); BOOL m_bFocusIsDone; void DrawFocusOnItem(UINT uItem, BOOL bDraw = TRUE); int m_iSelectedItem; BOOL m_bStretchBitmaps; CFont m_fntSmall; void CalculateFit(void); void SetNewPageSize(void); CSize GetFontSize(void); UINT m_uSectionsPerRow; UINT m_uSpacing; CSize GetBitmapSize(CBitmap *pBmp); void CalculateBestFit(void); CUIntArray m_aryDwBitmapTypes; CStringArray m_aryStrTitles; CDWordArray m_aryDwBitmaps; CSize m_sizSection; };
- /////////////////////////////////////////////////////////////////////////////