home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / krcls012.zip / KrClass / include / krcto.hpp < prev    next >
Text File  |  1997-01-26  |  1KB  |  67 lines

  1. // Kroni's Classes: Output window for common text output
  2. // (c) 1997 Wolfgang Kronberg
  3. // file: krcto.hpp
  4.  
  5. // **********************************************************************************************************
  6. //
  7. // defines these classes:
  8. //
  9. //   KrCommonTextOutput      Define a window to keep stream output to screen
  10. //
  11. // defines those global symbols for private use:
  12. //
  13. //   _KrStreambuf
  14. //
  15. // **********************************************************************************************************
  16.  
  17.  
  18. #ifndef __KRCTO_HPP__
  19. #define __KRCTO_HPP__
  20.  
  21.  
  22. #include <iostream.h>                            // ostream & Co.
  23.  
  24. #include <imle.hpp>                              // IMultiLineEdit & Co.
  25.  
  26.  
  27.  
  28. class KrCommonTextOutput;                        // Forward for kr_streambuf
  29.  
  30. class _KrStreambuf : public streambuf
  31. {
  32.  
  33. public:
  34.  
  35.   _KrStreambuf (char* c, int len, KrCommonTextOutput* top);
  36.  
  37.   virtual int overflow (int c=EOF);
  38.  
  39. private:
  40.  
  41.   KrCommonTextOutput* textOutputArea;
  42.  
  43. };
  44.  
  45.  
  46. class KrCommonTextOutput : public IMultiLineEdit
  47. {
  48.  
  49. public:
  50.  
  51.   KrCommonTextOutput (unsigned long id, IWindow* parant, IWindow* owner,
  52.                       const IRectangle& initial = IRectangle (),
  53.                       const Style& style = defaultStyle () | readOnly);
  54.  
  55.   ostream & stream ();
  56.  
  57. private:
  58.  
  59.   ostream * outputStream;
  60.   _KrStreambuf* ostrbuf;
  61.   char buffer [200];
  62.  
  63. };
  64.  
  65. #endif
  66.  
  67.