// Modified by:
// Created: 26.10.99
// RCS-ID: $Id$
-// Copyright: (c) wxWindows team
+// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
m_isChecked = FALSE;
m_id = id;
m_kind = kind;
+ if (m_id == wxID_ANY)
+ m_id = wxNewId();
+ if (m_id == wxID_SEPARATOR)
+ m_kind = wxITEM_SEPARATOR;
}
wxMenuItemBase::~wxMenuItemBase()
// specified
wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
{
+ // wxPrintf( wxT("label %s\n"), label.c_str() );
+
// check for accelerators: they are given after '\t'
int posTab = label.Find(wxT('\t'));
if ( posTab != wxNOT_FOUND ) {
#endif // wxUSE_ACCEL
+bool wxMenuBase::ms_locked = true;
+
// ----------------------------------------------------------------------------
// wxMenu ctor and dtor
// ----------------------------------------------------------------------------
{
wxCHECK_RET( submenu, _T("can't add a NULL submenu") );
- if ( m_menuBar )
- {
- submenu->Attach(m_menuBar);
- }
-
submenu->SetParent((wxMenu *)this);
}
// window will be used.
void wxMenuBase::UpdateUI(wxEvtHandler* source)
{
+ if (GetInvokingWindow())
+ {
+ // Don't update menus if the parent
+ // frame is about to get deleted
+ wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() );
+ if (tlw && wxPendingDelete.Member(tlw))
+ return;
+ }
+
if ( !source && GetInvokingWindow() )
source = GetInvokingWindow()->GetEventHandler();
if ( !source )
// wxMenu attaching/detaching to/from menu bar
// ----------------------------------------------------------------------------
+wxMenuBar* wxMenuBase::GetMenuBar() const
+{
+ if(GetParent())
+ return GetParent()->GetMenuBar();
+ return m_menuBar;
+}
+
void wxMenuBase::Attach(wxMenuBarBase *menubar)
{
// use Detach() instead!