home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dokpr1.zip / mwindow.h < prev    next >
C/C++ Source or Header  |  1995-08-24  |  6KB  |  193 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *                                                                        *
  4.  *          This code is copyright (c) 1994                               *
  5.  *                     Athena Design, Inc.                                *
  6.  *                                                                        *
  7.  *                                                                        *
  8.  *                ALL RIGHTS RESERVED                                     *
  9.  *                                                                        *
  10.  *                                                                        *
  11.  *                                                                        *
  12.  *                                                                        *
  13.  *                                                                        *
  14.  **************************************************************************/
  15.  
  16. /*
  17.     this is the abstract class that handles the window functions
  18.  
  19.     To change default behavior, over-ride any of the methods listed below
  20.  
  21.     1-24-94 dpp
  22.  
  23.     94-09-03 dpp added support for getting MRect's
  24.     94-09-15 dpp changed #define statements to consts and updateLayerNumber()
  25.     94-09-21 dpp added Drag & Drop support
  26. */
  27.  
  28. #ifndef _MH_window
  29.  
  30. #define _MH_window
  31.  
  32.  
  33. #include "os2h.h"
  34.  
  35. #include "view.h"
  36.  
  37. class MChange;
  38. class MRect;
  39. class MPoint;
  40. class MDraw;
  41. // class MView;
  42.  
  43. #if defined(M2Z) || defined(M2NT)
  44. // class MWindow : public MObject
  45. class MWindow : public MView
  46. #elif defined(M2MAC)
  47. #include "bwindow.h"
  48.  
  49. class MWindow : public MBWindow
  50. #endif
  51. {
  52.     public:
  53.     MWindow();
  54.     virtual ~MWindow();
  55.  
  56.     virtual void setUp(const MRect *,int = 0);
  57.     virtual void cleanUp();
  58.  
  59.     //virtual HWND getFrameWindow() {return frame;};
  60.     //virtual HWND getClientWindow() {return getView();};
  61.     //virtual void getFrameRect(MRect *);
  62.     //virtual void getRect(MRect *re) {getClientWindowViewRect(re);};
  63.     //virtual void getViewRect(MRect *re) {getClientWindowViewRect(re);};
  64.  
  65.  
  66.     //virtual int changedSize(MChange *) {return 0;};
  67.     //virtual int resetView(MChange *) {return 0;};
  68.     //virtual int hasDrawSelf() {return 0;};
  69.  
  70.     //virtual int canExecute(int,int &flags) {flags = 0; return 0;};
  71.     //virtual int handleChar( unsigned int, unsigned int, int & ) { return 0; };
  72.  
  73.  
  74.     // force a window re-draw
  75.     virtual void update();
  76.  
  77.     virtual int drawSelf(MDraw *,const MRect *);
  78.  
  79.     //virtual void cycleCalcIndicator() {};
  80.  
  81.     // perform a REXX function
  82.     // virtual void threadRexxFuncs() {};
  83.  
  84.  
  85.     // virtual void setFocus() { WinSetFocus( HWND_DESKTOP, client ); };
  86.     virtual void setFocus();
  87.  
  88.     virtual void makeActive();
  89.     
  90.     // prepare the window to be closed
  91.     // virtual void aboutToDestroy();
  92.  
  93.  
  94.     // data member access
  95.  
  96.     
  97.     virtual void invalidateRect(const MRect *);
  98.     virtual void updateWindow();
  99.     
  100. // Mesa-unpacked, not system dependent, windowing Messages
  101.  
  102. //    virtual int vertScroll( int, int, int, int & ) { return 0; };
  103. //    virtual int horizScroll( int, int, int, int & ) { return 0; };
  104.  
  105.     // MsetFocus takes the current window, the focus-window, a state
  106.     // (1 = getting focus, 0 = losing focus)
  107.     // virtual int MsetFocus( unsigned long, unsigned long, int, int & ) { return 0; };
  108.     
  109.     // size takes old x, old y, new x, new y
  110.     virtual int size( int, int, int, int, int & ) { return 0; };
  111.     // sysCommand takes a command, a source, and a mouse-or-keyboard flag
  112.     // virtual int sysCommand( unsigned int, int, int, int & ) { return 0; };
  113.     // mouseMove takes a new point, and keyboard flags
  114.     //virtual int mouseMove( const MPoint *, int, int &) {return 0;};
  115.     // close
  116.     // virtual int Mclose( unsigned long, int & ) {return 0;};
  117.     // activate
  118.     virtual int activate( unsigned long, int, int &) {return 0;};
  119.     virtual int Mhelp( unsigned int, int & ) { return 0; };
  120.     virtual int command( unsigned int, int & ) { return 0; };
  121.     virtual int comboButton( int & ) { return 0; };
  122.     // virtual int contextMenu( const MPoint *, int & ) { return 0; };
  123.     virtual int control( unsigned int, unsigned int, int & ) { return 0; };
  124.     
  125.  
  126. #if defined(M2Z) || defined(M2NT)
  127.     //virtual void setFrameWindow(HWND);
  128.     //virtual void setClientWindow(HWND);
  129.     //virtual MRESULT winDestroy(HWND hw,ULONG,MPARAM,MPARAM,int &handled);
  130.     // virtual void getFrameRectL(RECTL *);
  131.  
  132.     static int isWindowMaximized(HWND);
  133.     static int isWindowMinimized(HWND);
  134.     static int isMesaWindow(HWND);
  135.  
  136.     virtual HWND createStdWindow(HWND,ULONG,PULONG,PSZ,
  137.                 ULONG,HMODULE,ULONG,PHWND);
  138. /*
  139.     virtual HWND createWindow (HWND,PSZ,ULONG,LONG,LONG,LONG,LONG,
  140.                 HWND ,HWND);
  141. */
  142. #endif
  143.  
  144. #ifdef M2MAC
  145.  
  146.     virtual void getClientWindowViewRect(MRect *);
  147.     virtual  HWND getView();
  148.     virtual HWND getFrameWindow() {return getView();};
  149.     virtual void aboutToDestroy();
  150.  
  151.     virtual int Mclose(HWND, int & ) {return 0;};
  152.     virtual int winUpdateSheet(MChange *) {return 0;};
  153.     virtual int winPing(int,int) {return 0;};
  154.     virtual int changedSize(MChange *) {return 0;};
  155.     virtual int resetView(MChange *) {return 0;};
  156.     // sent to a window when a display format has changed
  157.     virtual void formatChanged(MChange *) {};
  158.  
  159.     // sent to a window when the data in the worksheet has changed
  160.     virtual void contentsChanged(MChange *) {};
  161.  
  162.     virtual void percentChanged(int) {};
  163.     virtual void updateLayerNumber(int) {};
  164.     //dpr added
  165.      virtual void memOpenRevert(int &) {};
  166.     virtual void cycleCalcIndicator() {};
  167.  
  168. // ifdef M2MAC
  169. #endif
  170.  
  171.     private:
  172. #if defined(M2Z) || defined(M2NT)
  173.     // HWND frame;
  174. #endif
  175.     int ___notUsed;
  176.     
  177. };
  178.  
  179. #if defined(M2Z) || defined(M2NT)
  180. extern MRESULT EXPENTRY handleWindowProc(HWND , ULONG , MPARAM ,MPARAM );
  181.  
  182. extern MRESULT EXPENTRY appHandleWindowProc(HWND , ULONG , MPARAM ,MPARAM );
  183. #endif
  184.  
  185.  
  186. // user level messages that get sent to the system and dispatched to windows
  187.  
  188.  
  189. // #ifndef _MH_window
  190.  
  191. #endif
  192.  
  193.