home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / basic / emed15 / samples / owl / emedtapp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-01  |  3.2 KB  |  116 lines

  1. #if !defined(__emedtapp_h)              // Sentry, use file only if it's not already included.
  2. #define __emedtapp_h
  3.  
  4. /*  Project emedit
  5.     Early Morning Software
  6.     Copyright ⌐ 1994. All Rights Reserved.
  7.  
  8.     SUBSYSTEM:    emedit.exe Application
  9.     FILE:         emedtapp.h
  10.     AUTHOR:       Ted Stockwell
  11.  
  12.  
  13.     OVERVIEW
  14.     ========
  15.     Class definition for emeditApp (TApplication).      
  16. */
  17.  
  18.  
  19. #include <owl\owlpch.h>
  20.  
  21. #include <owl\statusba.h>
  22. #include <owl\controlb.h>
  23. #include <owl\buttonga.h>
  24. #include <owl\printer.h>
  25.  
  26. #include <classlib\bags.h>
  27. #include <bivbx.h> // includes definition of ENUM
  28. #pragma hdrstop
  29.  
  30.  
  31. #include "emedtapp.rh" // Definition of all resources.
  32. #include "mdtmssgb.h" // definition of status bar
  33.  
  34.  
  35. // TFileDrop class Maintains information about a dropped file, its name, where it was dropped,
  36. // and whether or not it was in the client area
  37. class TFileDrop {
  38. public:
  39.     operator == (const TFileDrop& other) const {return this == &other;}
  40.  
  41.     char*   FileName;
  42.     TPoint  Point;
  43.     BOOL    InClientArea;
  44.  
  45.     HICON   Icon;
  46.     BOOL    DefIcon;
  47.  
  48.     TFileDrop (char*, TPoint&, BOOL, TModule* module);
  49.     ~TFileDrop ();
  50.  
  51.     const char* WhoAmI ();
  52. private:
  53.     //
  54.     // hidden to prevent accidental copying or assignment
  55.     //
  56.     TFileDrop (const TFileDrop&);
  57.     TFileDrop & operator = (const TFileDrop&);
  58. };
  59.  
  60. typedef TIBagAsVector<TFileDrop> TFileList;
  61. typedef TIBagAsVectorIterator<TFileDrop> TFileListIter;
  62.  
  63.  
  64. //{{TApplication = emeditApp}}
  65. class emeditApp : public TApplication {
  66. private:
  67. //    BOOL            HelpState;                          // Has the help engine been used.
  68. //    BOOL            ContextHelp;                        // SHIFT-F1 state (context sensitive HELP)
  69. //    HCURSOR         HelpCursor;                         // Context sensitive help cursor
  70.  
  71.     // global data used thoughout the app:
  72.     emeditMessageBar* pStatusBar;
  73.     ENUM gDefaultBlockType;
  74.     BOOL gInsertMode;
  75.  
  76. private:
  77.     void SetupSpeedBar (TDecoratedMDIFrame *frame);
  78.     void AddFiles (TFileList* files);
  79.  
  80. public:
  81.     emeditApp ();
  82.     virtual ~emeditApp ();
  83.  
  84.     // Public data members used by the print menu commands and Paint routine in MDIChild.
  85.     TPrinter        *Printer;                           // Printer support.
  86.     BOOL            Printing;                           // Printing in progress.
  87.  
  88.     emeditMessageBar* StatusBar() { return pStatusBar; }
  89.     ENUM GetDefaultBlockType() const { return gDefaultBlockType; }
  90.     void SetDefaultBlockType( ENUM T ) { gDefaultBlockType= T; }
  91.     BOOL GetInsertMode() const { return gInsertMode; }
  92.     void SetInsertMode();
  93. //    void UpdateStatusBar();
  94.  
  95.  
  96. //{{emeditAppVIRTUAL_BEGIN}}
  97. public:
  98.     virtual void InitMainWindow();
  99.     virtual void InitInstance();
  100.     virtual BOOL CanClose ();
  101.     virtual BOOL ProcessAppMsg (MSG& msg);
  102. //{{emeditAppVIRTUAL_END}}
  103. //{{emeditAppRSP_TBL_BEGIN}}
  104. protected:
  105.     void CmHelpContents ();
  106.     void CmHelpUsing ();
  107.     void CmHelpAbout ();
  108.     void EvDropFiles (TDropInfo drop);
  109.     void EvWinIniChange (char far* section);
  110. //{{emeditAppRSP_TBL_END}}
  111. DECLARE_RESPONSE_TABLE(emeditApp);
  112. };    //{{emeditApp}}
  113.  
  114.  
  115. #endif                                      // __emedtapp_h sentry.
  116.