X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f83044fb8785568e186bee64db4f98b7a9ac9c6..af547d51b7494fd365ae29e048d458ff72b27056:/src/msw/tbar95.cpp?ds=sidebyside diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 5f9153e7b8..e101ced821 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -192,7 +192,7 @@ bool wxToolBar::Create(wxWindow *parent, const wxString& name) { // common initialisation - if ( !CreateControl(parent, id, pos, size, style, name) ) + if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; // prepare flags @@ -568,7 +568,6 @@ bool wxToolBar::Realize() // the id is probably invalid? wxLogLastError("TB_SETBUTTONINFO"); } - } else #endif // comctl32.dll 4.71 @@ -581,7 +580,7 @@ bool wxToolBar::Realize() TBBUTTON tbb; wxZeroMemory(tbb); tbb.idCommand = 0; - tbb.fsState = TBSTATE_ENABLED; + tbb.fsState = TBSTATE_ENABLED | TBSTATE_HIDDEN; tbb.fsStyle = TBSTYLE_SEP; size_t nSeparators = size.x / widthSep; @@ -655,7 +654,7 @@ bool wxToolBar::MSWCommand(WXUINT cmd, WXWORD id) if ( tool->CanBeToggled() ) { LRESULT state = ::SendMessage(GetHwnd(), TB_GETSTATE, id, 0); - tool->SetToggle((state & TBSTATE_CHECKED) != 0); + tool->Toggle((state & TBSTATE_CHECKED) != 0); } bool toggled = tool->IsToggled(); @@ -808,7 +807,10 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const void wxToolBar::UpdateSize() { - // we must refresh the frame after the toolbar size (possibly) changed + // the toolbar size changed + SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0); + + // we must also refresh the frame after the toolbar size (possibly) changed wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame ) { @@ -822,7 +824,6 @@ void wxToolBar::UpdateSize() (void)::SendMessage(GetHwndOf(frame), WM_SIZE, SIZE_RESTORED, MAKELPARAM(r.right - r.left, r.bottom - r.top)); } - } // ---------------------------------------------------------------------------- @@ -939,7 +940,7 @@ long wxToolBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) #define BGR_BUTTONSHADOW (RGB(128,128,128)) // dark grey #define BGR_BUTTONFACE (RGB(192,192,192)) // bright grey #define BGR_BUTTONHILIGHT (RGB(255,255,255)) // white -#define BGR_BACKGROUNDSEL (RGB(255,000,000)) // blue +#define BGR_BACKGROUNDSEL (RGB(000,000,255)) // blue #define BGR_BACKGROUND (RGB(255,000,255)) // magenta void wxMapBitmap(HBITMAP hBitmap, int width, int height) @@ -950,7 +951,7 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) {BGR_BUTTONSHADOW, COLOR_BTNSHADOW}, // dark grey {BGR_BUTTONFACE, COLOR_BTNFACE}, // bright grey {BGR_BUTTONHILIGHT, COLOR_BTNHIGHLIGHT},// white - {BGR_BACKGROUNDSEL, COLOR_HIGHLIGHT}, // blue +/* {BGR_BACKGROUNDSEL, COLOR_HIGHLIGHT}, // blue */ {BGR_BACKGROUND, COLOR_WINDOW} // magenta };