home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / palette / palview.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-07  |  1.8 KB  |  62 lines

  1. // palview.h : interface of the CPalView class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #define PIXELS      10 
  5. class CPalView : public CView
  6. {
  7. protected: // create from serialization only
  8.     CPalView();
  9.     DECLARE_DYNCREATE(CPalView)
  10.     int iXcells, iYcells;           /* number of cells on each axis */
  11.     int iWidth, iHeight;
  12.     int get_xcells(int xsize, int ysize);
  13.     void show_pixel(CPoint point);
  14.     CPalette* m_pPal;
  15. // Attributes
  16. public:
  17.     CPalDoc* GetDocument();
  18.     NPLOGPALETTE pLogPal;
  19.     LOCALHANDLE hLocPal;
  20.     BOOL bCaptured;        /* mouse capture flag */
  21.  
  22. // Operations
  23. public:
  24.  
  25. // Implementation
  26. public:
  27.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  28.     virtual ~CPalView();
  29.     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  30.     virtual void OnInitialUpdate();
  31. #ifdef _DEBUG
  32.     virtual void AssertValid() const;
  33.     virtual void Dump(CDumpContext& dc) const;
  34. #endif
  35.  
  36.     // Printing support
  37. protected:
  38.     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
  39.     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
  40.     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
  41.  
  42. // Generated message map functions
  43. protected:
  44.     //{{AFX_MSG(CPalView)
  45.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  46.     afx_msg void OnSize(UINT nType, int cx, int cy);
  47.     afx_msg LRESULT OnPalNotify(WPARAM wParam, LPARAM lParam);
  48.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  49.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  50.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  51.     afx_msg void OnDestroy();
  52.     //}}AFX_MSG
  53.     DECLARE_MESSAGE_MAP()
  54. };
  55.  
  56. #ifndef _DEBUG    // debug version in palview.cpp
  57. inline CPalDoc* CPalView::GetDocument()
  58.    { return (CPalDoc*) m_pDocument; }
  59. #endif
  60.  
  61. /////////////////////////////////////////////////////////////////////////////
  62.