home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / dragbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.6 KB  |  90 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef __DragEdges_H
  20. #define __DragEdges_H
  21.  
  22. #define DOCKSTYLE_VERTLEFT        1
  23. #define DOCKSTYLE_VERTRIGHT        2
  24. #define DOCKSTYLE_HORZTOP        3
  25. #define DOCKSTYLE_HORZBOTTOM    4
  26.  
  27. class CNSNavFrame;
  28. class CDragBar : public CWnd
  29. {
  30. // Construction
  31. public:
  32.     CDragBar(CRect& crRect, CNSNavFrame* pDockFrame);
  33.  
  34. //    Wether or not we are currently tracking.
  35. private:
  36.     BOOL m_bDragging;
  37.     CRect m_crTracker;
  38.     CRect m_rectLast;
  39.     CPoint m_cpLBDown;
  40.     CPoint m_ptLast;
  41.     BOOL m_bDitherLast;
  42.     BOOL m_bInDeskCoord;
  43.     CSize m_sizeLast;
  44.     CDC* m_pDC;
  45.     BOOL m_bParentClipChildren;
  46.     void InvertTracker();
  47.     CFrameWnd* m_parentView;
  48.     CNSNavFrame* m_dockedFrame;
  49.     int m_orientation;
  50.  
  51. // Operations
  52. public:
  53.     void SetRect(CRect& rect, BOOL inDeskCoord = FALSE); 
  54.     void GetRect(CRect& rect); 
  55.     void SetParentFrame(CFrameWnd* pFrame) { m_parentView = pFrame;}
  56.     void SetOrientation(int orientation) {m_orientation = orientation;}
  57. // Overrides
  58.     // ClassWizard generated virtual function overrides
  59.     //{{AFX_VIRTUAL(CGridEdge)
  60.     //}}AFX_VIRTUAL
  61.  
  62. // Implementation
  63. public:
  64.     virtual ~CDragBar();
  65.     virtual void PostNcDestroy( );
  66.     // Generated message map functions
  67. protected:
  68.     void InitLoop();
  69.     void CancelLoop();
  70.     BOOL Track();
  71.  
  72.     void CalcClientArea(RECT* lpRectClient);
  73.     void DrawFocusRect(BOOL bRemoveRect = FALSE);
  74.     void EndDrag();
  75.     void Move( CPoint point );
  76.     
  77.     afx_msg void OnMouseMove( UINT nFlags, CPoint point );
  78.     afx_msg void OnDestroy();
  79.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  80.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  81.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  82.     afx_msg void OnPaint();
  83.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  84.     
  85.     DECLARE_MESSAGE_MAP()
  86. };
  87.  
  88. /////////////////////////////////////////////////////////////////////////////
  89. #endif // __DragEdges_H
  90.