home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv7.zip / VACPP / IBMCPP / smarts / ICLUI / ICLUI.HPP < prev    next >
Text File  |  1995-06-02  |  3KB  |  99 lines

  1.  
  2. %PROLOG%
  3.  
  4. #include <iframe.hpp>
  5. #include <icmdhdr.hpp>
  6. #include <istring.hpp>
  7. #include <imenubar.hpp>
  8. #include <icanvas.hpp>
  9. #include <istattxt.hpp>
  10.  
  11. #include "helphdlr.hpp"
  12.  
  13. class IHelpWindow;
  14.  
  15. /*************************************************/
  16. /* Class: AppWindow                              */
  17. /*                                               */
  18. /* Purpose: Main window for an ICLUI application */
  19. /*          It is a subclass of IFrameWindow     */
  20. /*          and ICommandHandler.                 */
  21. /*************************************************/
  22. class AppWindow : public IFrameWindow, 
  23.                   public ICommandHandler
  24. {
  25.  
  26.   // Declare friendship with the AppOpenFileFn class which encapsulates
  27.   // a thread function that executes a member function of this class
  28.   //-------
  29.   friend class AppOpenFileFn;
  30.  
  31.  
  32.   public:
  33.  
  34.     // Constructor and destructor
  35.     //------
  36.     AppWindow( unsigned long windowId);
  37.     ~AppWindow();
  38.  
  39.     // Returns true if help is available
  40.     //------
  41.     virtual Boolean isHelpAvailable() const;
  42.  
  43.  
  44.   protected:
  45.  
  46.     // Command event handler function
  47.     //------
  48.     Boolean command(ICommandEvent& cmdevt);
  49.  
  50.     // Opens the requested file and returns true if the file 
  51.     // was opened successfully
  52.     //------
  53.     virtual Boolean openFile();
  54.  
  55.     // Returns true if a file has already been opened
  56.     //------
  57.     virtual Boolean isFileOpen() const;
  58.  
  59.   private:
  60.  
  61.     // Shows product information dialog  
  62.     //------
  63.     virtual void productInfo();
  64.  
  65.     // Overloaded function.  Checks whether a file has been opened 
  66.     // then displays an error message or writes text to the status line.
  67.     // Returns true if no error message was displayed.
  68.     //------
  69.     virtual Boolean writeStatus( const IResourceId status,  
  70.                                  const Boolean isHelpCmd = false);
  71.     virtual Boolean writeStatus( const IString &status, 
  72.                                  const Boolean isHelpCmd = false);
  73.     
  74.     IString         openFileName; // Name of file opened
  75.  
  76.     IMenuBar        menuBar;      // Window menu bar
  77.  
  78.     ICanvas         canvas;       // Client area canvas.  You can change
  79.                                   // this to any other canvas class
  80.                                   // (like ISplitCanvas) or client
  81.                                   // area control (like a container).
  82.  
  83.     IStaticText     statusLine;   // Status information text
  84.  
  85.     IHelpWindow*    help;         // Help window
  86.  
  87.     AppHelpHandler* helpHdlr;     // Help events handler
  88.  
  89.     Boolean         hasHelp;      // Help available flag
  90.  
  91.     /*=====================================================*/
  92.     /*  Add any other window controls here.                */
  93.     /*=====================================================*/
  94.  
  95.  };
  96.  
  97.  
  98.  
  99.