Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

dibwnd.h

00001 /*
00002 /----------------------------------------------------------------
00003 |
00004 |      $Id: dibwnd.h,v 1.4 2002/03/31 13:36:42 uzadow Exp $
00005 |      Window containing a bitmap.
00006 |
00007 |      Child window containing a bitmap. Handles
00008 |      scrolling and resize.
00009 |
00010 |      Copyright (c) 1996-2002 Ulrich von Zadow
00011 |
00012 \----------------------------------------------------------------
00013 */
00014 
00015 #ifndef INCL_DIBWND
00016 #define INCL_DIBWND
00017 
00018 #include "plwinbmp.h"
00019 
00020 class CDIBWnd : public CWnd
00021 {
00022 
00023 DECLARE_DYNAMIC (CDIBWnd);
00024 // Construction
00025 public:
00026   CDIBWnd
00027     ( PLWinBmp * pBmp
00028     );
00029 
00030   virtual ~CDIBWnd
00031     ();
00032 
00033 // Implementation
00034 public:
00035   virtual void NewDIBNotify
00036     ();
00037     // Call this whenever the bitmap is changed outside of the object.
00038 
00039 protected:
00040 // Overrides
00041   // ClassWizard generated virtual function overrides
00042   //{{AFX_VIRTUAL(CDIBWnd)
00043   //}}AFX_VIRTUAL
00044 
00045   // Generated message map functions
00046   //{{AFX_MSG(CDIBWnd)
00047   afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00048   afx_msg void OnSize(UINT nType, int cx, int cy);
00049   afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00050   afx_msg void OnPaint();
00051   afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00052   //}}AFX_MSG
00053   DECLARE_MESSAGE_MAP()
00054 
00055   virtual BOOL PreCreateWindow (CREATESTRUCT& cs);
00056 
00057 protected:
00058   void initScrollBars
00059     ( int cx,
00060       int cy
00061     );
00062 
00063   PLWinBmp   * m_pBmp;
00064   CSize       m_Size;
00065   CSize       m_BmpSize;
00066   CPoint      m_BmpPos;
00067   bool        m_bScrolling;
00068 
00069 private:
00070   void initScrollBar
00071     ( int ID,
00072       int Page,
00073       int Range,
00074       int Pos
00075     );
00076 
00077   int handleScroll
00078     ( int ID,
00079       UINT nSBCode,
00080       UINT nPos,
00081       int Page,
00082       int Range,
00083       int Pos
00084     );
00085 
00086 };
00087 
00088 #endif
00089 /*
00090 /--------------------------------------------------------------------
00091 |
00092 |      $Log: dibwnd.h,v $
00093 |      Revision 1.4  2002/03/31 13:36:42  uzadow
00094 |      Updated copyright.
00095 |
00096 |      Revision 1.3  2001/09/16 19:03:23  uzadow
00097 |      Added global name prefix PL, changed most filenames.
00098 |
00099 |
00100 --------------------------------------------------------------------
00101 */

Generated on Sun Jun 6 13:42:21 2004 for paintlib by doxygen 1.3.2