// avoid sending the event when a radio button is released, this is not
// interesting
- if ( tool->CanBeToggled() && tool->GetKind() == wxITEM_RADIO && !toggled )
+ if ( !tool->CanBeToggled() || tool->GetKind() != wxITEM_RADIO || toggled )
{
- return;
- }
-
- // OnLeftClick() can veto the button state change - for buttons which may
- // be toggled only, of couse
- if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() )
- {
- // revert back
- toggled = !toggled;
- tool->SetToggle(toggled);
+ // OnLeftClick() can veto the button state change - for buttons which
+ // may be toggled only, of couse
+ if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() )
+ {
+ // revert back
+ toggled = !toggled;
+ tool->SetToggle(toggled);
- ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
+ ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
+ }
}
return TRUE;
else
{
w = LOWORD(lParam);
- h = r.bottom - r.top;
+ if (HasFlag( wxTB_FLAT ))
+ h = r.bottom - r.top - 3;
+ else
+ h = r.bottom - r.top;
if ( m_maxRows )
{
// FIXME: 6 is hardcoded separator line height...