/////////////////////////////////////////////////////////////////////////////
-// Name: menu.cpp
+// Name: src/os2/menu.cpp
// Purpose: wxMenu, wxMenuBar, wxMenuItem
// Author: David Webster
// Modified by:
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
- #pragma implementation "menu.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/menu.h"
+
#ifndef WX_PRECOMP
#include "wx/app.h"
#include "wx/frame.h"
- #include "wx/menu.h"
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/log.h"
//
void wxMenu::Init()
{
- m_bDoBreak = FALSE;
+ m_bDoBreak = false;
m_nStartRadioGroup = -1;
//
//
// Find the (new) accel for this item
//
- wxAcceleratorEntry* pAccel = wxGetAccelFromString(pItem->GetText());
+ wxAcceleratorEntry* pAccel = wxAcceleratorEntry::Create(pItem->GetText());
if (pAccel)
pAccel->m_command = pItem->GetId();
if (m_bDoBreak)
{
rItem.afStyle |= MIS_BREAK;
- m_bDoBreak = FALSE;
+ m_bDoBreak = false;
}
//
// event processing
// ---------------------------------------------------------------------------
-bool wxMenu::OS2Command(
- WXUINT WXUNUSED(uParam)
-, WXWORD vId
-)
+bool wxMenu::OS2Command( WXUINT WXUNUSED(uParam),
+ WXWORD vId )
{
//
// Ignore commands from the menu title
)
);
}
- return TRUE;
+ return true;
} // end of wxMenu::OS2Command
// ---------------------------------------------------------------------------
WXHMENU wxMenuBar::Create()
{
- HWND hFrame;
+ HWND hFrame;
if (m_hMenu != 0 )
return m_hMenu;
return true;
} // end of wxMenuBar::Insert
-bool wxMenuBar::Append(
- wxMenu* pMenu
-, const wxString& rsTitle
-)
+bool wxMenuBar::Append( wxMenu* pMenu,
+ const wxString& rsTitle )
{
- WXHMENU hSubmenu = pMenu ? pMenu->GetHMenu() : 0;
+ WXHMENU hSubmenu = pMenu ? pMenu->GetHMenu() : 0;
- wxCHECK_MSG(hSubmenu, FALSE, wxT("can't append invalid menu to menubar"));
+ wxCHECK_MSG(hSubmenu, false, wxT("can't append invalid menu to menubar"));
- wxString sTitle = wxPMTextToLabel(rsTitle);
+ wxString sTitle = wxPMTextToLabel(rsTitle);
if (!wxMenuBarBase::Append(pMenu, sTitle))
- return FALSE;
+ return false;
m_titles.Add(sTitle);
#endif // wxUSE_ACCEL
Refresh();
}
- return TRUE;
+ return true;
} // end of wxMenuBar::Append
wxMenu* wxMenuBar::Remove(