Don't send events for disabled ribbon bar buttons.
Hover and activation events were sent even for the disabled buttons which was
unexpected and inconsistent with wxRibbonToolBar, so don't do it.
http://trac.wxwidgets.org/changeset/72574
Index: src/ribbon/buttonbar.cpp =================================================================== --- src/ribbon/buttonbar.cpp (revision 71780) +++ src/ribbon/buttonbar.cpp (working copy) @@ -958,7 +958,7 @@ wxRect btn_rect; btn_rect.SetTopLeft(m_layout_offset + instance.position); btn_rect.SetSize(size.size); - if(btn_rect.Contains(cursor)) + if(btn_rect.Contains(cursor) && !(instance.base->state & wxRIBBON_BUTTONBAR_BUTTON_DISABLED)) { new_hovered = &instance; new_hovered_state = instance.base->state; @@ -1047,7 +1047,7 @@ wxRect btn_rect; btn_rect.SetTopLeft(m_layout_offset + instance.position); btn_rect.SetSize(size.size); - if(btn_rect.Contains(cursor)) + if( btn_rect.Contains(cursor) && !(instance.base->state & wxRIBBON_BUTTONBAR_BUTTON_DISABLED) ) { m_active_button = &instance; cursor -= btn_rect.GetTopLeft(); @@ -1067,7 +1067,7 @@ { wxPoint cursor(evt.GetPosition()); - if(m_active_button) + if( m_active_button && !(m_active_button->base->state & wxRIBBON_BUTTONBAR_BUTTON_DISABLED) ) { wxRibbonButtonBarButtonSizeInfo& size = m_active_button->base->sizes[m_active_button->size];
wxRibbon需要依赖一些wxWidgets的基础库,由于之前已经有了全部的库(直接下载下来的,或者自己编译的),把这几个基础库添加给ribbon链接就行了
最终的结果是只要重新编译ribbon库,其他的库都不用变动