home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dho.zip / DHO / SRC / SOURCE.ZIP / listbox.h < prev    next >
C/C++ Source or Header  |  1995-08-27  |  3KB  |  124 lines

  1. /****************************************/
  2. /*    Developer Helper Object Set       */
  3. /*  (C) 1994-95 Thomas E. Bednarz, Jr.  */
  4. /*     All rights reserved              */
  5. /***************************************/
  6.  
  7. /* $Id: listbox.h 1.3 1995/08/13 03:21:12 teb Exp $ */
  8.  
  9. #ifndef __LISTBOX_H__
  10. #define __LISTBOX_H__
  11.  
  12.  
  13.  
  14. #include<winbase.h>
  15. #include<control.h>
  16.  
  17.  
  18.  
  19. //-------------------------------------------------
  20. //   TListBase -- base class for TListBox,
  21. //                TComboBox, and TPullDownList
  22.  
  23. class TListBase : public TControl
  24. {
  25.    protected:
  26.       TListBase(TWinBase *parent, ULONG resource);
  27.       virtual ~TListBase();
  28.  
  29.    public:
  30.       virtual const char *getClassName();
  31.       void addItemAt(char *item, SHORT at);
  32.       void addItemFirst(char *item);
  33.       void addItemLast(char *item);
  34.       void deleteItemAt (SHORT itemNo);
  35.       void deleteAll();
  36.       SHORT getNumItems();
  37.       void setItemText (char *text, SHORT item);
  38.       SHORT getSelectedItem();
  39.       char *getItemAt(SHORT at);
  40.       ULONG getItemLength(SHORT at);
  41.       ULONG getSelectedItemLength();
  42.   
  43.  
  44. };
  45.  
  46.  
  47. //-----------------------------------------------
  48. //  TListBox
  49. class TListBox: public TListBase
  50. {
  51.    public:
  52.       TListBox(TWinBase *parent, ULONG resource);
  53.       TListBox(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  54.                   LONG xWidth, LONG yHeight, BOOL adjustPos);
  55.       TListBox(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  56.                   LONG xWidth, LONG yHeight, BOOL adjutsPos, 
  57.                   char **items, LONG numItems);
  58.  
  59.       virtual ~TListBox();
  60.  
  61.       virtual const char *getClassName();
  62. };
  63.  
  64.  
  65.  
  66.  
  67. //-----------------------------------------------
  68. //  TComboBox
  69. class TComboBox: public TListBase
  70. {
  71.    public:
  72.       TComboBox(TWinBase *parent, ULONG resource);
  73.       TComboBox(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  74.                   LONG xWidth, LONG yHeight, BOOL adjustPos);
  75.       TComboBox(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  76.                   LONG xWidth, LONG yHeight, BOOL adjutsPos, 
  77.                   char **items, LONG numItems);
  78.  
  79.       virtual ~TComboBox();
  80.  
  81.       virtual const char *getClassName();
  82. };
  83.  
  84.  
  85.  
  86. //-----------------------------------------------
  87. //  TPullDownList
  88. class TPullDownList: public TListBase
  89. {
  90.    public:
  91.       TPullDownList(TWinBase *parent, ULONG resource);
  92.       TPullDownList(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  93.                   LONG xWidth, LONG yHeight, BOOL adjustPos);
  94.       TPullDownList(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  95.                   LONG xWidth, LONG yHeight, BOOL adjutsPos, 
  96.                   char **items, LONG numItems);
  97.  
  98.       virtual ~TPullDownList();
  99.  
  100.       virtual const char *getClassName();
  101. };
  102.  
  103.  
  104.  
  105. //-----------------------------------------------
  106. //  TPullDown
  107. class TPullDown: public TListBase
  108. {
  109.    public:
  110.       TPullDown(TWinBase *parent, ULONG resource);
  111.       TPullDown(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  112.                   LONG xWidth, LONG yHeight, BOOL adjustPos);
  113.       TPullDown(TWinBase *parent, ULONG id, LONG xPos, LONG yPos,
  114.                   LONG xWidth, LONG yHeight, BOOL adjutsPos, 
  115.                   char **items, LONG numItems);
  116.  
  117.       virtual ~TPullDown();
  118.  
  119.       virtual const char *getClassName();
  120. };
  121.  
  122. #endif
  123.  
  124.