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

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5. #ifndef __VCOMBO_H__
  6. #define __VCOMBO_H__
  7.  
  8. #ifdef VF_STATIC
  9.     #undef AFX_EXT_CLASS
  10.     #define AFX_EXT_CLASS
  11. #endif
  12.  
  13. #include "VCtl.h"
  14. #include "VCtlHelp.h"
  15.  
  16. // -------------------------------------------------------------------------
  17. //  VComboBox helper control.
  18. // -------------------------------------------------------------------------
  19. class AFX_EXT_CLASS VComboBoxHelper : public VCtlHelper
  20. {
  21. protected:
  22.     CComboBox    m_ctlCombo;                // Helper CComboBox class
  23.  
  24. public:
  25.     VComboBoxHelper(CWnd *pParent);
  26.     virtual ~VComboBoxHelper() {};
  27.  
  28.     virtual        int Id()        { return VHELPER_COMBO; }    // Helper Id (index)
  29.     static        int HelperId()    { return VHELPER_COMBO; }    // Helper Id (index)
  30.     virtual        void Hide();
  31.     virtual        void Show(CRect rect);
  32.     CComboBox*    GetControl()    { return &m_ctlCombo; }        // The control
  33.     CWnd*        GetCWnd()        { return &m_ctlCombo; }        // The control
  34. };
  35.  
  36.  
  37. // -------------------------------------------------------------------------
  38. //    VComboBox Control
  39. // -------------------------------------------------------------------------
  40. class AFX_EXT_CLASS VComboBox : public VCtl 
  41. {
  42. protected:
  43.     CStringArray m_data;                // Array of strings
  44.  
  45. public:
  46.     VComboBox();
  47.     VComboBox(VRow *pRow, int nId, LPCTSTR szText, int x, int y, int cx, int cy);
  48.     VComboBox(VComboBox &x) { *this = x; }            // Copy Constructor
  49.     VComboBox&    operator =(VComboBox &x);            // Assignment Operator
  50.  
  51.     // --------- Get Member Functions --------------
  52.     CStringArray* GetStringArray()    { return &m_data; }
  53.     
  54.     // --------- Set Member Functions --------------
  55.     void    Init(VRow *pRow, int nId, LPCTSTR szText, int x, int y, int cx, int cy);
  56.  
  57.     // --------- Implementation Functions --------------
  58.     void    AddString(LPCTSTR szText)    { m_data.Add(szText); }
  59.     void    ResetContent()                { m_data.RemoveAll(); }
  60.     long    GetCount()                    { return m_data.GetSize(); }
  61.     CString    GetString(int nItem);
  62.  
  63.     virtual int  IsA()            { return VCTL_COMBOBOX; }
  64.     virtual void OnDraw(CDC *pDC, LPRECT pRect=0, BOOL bGridMode=0);
  65.  
  66.     virtual VCtlHelper*    CreateHelper(CWnd *pParent);
  67.     virtual int        HelperId();
  68.     virtual CRect    HelperRect(LPRECT pRect=0, BOOL bGridMode=FALSE);
  69.     virtual BOOL    IsHelperDirty(VCtlHelper* pHelper);
  70.     virtual BOOL    OnBeginHelper(VCtlHelper* pHelper);    
  71.     virtual BOOL    OnEndHelper(VCtlHelper* pHelper);
  72. };
  73.  
  74. #endif