home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / kwclass.zip / KFILLST.HPP < prev    next >
C/C++ Source or Header  |  1994-04-18  |  1KB  |  68 lines

  1. #ifndef _KFILLST_
  2.   #define _KFILLST_
  3.  
  4. #ifndef _ILISTBOX_
  5.   #include <ilistbox.hpp>
  6. #endif
  7.  
  8. #ifndef _KLSTHDR_
  9.   #include <klsthdr.hpp>
  10. #endif
  11.  
  12. #ifndef _ISTRING_
  13.   #include <istring.hpp>
  14. #endif
  15.  
  16.  
  17. class _Export KFileListHandler : public IHandler
  18. {
  19.   public:
  20.     virtual Boolean dispatchHandlerEvent(IEvent &event);
  21.  
  22.   protected:
  23.     virtual Boolean fillList(IEvent &event) = 0;
  24. };
  25.  
  26.  
  27. class _Export KFileListBox : public IListBox
  28.                            , public KListHandler
  29.                            , public KFileListHandler
  30. {
  31.   public:
  32.     KFileListBox(unsigned long windowId, 
  33.                  IWindow *parentWin, 
  34.                  IWindow *ownerWin, 
  35.                  const IRectangle &rect=IRectangle(),
  36.                  const char *files = "*.*",
  37.                  ITextControl *targetWin=0,
  38.                  const IListBox::Style &style=defaultStyle())
  39.       : IListBox(windowId, parentWin, ownerWin, rect, style)
  40.       , KListHandler(targetWin)
  41.       , spec(files)
  42.     {
  43.       KListHandler::handleEventsFor(this);
  44.       KFileListHandler::handleEventsFor(this);
  45.     }
  46.  
  47.     Boolean fill();
  48.  
  49.     const char *fileSpec() const 
  50.     { 
  51.       return spec; 
  52.     }
  53.  
  54.     KFileListBox &setFileSpec(const char *fileSpec) 
  55.     { 
  56.       spec = fileSpec; 
  57.       return *this; 
  58.     }
  59.  
  60.   protected:
  61.     virtual Boolean fillList(IEvent &event);
  62.  
  63.   private:
  64.     IString                        spec;
  65. };
  66.  
  67. #endif
  68.