home *** CD-ROM | disk | FTP | other *** search
/ CICA 1992 November / CICA_MS_Windows_CD-ROM_Walnut_Creek_November_1992.iso / win3 / desktop / profft / magnify.cpp < prev    next >
C/C++ Source or Header  |  1992-04-20  |  2KB  |  67 lines

  1. #include <owl.h>
  2. #define min(a,b) ((a<b)?a:b)
  3. #define max(a,b) ((a<b)?b:a)
  4. const int LINESIZE = 1;
  5. const int PAGESIZE = 10;
  6. const int SCROLLMIN = 10;
  7. const int SCROLLMAX = 200;
  8.  
  9. class TMagnifyApplication : public TApplication
  10. {
  11.     public:
  12.       TMagnifyApplication (LPSTR lpszName, HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow);
  13.     virtual void InitMainWindow();
  14. };
  15.  
  16. class TNotRect
  17. {
  18.     public:
  19.       TNotRect(int X1, int Y1, int X2, int Y2);
  20.     void Hide (HDC hdc);
  21.     void Show (HDC hdc);
  22.     void Move (HDC hdc, int X1, int Y1, int X2, int Y2);
  23.   private:
  24.       BOOL bVisible;
  25.     RECT rCurrent;
  26.  
  27.     void Invert(HDC hdc);
  28. };
  29.  
  30. class TMagnifyWindow : public TWindow
  31. {
  32.     public:
  33.         TMagnifyWindow(PTWindowObject pwParent, LPSTR lpszTitle, PTModule pmModule);
  34.     ~TMagnifyWindow();
  35.     virtual LPSTR GetClassName();
  36.     virtual void GetWindowClass(WNDCLASS&);
  37.  
  38.     virtual void WMCreate(TMessage& Msg) = [WM_CREATE];
  39.     virtual void WMLButtonDown(TMessage& Msg) = [WM_LBUTTONDOWN];
  40.     virtual void WMMouseMove(TMessage& Msg) = [WM_MOUSEMOVE];
  41.         virtual void WMLButtonUp(TMessage& Msg) = [WM_LBUTTONUP];
  42.     virtual void WMVScroll(TMessage& Msg) = [WM_VSCROLL];
  43.     virtual void WMPaint(TMessage& Msg) = [WM_PAINT];
  44.     virtual void WMSize(TMessage& Msg) = [WM_SIZE];
  45.  
  46.   protected:
  47.         BOOL bCapture;
  48.     HDC hdcScreen;
  49.     HDC hdcWindow;
  50.     int nStretch;
  51.     POINT ptAnchor;
  52.     POINT ptLast;
  53.     RECT rClient;
  54.     RECT rSource;
  55.     tNotRect * pnrTrack;
  56.  
  57.     void ClientToSource(LPRECT lpIn, LPRECT lpOut);
  58. };
  59.  
  60. int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
  61. {
  62.     TMagnifyApplication Magnify("Magnify", hInstance, hPrevInstance, lpszCmdLine, nCmdShow);
  63.   Magnify.Run();
  64.   return Magnify.Status;
  65. }
  66.  
  67. TMagni