00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CTRLCOOLMENUBAR_H__26AF9FCF_9131_4943_BC04_ED7562A3A004__INCLUDED_)
00023 #define AFX_CTRLCOOLMENUBAR_H__26AF9FCF_9131_4943_BC04_ED7562A3A004__INCLUDED_
00024
00025 #pragma once
00026
00027 #include "CtrlCoolBar.h"
00028
00029
00030 class CCoolMenuBarCtrl : public CCoolBarCtrl
00031 {
00032
00033 public:
00034 CCoolMenuBarCtrl();
00035 virtual ~CCoolMenuBarCtrl();
00036
00037
00038 protected:
00039 CPoint m_pMouse;
00040 HMENU m_hMenu;
00041 CCoolBarItem* m_pSelect;
00042
00043
00044 public:
00045 void SetMenu(HMENU hMenu);
00046 void OpenMenuBar();
00047 BOOL OpenMenuChar(UINT nChar);
00048 protected:
00049 void ShowMenu();
00050 void UpdateWindowMenu(CMenu* pMenu);
00051 void ShiftMenu(int nOffset);
00052 BOOL OnMenuMessage(MSG* pMsg);
00053
00054
00055 public:
00056
00057 virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
00058
00059
00060
00061 protected:
00062 static LRESULT CALLBACK MenuFilter(int nCode, WPARAM wParam, LPARAM lParam);
00063 static CCoolMenuBarCtrl* m_pMenuBar;
00064 static HHOOK m_hMsgHook;
00065
00066
00067 protected:
00068
00069 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00070 afx_msg void OnTimer(UINT nIDEvent);
00071 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00072 afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
00073 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00074 afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
00075 afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho);
00076
00077 afx_msg void OnEnterMenuLoop(BOOL bIsTrackPopupMenu);
00078 afx_msg void OnExitMenuLoop(BOOL bIsTrackPopupMenu);
00079
00080 DECLARE_MESSAGE_MAP()
00081 };
00082
00083
00084
00085 #endif // !defined(AFX_CTRLCOOLMENUBAR_H__26AF9FCF_9131_4943_BC04_ED7562A3A004__INCLUDED_)