magbar.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 4k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. /******************************************************************************
  2. Module name: MagBar.h
  3. Written by:  Jeffrey Richter
  4. Purpose:     ShellRun class description file.
  5. ******************************************************************************/
  6. #if !defined(AFX_MAGBAR_H__B3056D65_965F_11D0_B287_00A0C90DA742__INCLUDED_)
  7. #define AFX_MAGBAR_H__B3056D65_965F_11D0_B287_00A0C90DA742__INCLUDED_
  8. #include "AppBar.h"
  9. #include "ZoomRect.h"
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #define USEONESTRETCHBLT 1
  14. #include <DDraw.h>
  15. class CMagnifyDlg;
  16. class CMagBar : public CAppBar {
  17. protected:  // Internal implementation state variables
  18.    // CSRBar's class-specific constants
  19.    static const TCHAR m_szRegSubkey[];
  20.    CSize m_szMinTracking;  // The minimum size of the client area
  21. #ifdef USEONESTRETCHBLT
  22.    CDC m_dcOffScreen;
  23.    HBITMAP m_hbmOffScreen;
  24. #else
  25.    CDC m_dcIconBuffer;
  26.    CBitmap m_bmIcon;
  27. #endif
  28.    BOOL m_bSizingOrMoving;
  29.    CZoomRect m_wndZoomRect;
  30.    LPDIRECTDRAW m_IDirectDraw;
  31. public:  // Public member functions
  32. CMagBar(CMagnifyDlg* pwndSettings);
  33. protected:  // Internal implementation functions
  34.    void HideFloatAdornments (BOOL fHide);
  35. protected:  // Overridable functions
  36.    void OnAppBarStateChange (BOOL fProposed, UINT uStateProposed);
  37. // Dialog Data
  38. //{{AFX_DATA(CMagBar)
  39. enum { IDD = IDD_STATIONARY };
  40. //}}AFX_DATA
  41. // Overrides
  42. // ClassWizard generated virtual function overrides
  43. //{{AFX_VIRTUAL(CMagBar)
  44. public:
  45. virtual BOOL PreTranslateMessage(MSG* pMsg);
  46. protected:
  47. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  48. //}}AFX_VIRTUAL
  49. // Implementation
  50. protected:
  51. void SetupOffScreenDC();
  52. void CMagBar::OnCancel();
  53. LRESULT OnEventXMove(WPARAM wParam, LPARAM lParam, BOOL fLastShowPos);
  54. LRESULT OnEventCaretMove(WPARAM wParam, LPARAM lParam);
  55. LRESULT OnEventFocusMove(WPARAM wParam, LPARAM lParam);
  56. LRESULT OnEventMouseMove(WPARAM wParam, LPARAM lParam);
  57. // Generated message map functions
  58. //{{AFX_MSG(CMagBar)
  59. virtual BOOL OnInitDialog();
  60. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  61. afx_msg void OnSize(UINT nType, int cx, int cy);
  62. afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
  63. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  64. afx_msg void OnPaint();
  65. afx_msg void OnTimer(UINT nIDEvent);
  66. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  67. afx_msg void OnDestroy();
  68. afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  69. afx_msg void OnAppbarCopyToClipboard();
  70. afx_msg void OnClose();
  71. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  72. //}}AFX_MSG
  73. afx_msg LRESULT OnEnterSizeMove(WPARAM wParam, LPARAM lParam);
  74. afx_msg LRESULT OnExitSizeMove(WPARAM wParam, LPARAM lParam);
  75. DECLARE_MESSAGE_MAP()
  76. private:
  77. CPalette m_hpalPhysical;
  78.    BOOL m_fShowCrossHair;
  79.    int m_cxZoomed, m_cyZoomed;
  80.    POINT m_ptZoom;
  81.    BOOL m_fShowZoomRect;   // Persistent: true if we show (via DrawZoomRect) where the zoomed area is.
  82.    CDC m_dcMem;
  83. private:
  84.    CMagnifyDlg* m_pwndSettings;
  85.    UINT MagLevel();
  86.    BOOL TrackText();
  87.    BOOL TrackSecondaryFocus();
  88.    BOOL TrackCursor();
  89.    BOOL TrackFocus();
  90.    BOOL InvertColors();
  91.    enum { eRefreshTimerId = 55, eRefreshTimerInterval = 500 /* milliseconds */};
  92.    VOID DoTheZoomIn(CDC* pdc, BOOL fShowCrossHair);
  93.    VOID ZoomView (WPARAM ZoomChangeCode);
  94.    VOID MoveView(INT nDirectionCode, BOOL fFast, BOOL fPeg);
  95.    VOID DrawZoomRect();
  96.    VOID CalcZoomedSize();
  97. public:
  98. VOID ZoomChanged() {CalcZoomedSize();SetupOffScreenDC();}
  99. VOID CopyToClipboard();
  100. };
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  103. #endif // !defined(AFX_MAGBAR_H__B3056D65_965F_11D0_B287_00A0C90DA742__INCLUDED_)
  104. //////////////////////////////// End of File //////////////////////////////////