1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| template <class T_Wnd, class T_FrameWnd>
class CTplBitmapMenuWnd : public T_Wnd
{
protected:
CTplBitmapMenuWnd()
: T_Wnd()
{
}
virtual ~CTplBitmapMenuWnd()
{
}
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMIS)
{
if(lpMIS->CtlType == ODT_MENU)
((T_FrameWnd *) AfxGetMainWnd( ))->MeasureItem ( nIDCtl, lpMIS );
else
T_Wnd :: OnMeasureItem(nIDCtl, lpMIS);
}
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
if(lpDIS->CtlType == ODT_MENU)
((T_FrameWnd *) AfxGetMainWnd( ))->DrawItem ( nIDCtl, lpDIS );
else
T_Wnd :: OnDrawItem(nIDCtl, lpDIS);
}
afx_msg void OnInitMenuPopup(CMenu *pPopup, UINT nIndex, BOOL bSysMenu)
{
T_Wnd :: OnInitMenuPopup(pPopup, nIndex, bSysMenu);
if( !bSysMenu )
((T_FrameWnd *) AfxGetMainWnd( ))->InitMenuPopup(pPopup, nIndex,bSysMenu );
}
}; |
Partager