home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / stingray / gridsvw5.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-27  |  5.0 KB  |  189 lines

  1. // gridsvw5.h : interface of the CGridSample5View class
  2. //
  3.  
  4. // This is a part of the Objective Grid C++ Library.
  5. // Copyright (C) 1995,1996 ClassWorks, Stefan Hoenig.
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to
  9. // the Objective Grid Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding
  12. // the Objective Grid product.
  13. //
  14.  
  15.  
  16. #ifndef _MYGRIDVW_H_
  17. #include "mygridvw.h"
  18. #endif
  19.  
  20. #ifndef _GXCTRL_H_
  21. #include "gxctrl.h"
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CSimpleButton control
  26.  
  27. class CSimpleButton: public CGXStatic
  28. {
  29.     DECLARE_CONTROL(CSimpleButton)
  30.  
  31. public:
  32.     // Member functions
  33.  
  34.     CSimpleButton(CGXGridCore* pGrid);
  35.     virtual ~CSimpleButton();
  36.  
  37.     virtual void InvertBorders(CDC* pDC, const CRect& r);
  38.     virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);
  39.     virtual BOOL MouseMove(UINT nFlags, CPoint pt, UINT nHitState);
  40.     virtual BOOL LButtonDown(UINT nFlags, CPoint pt, UINT nHitState);
  41.     virtual BOOL RButtonDown(UINT nFlags, CPoint pt, UINT nHitState);
  42.     virtual BOOL LButtonUp(UINT nFlags, CPoint pt, UINT nHitState);
  43.     virtual BOOL RButtonUp(UINT nFlags, CPoint pt, UINT nHitState);
  44.     virtual BOOL KeyPressed(UINT nMessage, UINT nChar, UINT nRepCnt = 1, UINT flags = 0);
  45.     virtual void OnClickedButton(CGXChild* pChild);
  46.  
  47.     // Attributes:
  48. protected:
  49.     BOOL m_bPressed;
  50.     BOOL m_bMouseDown;
  51. };
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CBitmapBtnEdit control
  55.  
  56. class CBitmapBtnEdit: public CGXEditControl
  57. {
  58.     DECLARE_CONTROL(CBitmapBtnEdit)
  59.  
  60. public:
  61.     // Constructor & Destructor
  62.     CBitmapBtnEdit(CGXGridCore* pGrid, UINT nID);
  63.     virtual CRect GetCellRect(ROWCOL nRow, ROWCOL nCol, LPRECT rectItem = NULL, const CGXStyle* pStyle = NULL);
  64.  
  65. protected:
  66.     virtual void OnInitChilds(ROWCOL nRow, ROWCOL nCol, const CRect& rect);
  67.     virtual void OnClickedButton(CGXChild* pChild);
  68.     virtual BOOL OnValidate();
  69.  
  70.     // Attributes:
  71.     // Use CGXDIBitmapButton instead of CGXBitmapButton
  72.     CGXDIBitmapButtonChild* m_pButton;
  73.     CSize m_sizeBtn;
  74.  
  75.     // Generated message map functions
  76. protected:
  77.     //{{AFX_MSG(CBitmapBtnEdit)
  78.     //}}AFX_MSG
  79.     DECLARE_MESSAGE_MAP()
  80. };
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CArrowRowHeader control
  84.  
  85. class CArrowRowHeader : public CGXControl
  86. {
  87.     // Runtime Type Information
  88.     DECLARE_CONTROL(CArrowRowHeader)
  89.  
  90. public:
  91.     CArrowRowHeader(CGXGridCore* pGrid);
  92.  
  93.     // event handler
  94.     virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);
  95. };
  96.  
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CMyComboBox control
  99.  
  100. class CMyComboBox : public CGXComboBox
  101. {
  102.     DECLARE_CONTROL(CMyComboBox)
  103. public:
  104.     CMyComboBox(CGXGridCore* pGrid, UINT nEditID, UINT nListBoxID, UINT nFlags);
  105.     void Init(ROWCOL nRow, ROWCOL nCol);
  106.     BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  107. };
  108.  
  109. /////////////////////////////////////////////////////////////////////////////
  110. // COwnerDrawnComboBox window
  111.  
  112. class COwnerDrawnComboBox : public CGXComboBoxWnd
  113. {
  114.     DECLARE_CONTROL(COwnerDrawnComboBox)
  115.  
  116. // Construction
  117. public:
  118.     COwnerDrawnComboBox(CGXGridCore* pGrid);
  119.  
  120. // Attributes
  121. public:
  122.  
  123. // Operations
  124. public:
  125.  
  126. // Overrides
  127.     // ClassWizard generated virtual function overrides
  128.     //{{AFX_VIRTUAL(COwnerDrawnComboBox)
  129.     public:
  130.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  131.     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  132.     //}}AFX_VIRTUAL
  133.  
  134. // Implementation
  135. public:
  136.     virtual ~COwnerDrawnComboBox();
  137.     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  138.  
  139.     // Generated message map functions
  140. protected:
  141.     //{{AFX_MSG(COwnerDrawnComboBox)
  142.         // NOTE - the ClassWizard will add and remove member functions here.
  143.     //}}AFX_MSG
  144.  
  145.     DECLARE_MESSAGE_MAP()
  146. };
  147.  
  148. /////////////////////////////////////////////////////////////////////////////
  149. // CGridSample5View view
  150.  
  151. class CGridSample5View : public CMyGridView
  152. {
  153. protected: // create from serialization only
  154.     CGridSample5View();
  155.     DECLARE_DYNCREATE(CGridSample5View)
  156.  
  157. // Attributes
  158. public:
  159.     CGridSampleDoc* GetDocument();
  160.  
  161. // Operations
  162.     BOOL ConnectParam();
  163.     void SetupControls();
  164.  
  165. // Implementation
  166. public:
  167.     virtual ~CGridSample5View();
  168.     virtual void OnInitialUpdate();
  169. #ifdef _DEBUG
  170.     virtual void AssertValid() const;
  171.     virtual void Dump(CDumpContext& dc) const;
  172. #endif
  173.  
  174. // Generated message map functions
  175. protected:
  176.     //{{AFX_MSG(CGridSample5View)
  177.     afx_msg void OnViewUseractions();
  178.     afx_msg void OnViewSplitterview();
  179.     //}}AFX_MSG
  180.     DECLARE_MESSAGE_MAP()
  181. };
  182.  
  183. #ifndef _DEBUG  // debug version in gridsvw.cpp
  184. inline CGridSampleDoc* CGridSample5View::GetDocument()
  185.    { return (CGridSampleDoc*) m_pDocument; }
  186. #endif
  187.  
  188. /////////////////////////////////////////////////////////////////////////////
  189.