fix asserts for dropdown items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -137,6 +137,7 @@ public:
|
|||||||
wxFAIL_MSG( _T("unknown toolbar child type") );
|
wxFAIL_MSG( _T("unknown toolbar child type") );
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
|
case wxITEM_DROPDOWN:
|
||||||
case wxITEM_NORMAL:
|
case wxITEM_NORMAL:
|
||||||
return GTK_TOOLBAR_CHILD_BUTTON;
|
return GTK_TOOLBAR_CHILD_BUTTON;
|
||||||
}
|
}
|
||||||
@@ -520,14 +521,11 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
|
|||||||
int posGtk = 0;
|
int posGtk = 0;
|
||||||
if ( pos > 0 )
|
if ( pos > 0 )
|
||||||
{
|
{
|
||||||
size_t i;
|
for ( size_t i = 0; i < pos; i++ )
|
||||||
for (i = 0; i < pos; i++)
|
|
||||||
{
|
{
|
||||||
posGtk++;
|
posGtk++;
|
||||||
|
|
||||||
|
// if we have a dropdown menu, we use 2 GTK tools internally
|
||||||
// if we have a dropdown menu, we use 2 GTK tools
|
|
||||||
// internally
|
|
||||||
wxToolBarToolsList::compatibility_iterator node = m_tools.Item( i );
|
wxToolBarToolsList::compatibility_iterator node = m_tools.Item( i );
|
||||||
wxToolBarTool *tool = (wxToolBarTool*) node->GetData();
|
wxToolBarTool *tool = (wxToolBarTool*) node->GetData();
|
||||||
if ( tool->IsButton() && (tool->GetKind() == wxITEM_DROPDOWN) )
|
if ( tool->IsButton() && (tool->GetKind() == wxITEM_DROPDOWN) )
|
||||||
|
Reference in New Issue
Block a user