#include <ev_Win32Menu.h>
Public Member Functions | |
EV_Win32Menu (XAP_Win32App *pWin32App, const EV_EditEventMapper *pEEM, const char *szMenuLayoutName, const char *szMenuLabelSetName) | |
~EV_Win32Menu () | |
void | destroy () |
bool | synthesizeMenu (XAP_Frame *pFrame, HMENU menuRoot) |
bool | onCommand (AV_View *pView, HWND hWnd, WPARAM wParam) |
bool | onInitMenu (XAP_Frame *pFrame, AV_View *pView, HWND hWnd, HMENU hMenuBar) |
bool | onMenuSelect (XAP_Frame *pFrame, AV_View *pView, HWND hWnd, HMENU hMenu, WPARAM wParam) |
HMENU | getMenuHandle () const |
XAP_Menu_Id | MenuIdFromWmCommand (UINT cmd) |
UINT | WmCommandFromMenuId (XAP_Menu_Id id) |
virtual bool | _doAddMenuItem (UT_uint32) |
void | onDrawItem (HWND hwnd, WPARAM wParam, LPARAM lParam) |
void | onMeasureItem (HWND hwnd, WPARAM wParam, LPARAM lParam) |
LPARAM | onMenuChar (HWND hwnd, WPARAM wParam, LPARAM lParam) |
void | setTrackMenu (bool bTrack) |
Protected Member Functions | |
void | _setBitmapforID (HMENU hMenu, XAP_Menu_Id id, UINT cmd) |
Static Protected Member Functions | |
static bool | _isAMenuBar (XAP_Menu_Id id, HMENU hMenu) |
static HBITMAP | _loadBitmap (XAP_Menu_Id id, int width, int height, const UT_RGBColor &color) |
Protected Attributes | |
XAP_Win32App * | m_pWin32App |
const EV_EditEventMapper * | m_pEEM |
EV_Menu_Bitmap * | m_pArMenuBitmaps |
HMENU | m_myMenu |
UINT | m_nBitmapCX |
UINT | m_nBitmapCY |
HFONT | m_hFont |
UT_Vector | m_vecItems |
bool | m_bTrack |
UINT | m_iDIR |
std::vector< HBITMAP > | m_vechBitmaps |
EV_Win32Menu::EV_Win32Menu | ( | XAP_Win32App * | pWin32App, | |
const EV_EditEventMapper * | pEEM, | |||
const char * | szMenuLayoutName, | |||
const char * | szMenuLabelSetName | |||
) |
EV_Win32Menu::~EV_Win32Menu | ( | ) |
References m_vechBitmaps.
virtual bool EV_Win32Menu::_doAddMenuItem | ( | UT_uint32 | ) | [inline, virtual] |
Implements EV_Menu.
References UT_ASSERT_HARMLESS, and UT_TODO.
bool EV_Win32Menu::_isAMenuBar | ( | XAP_Menu_Id | id, | |
HMENU | hMenu | |||
) | [static, protected] |
References EV_Menu_Item::id, EV_Menu_Item::szText, and UT_DEBUGMSG.
HBITMAP EV_Win32Menu::_loadBitmap | ( | XAP_Menu_Id | id, | |
int | width, | |||
int | height, | |||
const UT_RGBColor & | color | |||
) | [static, protected] |
void EV_Win32Menu::_setBitmapforID | ( | HMENU | hMenu, | |
XAP_Menu_Id | id, | |||
UINT | cmd | |||
) | [protected] |
References _loadBitmap(), BITMAP_HEIGHT, BITMAP_WITDH, Color, UT_RGBColor::m_bIsTransparent, and m_vechBitmaps.
Referenced by onInitMenu(), and synthesizeMenu().
void EV_Win32Menu::destroy | ( | void | ) |
References m_hFont, m_myMenu, m_vecItems, and UT_VECTOR_PURGEALL.
Referenced by EV_Win32MenuBar::~EV_Win32MenuBar(), and EV_Win32MenuPopup::~EV_Win32MenuPopup().
HMENU EV_Win32Menu::getMenuHandle | ( | void | ) | const [inline] |
XAP_Menu_Id EV_Win32Menu::MenuIdFromWmCommand | ( | UINT | cmd | ) | [inline] |
Referenced by onCommand(), onInitMenu(), and onMenuSelect().
bool EV_Win32Menu::onCommand | ( | AV_View * | pView, | |
HWND | hWnd, | |||
WPARAM | wParam | |||
) |
References EV_EditMethodContainer::findEditMethodByName(), EV_Menu_ActionSet::getAction(), XAP_App::getEditMethodContainer(), XAP_App::getMenuActionSet(), EV_Menu_Action::getMethodName(), EV_Menu_Action::getScriptName(), EV_Menu::invokeMenuMethod(), m_pWin32App, MenuIdFromWmCommand(), UT_ASSERT, and UT_return_val_if_fail.
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
void EV_Win32Menu::onDrawItem | ( | HWND | hwnd, | |
WPARAM | wParam, | |||
LPARAM | lParam | |||
) |
References _loadBitmap(), UT_Win32LocaleString::appendASCII(), BITMAP_HEIGHT, BITMAP_WITDH, UT_Win32LocaleString::c_str(), Color, UT_Win32LocaleString::fromLocale(), EV_Menu_Item::id, UT_UCS2String::length(), m_hFont, m_iDIR, EV_Menu_Item::pMenu, EV_Menu_Item::szText, and UT_ASSERT.
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
References _ev_GetLabelName(), _setBitmapforID(), UT_GenericVector< T >::addItem(), BOOL(), EV_MIS_Bold, EV_MIS_Gray, EV_MIS_Toggled, EV_MLF_BeginPopupMenu, EV_MLF_BeginSubMenu, EV_MLF_EndPopupMenu, EV_MLF_EndSubMenu, EV_MLF_Normal, EV_MLF_Separator, EV_Menu_ActionSet::getAction(), UT_GenericVector< T >::getItemCount(), EV_Menu_LabelSet::getLabel(), EV_Menu_Layout::getLayoutItem(), EV_Menu_Layout::getLayoutItemCount(), XAP_App::getMenuActionSet(), EV_Menu_LayoutItem::getMenuId(), EV_Menu_Action::getMenuItemState(), EV_Menu_LayoutItem::getMenuLayoutFlags(), UT_GenericVector< T >::getNthItem(), EV_Menu_Action::hasDynamicLabel(), EV_Menu_Action::hasGetStateFunction(), EV_Menu_Item::id, m_myMenu, m_pEEM, EV_Menu::m_pMenuLabelSet, EV_Menu::m_pMenuLayout, m_pWin32App, m_vecItems, MenuIdFromWmCommand(), EV_Menu_Item::pMenu, UT_Stack::pop(), UT_Stack::push(), EV_Menu_Item::szText, UT_ASSERT, UT_ASSERT_HARMLESS, UT_IsWinVista(), and WmCommandFromMenuId().
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
void EV_Win32Menu::onMeasureItem | ( | HWND | hwnd, | |
WPARAM | wParam, | |||
LPARAM | lParam | |||
) |
References m_hFont, m_nBitmapCX, m_nBitmapCY, EV_Menu_Item::pMenu, size, and EV_Menu_Item::szText.
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
LPARAM EV_Win32Menu::onMenuChar | ( | HWND | hwnd, | |
WPARAM | wParam, | |||
LPARAM | lParam | |||
) |
References EV_Menu_Item::szText.
Referenced by XAP_Win32FrameImpl::_FrameWndProc().
void EV_Win32Menu::setTrackMenu | ( | bool | bTrack | ) | [inline] |
Referenced by XAP_Win32FrameImpl::_runModalContextMenu().
bool EV_Win32Menu::synthesizeMenu | ( | XAP_Frame * | pFrame, | |
HMENU | menuRoot | |||
) |
References _ev_GetLabelName(), _setBitmapforID(), UT_GenericVector< T >::addItem(), EV_MLF_BeginPopupMenu, EV_MLF_BeginSubMenu, EV_MLF_EndPopupMenu, EV_MLF_EndSubMenu, EV_MLF_Normal, EV_MLF_Separator, flags, EV_Menu_ActionSet::getAction(), UT_Stack::getDepth(), EV_Menu_LabelSet::getLabel(), EV_Menu_Layout::getLayoutItem(), EV_Menu_Layout::getLayoutItemCount(), XAP_App::getMenuActionSet(), EV_Menu_LayoutItem::getMenuId(), EV_Menu_LayoutItem::getMenuLayoutFlags(), EV_Menu_Item::id, m_bTrack, m_pEEM, EV_Menu::m_pMenuLabelSet, EV_Menu::m_pMenuLayout, m_pWin32App, m_vecItems, EV_Menu_Item::pMenu, UT_Stack::pop(), UT_Stack::push(), EV_Menu_Item::szText, UT_ASSERT, UT_ASSERT_HARMLESS, UT_continue_if_fail, UT_DEBUGMSG, UT_IsWinVista(), UT_Stack::viewTop(), and WmCommandFromMenuId().
Referenced by EV_Win32MenuBar::synthesizeMenuBar(), and EV_Win32MenuPopup::synthesizeMenuPopup().
UINT EV_Win32Menu::WmCommandFromMenuId | ( | XAP_Menu_Id | id | ) | [inline] |
Referenced by onInitMenu(), and synthesizeMenu().
bool EV_Win32Menu::m_bTrack [protected] |
Referenced by EV_Win32Menu(), and synthesizeMenu().
HFONT EV_Win32Menu::m_hFont [protected] |
Referenced by destroy(), EV_Win32Menu(), onDrawItem(), and onMeasureItem().
UINT EV_Win32Menu::m_iDIR [protected] |
HMENU EV_Win32Menu::m_myMenu [protected] |
UINT EV_Win32Menu::m_nBitmapCX [protected] |
Referenced by EV_Win32Menu(), and onMeasureItem().
UINT EV_Win32Menu::m_nBitmapCY [protected] |
Referenced by EV_Win32Menu(), and onMeasureItem().
EV_Menu_Bitmap* EV_Win32Menu::m_pArMenuBitmaps [protected] |
const EV_EditEventMapper* EV_Win32Menu::m_pEEM [protected] |
Referenced by onInitMenu(), and synthesizeMenu().
XAP_Win32App* EV_Win32Menu::m_pWin32App [protected] |
Referenced by onCommand(), onInitMenu(), and synthesizeMenu().
std::vector<HBITMAP> EV_Win32Menu::m_vechBitmaps [protected] |
Referenced by _setBitmapforID(), and ~EV_Win32Menu().
UT_Vector EV_Win32Menu::m_vecItems [protected] |
Referenced by destroy(), onInitMenu(), and synthesizeMenu().