X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3ba93c1f025870aeda36082acecc87ab277ab7d..19e30148e18cc99296b26503c155e5cef59045f4:/src/msw/tbar95.cpp diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 9c0ec13209..7c6515ff12 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -262,6 +262,10 @@ bool wxToolBar::Create(wxWindow *parent, msflags |= TBSTYLE_FLAT | TBSTYLE_TRANSPARENT; } } + if (style & wxTB_NODIVIDER) + msflags |= CCS_NODIVIDER; + if (style & wxTB_NOALIGN) + msflags |= CCS_NOPARENTALIGN; // MSW-specific initialisation if ( !wxControl::MSWCreateControl(TOOLBARCLASSNAME, msflags) ) @@ -833,20 +837,18 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id) // 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; @@ -1179,11 +1181,18 @@ bool wxToolBar::HandleSize(WXWPARAM wParam, WXLPARAM lParam) 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... - h += 6; + //h += 6; + if (HasFlag(wxTB_NODIVIDER)) + h += 3; + else + h += 6; h *= m_maxRows; } }