home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / thrd1.zip / threads.hpp < prev    next >
Text File  |  1994-03-07  |  1KB  |  56 lines

  1. #include <iapp.hpp>
  2. #include <ithread.hpp>
  3. #include <istattxt.hpp>
  4. #include <iframe.hpp>
  5. #include <imenubar.hpp>
  6. #include <icmdhdr.hpp>
  7. #include <iobjwin.hpp>
  8. #include <imnitem.hpp>
  9.  
  10. #include "iuserhdr.hpp"
  11.  
  12. #include "threads.h"
  13.  
  14. class MyOtherWindow : public IFrameWindow
  15.  
  16.   {
  17.   public:
  18.     MyOtherWindow( char *title, unsigned long windowId );
  19.     IStaticText myStaticText;
  20.   };
  21.  
  22.  
  23. class My2ndThread : public IThread, public IUserHandler
  24.  
  25.   {
  26.   public :
  27.     // Passed in IStaticText is an object on thread1 that this thread
  28.     // will write to
  29.     My2ndThread(IStaticText* static1);
  30.     ~My2ndThread();
  31.     void run();
  32.  
  33.     // thread 1 communicates with this thread via this IObjectWindow
  34.     IObjectWindow *myObjectWindow;
  35.   protected :
  36.     // override user virtual function from IUserHandler to read IEvents
  37.     // on the object window
  38.     Boolean user( IEvent &evt );
  39.   private:
  40.     MyOtherWindow *my2ndWindow, *my3rdWindow, *my4thWindow, *my5thWindow;
  41.     IStaticText* t1Static;
  42.   };
  43.  
  44. class MyWindow : public ICommandHandler, public IFrameWindow
  45.   {
  46.   public:
  47.     MyWindow( ) ;
  48.     ~MyWindow();
  49.   protected:
  50.     Boolean command( ICommandEvent &evt );
  51.   private:
  52.     IMenuBar myMenuBar;
  53.     IStaticText myStaticText;
  54.     My2ndThread my2ndThread;
  55.   };
  56.