item->m_sticky = sticky;
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
}
bool wxAuiToolBar::GetToolSticky(int tool_id) const
void wxAuiToolBar::SetHoverItem(wxAuiToolBarItem* pitem)
{
+ if (pitem && (pitem->m_state & wxAUI_BUTTON_STATE_DISABLED))
+ pitem = NULL;
+
wxAuiToolBarItem* former_hover = NULL;
size_t i, count;
if (former_hover != pitem)
{
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
}
}
if (former_item != pitem)
{
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
}
}
{
m_overflowState = overflow_state;
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
}
m_overflowState = overflow_state;
m_sizer->SetDimension(0, 0, x, y);
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
// idle events aren't sent while user is resizing frame (why?),
// but resizing toolbar here causes havoc,
if(!GetEventHandler()->ProcessEvent(e) || e.GetSkipped())
CaptureMouse();
+ // Ensure hovered item is really ok, as mouse may have moved during
+ // event processing
+ wxPoint cursor_pos_after_evt = ScreenToClient(wxGetMousePosition());
+ SetHoverItem(FindToolByPosition(cursor_pos_after_evt.x, cursor_pos_after_evt.y));
+
DoIdleUpdate();
}
}
SetPressedItem(NULL);
- wxAuiToolBarItem* hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (hitItem && !(hitItem->m_state & wxAUI_BUTTON_STATE_DISABLED))
- {
- SetHoverItem(hitItem);
- }
+ wxAuiToolBarItem* hitItem;
+ hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
+ SetHoverItem(hitItem);
if (m_dragging)
{
// repaint immediately
Refresh(false);
-#ifdef TODO_REMOVE_IF_NO_PROBLEMS
Update();
-#endif
e.SetInt(toggle);
}
ReleaseMouse();
GetEventHandler()->ProcessEvent(e);
+
+ // Ensure hovered item is really ok, as mouse may have moved during
+ // event processing
+ wxPoint cursor_pos_after_evt = ScreenToClient(wxGetMousePosition());
+ SetHoverItem(FindToolByPosition(cursor_pos_after_evt.x, cursor_pos_after_evt.y));
+
DoIdleUpdate();
}
else
return;
}
- if (m_overflowSizerItem)
+ if (m_overflowSizerItem && m_art)
{
int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
if (dropdown_size > 0 &&
evt.m_x > cli_rect.width - dropdown_size &&
evt.m_y >= 0 &&
- evt.m_y < cli_rect.height &&
- m_art)
+ evt.m_y < cli_rect.height)
{
return;
}
return;
}
- if (m_overflowSizerItem)
+ if (m_overflowSizerItem && m_art)
{
int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
if (dropdown_size > 0 &&
evt.m_x > cli_rect.width - dropdown_size &&
evt.m_y >= 0 &&
- evt.m_y < cli_rect.height &&
- m_art)
+ evt.m_y < cli_rect.height)
{
return;
}
}
else
{
- if (hitItem && (hitItem->m_state & wxAUI_BUTTON_STATE_DISABLED))
- SetHoverItem(NULL);
- else
- SetHoverItem(hitItem);
+ SetHoverItem(hitItem);
// tooltips handling
wxAuiToolBarItem* packingHitItem;