home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfTest / testVF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  4.6 KB  |  181 lines

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5. #ifndef __TESTVF_H__
  6. #define __TESTVF_H__
  7.  
  8. #include "vForm.h"
  9.  
  10. #include "VCtl2.h"
  11. #include "VBitmap.h"
  12. #include "PalHook.h"
  13.  
  14. #define IDVC_LBLSROW        201
  15. #define IDVC_TESTVAL        202
  16. #define IDVC_OPTION            203
  17. #define IDVC_LBLROW            204
  18. #define IDVC_BTN1            205
  19. #define IDVC_CHECK1            206
  20. #define IDVC_PICTBTN1        207
  21. #define IDVC_PICTCYCLE1        208
  22. #define IDVC_ANIM1            209
  23.  
  24. #define IDVC_HDREDIT        240
  25. #define IDVC_BG_OPTION        241
  26. #define IDVC_SET_BMP        242
  27. #define IDVC_CHK_SELECTORS    245
  28. #define IDVC_FTREDIT        250
  29.  
  30. class CTestVF;
  31.  
  32. // -------------------------------------------------------------------------
  33. // CTestHdr Class
  34. // -------------------------------------------------------------------------
  35. class CTestHdr : public VHeader
  36. {
  37. public:
  38.     CTestHdr();
  39.     virtual ~CTestHdr() {};
  40.  
  41. public:
  42.     int            m_nBackStyle;
  43.     VCheckBox    m_chkSelectors;
  44.     VStatic        m_lblBackGround;
  45.     VDropDown    m_lstBgOption;
  46.     VEdit        m_hdrEdit;
  47.     VButton        m_btnSetBmp;
  48. };
  49.  
  50. // -------------------------------------------------------------------------
  51. // CTestFtr Class
  52. // -------------------------------------------------------------------------
  53. class CTestFtr : public VHeader
  54. {
  55. public:
  56.     CTestFtr();
  57.     virtual ~CTestFtr() {};
  58.  
  59. public:
  60.     VStatic        m_lblGoodbye;
  61.     VEdit        m_ftrEdit;
  62. };
  63.  
  64.  
  65. // -------------------------------------------------------------------------
  66. // CTestRow Class
  67. // -------------------------------------------------------------------------
  68. class CTestRow : public VRow
  69. {
  70. public:
  71.     CTestRow(CTestVF* pForm);
  72.     virtual ~CTestRow();
  73.  
  74.     int        SRowId()        { return m_nSRowId; }
  75.     void    SRowId(int x)    { m_nSRowId = x; }
  76.  
  77.     void    SetBG(int nBackStyle);
  78.     virtual HBITMAP        GetBackBmp();
  79.     virtual HPALETTE    GetBackPaletteHandle();
  80.  
  81. public:
  82.     int            m_nBackStyle;
  83.     VStatic        m_lblSRow;
  84.     VEdit        m_testval;
  85.     VDropDown    m_lstOption;
  86.     // VComboBox    m_lstOption;
  87.     VStatic        m_lblRow;
  88.     VButton        m_btn1;
  89.     VCheckBox    m_check1;
  90.     VPicture    m_anim1;
  91.     VPictButton m_pictBtn1;
  92.     VPictCycle    m_pictCycle1;
  93.  
  94.     int            m_nSRowId;
  95. };
  96.  
  97.  
  98. // -------------------------------------------------------------------------
  99. // CTestData Class
  100. // -------------------------------------------------------------------------
  101. class CTestData
  102. {
  103. public:
  104.     CTestData() { m_bCheck = FALSE; m_nCycleOpt = 0; }
  105.  
  106. public:
  107.     CString        m_name;
  108.     BOOL        m_bCheck;
  109.     CString        m_option;
  110.     int            m_nCycleOpt;
  111. };
  112.  
  113.  
  114.  
  115. // -------------------------------------------------------------------------
  116. // CTestVF Class
  117. // -------------------------------------------------------------------------
  118. class CTestVF : public VForm
  119. {
  120. public:
  121.     CTestData    m_data[500];    // Array of test data
  122.     CPalMsgHandler*    m_pPalMH;
  123. protected:
  124.     int            m_nSRows;        // Number of screen rows created
  125.     CImageList    m_imgList;        // Image list for picture control
  126.     CImageList    m_imgCycleList;    // Image list for picture control
  127.     CImageList    m_imgPrintAnim;    // Image list for printer animation
  128.     int            m_nBackIdx;        // Background Type
  129.     VBitmap        m_bmpBack;        // BMP class
  130.     UINT        m_nTimerId;        // Animation Timer
  131.  
  132. public:
  133.     CTestVF();                // Constructor
  134.     virtual ~CTestVF();        // Destructor
  135.  
  136.     CImageList* GetTestImgList()    { return &m_imgList; }
  137.     CImageList* GetCycleImgList()    { return &m_imgCycleList; }
  138.     CImageList* GetPrintAnimImg()    { return &m_imgPrintAnim; }
  139.     VBitmap*    GetBmp()            { return &m_bmpBack; }
  140.     HBITMAP        GetBackBmp()        { return m_bmpBack; }
  141.     HPALETTE    GetBackPalette()    { return m_bmpBack.GetPaletteHandle(); }
  142.     CPalette*    GetPalette()        { return m_bmpBack.GetPalette(); }
  143.  
  144.     BOOL        SetBackBmp(LPCTSTR szFile);        // Set the background BMP
  145.     void        SetPalMH(CPalMsgHandler *pPalMH)    { m_pPalMH = pPalMH; }
  146.  
  147.     // DECLARE_DYNCREATE(CTestVF)
  148.  
  149. // Operations
  150. public:
  151. // Overrides
  152.     // ClassWizard generated virtual function overrides
  153.     //{{AFX_VIRTUAL(CTestVF)
  154.     public:
  155.     protected:
  156.     //}}AFX_VIRTUAL
  157.  
  158. protected:
  159.     virtual VRow*    InitRow();
  160.  
  161.     // --- the following functions deal with the Data ---
  162.     virtual    BOOL    OnGetRow(VRow *pRow);        // Puts row to screen
  163.     virtual BOOL    OnSaveRow(VRow *pRow);        // Save row from screen
  164.     virtual BOOL    OnAddRow(VRow *pRow);        // Add a data row
  165.     virtual BOOL    OnDelete();                    // Delete row(s)
  166.     virtual void    OnStartAdd(VRow *pRow);        // Start of Add: Defaults
  167.  
  168.     virtual void    OnClick(VRow *pRow, int nId);
  169.     virtual BOOL    OnEndList(VCtl* pCtl, CListBox* pLB);
  170.  
  171. // Generated message map functions
  172. protected:
  173.     //{{AFX_MSG(CTestVF)
  174.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  175.     //}}AFX_MSG
  176.     DECLARE_MESSAGE_MAP()
  177.  
  178. };
  179.  
  180. #endif
  181.