IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
#endif
-// convenience macros
-#define GetHMENU() ((HMENU)GetHMenu())
-#define GetHMenuOf(menu) ((HMENU)menu->GetHMenu())
-
// ============================================================================
// implementation
// ============================================================================
pData = label;
}
- if ( !::AppendMenu(GetHMENU(), flags, id, pData) )
+ if ( !::AppendMenu(GetHmenu(), flags, id, pData) )
{
wxLogLastError("AppendMenu");
}
mii.fMask = MIIM_STATE;
mii.fState = MFS_DEFAULT;
- if ( !SetMenuItemInfo(GetHMENU(), (unsigned)id, FALSE, &mii) )
+ if ( !SetMenuItemInfo(GetHmenu(), (unsigned)id, FALSE, &mii) )
{
wxLogLastError(_T("SetMenuItemInfo"));
}
wxCHECK_RET( node, _T("wxMenu::Delete(): item doesn't exist") );
- HMENU menu = GetHMENU();
+ HMENU menu = GetHmenu();
wxMenu *pSubMenu = item->GetSubMenu();
if ( pSubMenu != NULL ) {
bool hasNoTitle = m_title.IsEmpty();
m_title = label;
- HMENU hMenu = GetHMENU();
+ HMENU hMenu = GetHmenu();
if ( hasNoTitle )
{
// other
// ---------------------------------------------------------------------------
-bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
-{
- menu->SetInvokingWindow(this);
- menu->UpdateUI();
-
- HWND hWnd = (HWND) GetHWND();
- HMENU hMenu = (HMENU)menu->GetHMenu();
- POINT point;
- point.x = x;
- point.y = y;
- ::ClientToScreen(hWnd, &point);
- wxCurrentPopupMenu = menu;
- ::TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, point.x, point.y, 0, hWnd, NULL);
- wxYield();
- wxCurrentPopupMenu = NULL;
-
- menu->SetInvokingWindow(NULL);
-
- return TRUE;
-}
-
void wxMenu::Attach(wxMenuBar *menubar)
{
// menu can be in at most one menubar because otherwise they would both
wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked(): no such item") );
- int flag = ::GetMenuState(GetHMenuOf(itemMenu), id, MF_BYCOMMAND);
+ int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND);
return (flag & MF_CHECKED) != 0;
}
wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled(): no such item") );
- int flag = ::GetMenuState(GetHMenuOf(itemMenu), id, MF_BYCOMMAND) ;
+ int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND) ;
return (flag & MF_ENABLED) != 0;
}
id = pos;
}
- if ( ::ModifyMenu(GetHMENU(), pos, MF_BYPOSITION | MF_STRING | flagsOld,
+ if ( ::ModifyMenu(GetHmenu(), pos, MF_BYPOSITION | MF_STRING | flagsOld,
id, label) == 0xFFFFFFFF )
{
wxLogLastError("ModifyMenu");
len++; // for the NUL character
wxString label;
- ::GetMenuString(GetHMENU(), pos, label.GetWriteBuf(len), len, MF_BYCOMMAND);
+ ::GetMenuString(GetHmenu(), pos, label.GetWriteBuf(len), len, MF_BYCOMMAND);
label.UngetWriteBuf();
return label;
a_menu->Attach(this);
- if ( !::AppendMenu(GetHMENU(), MF_POPUP | MF_STRING,
+ if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
(UINT)submenu, title) )
{
wxLogLastError(_T("AppendMenu"));