home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------
- // Copyright @ 1997 TCK Software, Incorporated
- // All Rights Reserved
- // -------------------------------------------------------------------------
- #ifndef __VCOMBO_H__
- #define __VCOMBO_H__
-
- #ifdef VF_STATIC
- #undef AFX_EXT_CLASS
- #define AFX_EXT_CLASS
- #endif
-
- #include "VCtl.h"
- #include "VCtlHelp.h"
-
- // -------------------------------------------------------------------------
- // VComboBox helper control.
- // -------------------------------------------------------------------------
- class AFX_EXT_CLASS VComboBoxHelper : public VCtlHelper
- {
- protected:
- CComboBox m_ctlCombo; // Helper CComboBox class
-
- public:
- VComboBoxHelper(CWnd *pParent);
- virtual ~VComboBoxHelper() {};
-
- virtual int Id() { return VHELPER_COMBO; } // Helper Id (index)
- static int HelperId() { return VHELPER_COMBO; } // Helper Id (index)
- virtual void Hide();
- virtual void Show(CRect rect);
- CComboBox* GetControl() { return &m_ctlCombo; } // The control
- CWnd* GetCWnd() { return &m_ctlCombo; } // The control
- };
-
-
- // -------------------------------------------------------------------------
- // VComboBox Control
- // -------------------------------------------------------------------------
- class AFX_EXT_CLASS VComboBox : public VCtl
- {
- protected:
- CStringArray m_data; // Array of strings
-
- public:
- VComboBox();
- VComboBox(VRow *pRow, int nId, LPCTSTR szText, int x, int y, int cx, int cy);
- VComboBox(VComboBox &x) { *this = x; } // Copy Constructor
- VComboBox& operator =(VComboBox &x); // Assignment Operator
-
- // --------- Get Member Functions --------------
- CStringArray* GetStringArray() { return &m_data; }
-
- // --------- Set Member Functions --------------
- void Init(VRow *pRow, int nId, LPCTSTR szText, int x, int y, int cx, int cy);
-
- // --------- Implementation Functions --------------
- void AddString(LPCTSTR szText) { m_data.Add(szText); }
- void ResetContent() { m_data.RemoveAll(); }
- long GetCount() { return m_data.GetSize(); }
- CString GetString(int nItem);
-
- virtual int IsA() { return VCTL_COMBOBOX; }
- virtual void OnDraw(CDC *pDC, LPRECT pRect=0, BOOL bGridMode=0);
-
- virtual VCtlHelper* CreateHelper(CWnd *pParent);
- virtual int HelperId();
- virtual CRect HelperRect(LPRECT pRect=0, BOOL bGridMode=FALSE);
- virtual BOOL IsHelperDirty(VCtlHelper* pHelper);
- virtual BOOL OnBeginHelper(VCtlHelper* pHelper);
- virtual BOOL OnEndHelper(VCtlHelper* pHelper);
- };
-
- #endif