home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------
- // DynamicVF.h
- // -------------------------------------------------------------------------
- #ifndef __DYNAMICVF_H__
- #define __DYNAMICVF_H__
-
- #include "vForm.h"
- #include "vCtl2.h"
- #include <afxTempl.h> // For the dynamic CArray
-
-
- // ------ Control Identifiers -----
-
- // ----- Forward Declarations -----
- class DynamicVf;
- class CVfBldrDoc;
- class CVfbSection;
- class VfbCtl;
-
-
- // -------------------------------------------------------------------------
- // TestData Class - test data
- // - This is our Test Data - we will be using a CArray of these objects.
- // -------------------------------------------------------------------------
- class TestData
- {
- public:
- TestData();
-
- public:
- CStringArray m_fld; // Array of strings
- TestData& operator =(TestData &that);
- };
-
- typedef CArray<TestData, TestData&> TestDataArray;
-
-
- // -------------------------------------------------------------------------
- // Class DynamicVfHdr
- // -------------------------------------------------------------------------
- class DynamicVfHdr : public VHeader
- {
- public:
- DynamicVfHdr() {};
- };
-
-
- // -------------------------------------------------------------------------
- // Class DynamicVfDtl
- // -------------------------------------------------------------------------
- class DynamicVfDtl : public VRow
- {
- public:
- DynamicVfDtl();
- };
-
-
- // -------------------------------------------------------------------------
- // Class DynamicVfFtr
- // -------------------------------------------------------------------------
- class DynamicVfFtr : public VHeader
- {
- public:
- DynamicVfFtr() {};
- };
-
-
- // -------------------------------------------------------------------------
- // Class DynamicVf
- // -------------------------------------------------------------------------
- class DynamicVf : public VForm
- {
- protected:
- TestDataArray m_data; // Our test data
- int m_nFldCnt; // number of data fields
- BOOL m_bDropSource; // TRUE if we are a drop source
-
- public:
- DynamicVf();
- virtual ~DynamicVf() {};
-
- void ResetFieldCount();
- int CalcFieldCount(VRow *pRow);
- BOOL LoadVfbFile(LPCSTR szVfbFile); // overridden
- CPalette* GetBackgroundPalette();
-
- BOOL DropSource() { return m_bDropSource; }
- void DropSource(BOOL bFlag) { m_bDropSource = bFlag; }
-
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(DynamicVf)
- // public:
- protected:
- //}}AFX_VIRTUAL
-
- protected:
- virtual VRow* InitRow();
-
- // --- the following functions deal with the Data ---
- virtual BOOL OnGetRow(VRow* pRow); // Gets row for screen
- // virtual BOOL OnGetRptRow(VRow* pRow); // Gets row for report
- virtual BOOL OnSaveRow(VRow* pRow); // Save row from screen
- virtual BOOL OnAddRow(VRow* pRow); // Add a row
- virtual void OnStartAdd(VRow* pRow); // Start of Add: Defaults
- virtual BOOL OnDelete(); // Delete row(s)
- // virtual void OnClick(VRow* pRow, int nId);
-
- virtual BOOL OnBeginDrag(long nRowId); // Use as a Drag Source
- virtual BOOL OnDrop(long nRowId,
- COleDataObject* pDataObject, DROPEFFECT dropEffect);
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(DynamicVf)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- };
-
- #endif // __DYNAMICVF_H__
-