home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / LISTBOX.H < prev    next >
C/C++ Source or Header  |  1993-09-24  |  2KB  |  55 lines

  1. // -------- listbox.h
  2.  
  3. #ifndef LISTBOX_H
  4. #define LISTBOX_H
  5.  
  6. #include "textbox.h"
  7.  
  8. const int LISTSELECTOR = 4; // selected list box entry
  9.  
  10. class ListBox : public TextBox    {
  11.     Bool addmode;       // adding extended selections mode
  12.     int anchorpoint;    // anchor point for extended selections
  13.     int selectcount;    // count of selected items
  14.  
  15.     void OpenWindow();
  16. protected:
  17.     int selection;        // current selection
  18.     virtual void ClearSelection();
  19. public:
  20.     ListBox(const char *ttl, int lf, int tp, int ht, int wd,
  21.         DFWindow *par=0) : TextBox(ttl, lf, tp, ht, wd, par)
  22.             { OpenWindow(); }
  23.     ListBox(const char *ttl, int ht, int wd, DFWindow *par=0)
  24.                         : TextBox(ttl, ht, wd, par)
  25.             { OpenWindow(); }
  26.     ListBox(int lf, int tp, int ht, int wd, DFWindow *par=0)
  27.                         : TextBox(lf, tp, ht, wd, par)
  28.             { OpenWindow(); }
  29.     ListBox(int ht, int wd, DFWindow *par=0) : TextBox(ht,wd,par)
  30.             { OpenWindow(); }
  31.     ListBox(const char *ttl)    : TextBox(ttl)
  32.             { OpenWindow(); }
  33.     // -------- listbox API messages
  34.     virtual void ClearText();
  35.     virtual void Paint();
  36.     virtual void Keyboard(int key);
  37.     virtual void SetSelection(int sel);
  38.     virtual void ButtonReleased(int mx, int my);
  39.     virtual void LeftButton(int mx, int my);
  40.     virtual void DoubleClick(int mx, int my);
  41.     virtual int Selection() { return selection; }
  42.     virtual void ScrollUp();
  43.     virtual void ScrollDown();
  44.     virtual void ScrollRight();
  45.     virtual void ScrollLeft();
  46.     virtual void PageUp();
  47.     virtual void PageDown();
  48.     virtual void PageRight();
  49.     virtual void PageLeft();
  50. };
  51.  
  52. #endif
  53.  
  54.  
  55.