wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxMenu, wxEvtHandler, "wx/menu.h")
wxCOLLECTION_TYPE_INFO( wxMenuItem *, wxMenuItemList ) ;
wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxMenu, wxEvtHandler, "wx/menu.h")
wxCOLLECTION_TYPE_INFO( wxMenuItem *, wxMenuItemList ) ;
template<> void wxCollectionToVariantArray( wxMenuItemList const &theList,
wxAnyList &value)
{
wxListCollectionToAnyList<wxMenuItemList::compatibility_iterator>( theList, value ) ;
}
template<> void wxCollectionToVariantArray( wxMenuItemList const &theList,
wxAnyList &value)
{
wxListCollectionToAnyList<wxMenuItemList::compatibility_iterator>( theList, value ) ;
}
wxBEGIN_PROPERTIES_TABLE(wxMenu)
wxEVENT_PROPERTY( Select, wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent)
wxBEGIN_PROPERTIES_TABLE(wxMenu)
wxEVENT_PROPERTY( Select, wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent)
// the negative id would lead the window (its superclass !) to
// vetoe streaming out otherwise
bool wxMenuBarStreamingCallback( const wxObject *WXUNUSED(object), wxObjectWriter *,
// the negative id would lead the window (its superclass !) to
// vetoe streaming out otherwise
bool wxMenuBarStreamingCallback( const wxObject *WXUNUSED(object), wxObjectWriter *,
wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow, "wx/menu.h", \
wxMenuBarStreamingCallback)
wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow, "wx/menu.h", \
wxMenuBarStreamingCallback)
// ----------------------------------------------------------------------------
wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
// ----------------------------------------------------------------------------
wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
// (popup) menu titles in wxMSW use this ID to indicate that
// it's not a real menu item, so we don't want the check below to
// apply to it
// (popup) menu titles in wxMSW use this ID to indicate that
// it's not a real menu item, so we don't want the check below to
// apply to it
break;
default:
// ids are limited to 16 bits under MSW so portable code shouldn't
// use ids outside of this range (negative ids generated by wx are
// fine though)
break;
default:
// ids are limited to 16 bits under MSW so portable code shouldn't
// use ids outside of this range (negative ids generated by wx are
// fine though)
- wxASSERT_MSG( (id >= 0 && id < SHRT_MAX) ||
- (id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST),
- wxS("invalid id value") );
- m_id = id;
+ wxASSERT_MSG( (itemid >= 0 && itemid < SHRT_MAX) ||
+ (itemid >= wxID_AUTO_LOWEST && itemid <= wxID_AUTO_HIGHEST),
+ wxS("invalid itemid value") );
+ m_id = itemid;
event.SetEventObject( source );
if ( source->ProcessEvent(event) )
{
// if anything changed, update the changed attribute
if (event.GetSetText())
event.SetEventObject( source );
if ( source->ProcessEvent(event) )
{
// if anything changed, update the changed attribute
if (event.GetSetText())
// wxMenu functions forwarded to wxMenuItem
// ----------------------------------------------------------------------------
// wxMenu functions forwarded to wxMenuItem
// ----------------------------------------------------------------------------
wxCHECK_MSG( item, false, wxT("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
wxCHECK_MSG( item, false, wxT("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
wxCHECK_MSG( item, false, wxT("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
wxCHECK_MSG( item, false, wxT("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
wxCHECK_RET( item, wxT("wxMenu::SetLabel: no such item") );
item->SetItemLabel(label);
}
wxCHECK_RET( item, wxT("wxMenu::SetLabel: no such item") );
item->SetItemLabel(label);
}
wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") );
return item->GetItemLabel();
}
wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") );
return item->GetItemLabel();
}
wxCHECK_RET( item, wxT("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
wxCHECK_RET( item, wxT("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
// wxMenuBar searching for items
// ----------------------------------------------------------------------------
// wxMenuBar searching for items
// ----------------------------------------------------------------------------
wxMenuList::const_iterator it;
for ( i = 0, it = m_menus.begin(); !item && (i < count); i++, it++ )
{
wxMenuList::const_iterator it;
for ( i = 0, it = m_menus.begin(); !item && (i < count); i++, it++ )
{
// wxMenuBar functions forwarded to wxMenuItem
// ---------------------------------------------------------------------------
// wxMenuBar functions forwarded to wxMenuItem
// ---------------------------------------------------------------------------
wxCHECK_RET( item, wxT("attempt to check an item which doesn't exist") );
wxCHECK_RET( item->IsCheckable(), wxT("attempt to check an uncheckable item") );
wxCHECK_RET( item, wxT("attempt to check an item which doesn't exist") );
wxCHECK_RET( item->IsCheckable(), wxT("attempt to check an uncheckable item") );
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsChecked(): no such item") );
return item->IsChecked();
}
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsChecked(): no such item") );
return item->IsChecked();
}
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsEnabled(): no such item") );
return item->IsEnabled();
}
wxCHECK_MSG( item, false, wxT("wxMenuBar::IsEnabled(): no such item") );
return item->IsEnabled();
}
wxCHECK_RET( item, wxT("wxMenuBar::SetLabel(): no such item") );
item->SetItemLabel(label);
}
wxCHECK_RET( item, wxT("wxMenuBar::SetLabel(): no such item") );
item->SetItemLabel(label);
}
wxCHECK_MSG( item, wxEmptyString,
wxT("wxMenuBar::GetLabel(): no such item") );
wxCHECK_MSG( item, wxEmptyString,
wxT("wxMenuBar::GetLabel(): no such item") );
wxCHECK_RET( item, wxT("wxMenuBar::SetHelpString(): no such item") );
item->SetHelp(helpString);
}
wxCHECK_RET( item, wxT("wxMenuBar::SetHelpString(): no such item") );
item->SetHelp(helpString);
}
wxCHECK_MSG( item, wxEmptyString,
wxT("wxMenuBar::GetHelpString(): no such item") );
wxCHECK_MSG( item, wxEmptyString,
wxT("wxMenuBar::GetHelpString(): no such item") );