wxMenu::Append (and similar) now return a pointer to the wxMenuItem
that was added. Checked on MSW, GTK, and Mac, other port authors please double check changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -415,11 +415,11 @@ void wxMenu::EndRadioGroup()
|
||||
m_nStartRadioGroup = -1;
|
||||
} // end of wxMenu::EndRadioGroup
|
||||
|
||||
bool wxMenu::DoAppend(
|
||||
wxMenuItem* wxMenu::DoAppend(
|
||||
wxMenuItem* pItem
|
||||
)
|
||||
{
|
||||
wxCHECK_MSG( pItem, FALSE, _T("NULL item in wxMenu::DoAppend") );
|
||||
wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") );
|
||||
|
||||
bool bCheck = FALSE;
|
||||
|
||||
@@ -471,7 +471,7 @@ bool wxMenu::DoAppend(
|
||||
|
||||
if (!wxMenuBase::DoAppend(pItem) || !DoInsertOrAppend(pItem))
|
||||
{
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
if (bCheck)
|
||||
{
|
||||
@@ -480,20 +480,22 @@ bool wxMenu::DoAppend(
|
||||
//
|
||||
pItem->Check(TRUE);
|
||||
}
|
||||
return TRUE;
|
||||
return pItem;
|
||||
} // end of wxMenu::DoAppend
|
||||
|
||||
bool wxMenu::DoInsert(
|
||||
wxMenuItem* wxMenu::DoInsert(
|
||||
size_t nPos
|
||||
, wxMenuItem* pItem
|
||||
)
|
||||
{
|
||||
return ( wxMenuBase::DoInsert( nPos
|
||||
,pItem) &&
|
||||
if ( wxMenuBase::DoInsert( nPos
|
||||
,pItem) &&
|
||||
DoInsertOrAppend( pItem
|
||||
,nPos
|
||||
)
|
||||
);
|
||||
))
|
||||
return pItem;
|
||||
else
|
||||
return NULL;
|
||||
} // end of wxMenu::DoInsert
|
||||
|
||||
wxMenuItem* wxMenu::DoRemove(
|
||||
|
Reference in New Issue
Block a user