X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17dff81c7141e142765b168ab225e5c61475669f..1fd8a4504da7215d889e3e6234476581b0ba7adf:/src/msw/tbarmsw.cpp?ds=inline diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp index aed6d11a74..3ca04af78b 100644 --- a/src/msw/tbarmsw.cpp +++ b/src/msw/tbarmsw.cpp @@ -21,22 +21,25 @@ #endif #ifndef WX_PRECOMP -#include "wx.h" +#include "wx/wx.h" #endif #if wxUSE_BUTTONBAR && wxUSE_TOOLBAR -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) #include "malloc.h" #endif -#ifndef __MWERKS__ +#if !defined(__MWERKS__) && !defined(__SALFORDC__) #include #endif + #include #include "wx/tbarmsw.h" +#include "wx/event.h" #include "wx/app.h" +#include "wx/bitmap.h" #include "wx/msw/private.h" #include "wx/msw/dib.h" @@ -344,7 +347,7 @@ wxToolBarTool *wxToolBarMSW::AddTool(int index, const wxBitmap& bitmap, const wx wxBitmap bitmap2; if (toggle) { - bitmap2.SetHBITMAP( (WXHBITMAP) CreateMappedBitmap(wxGetInstance(), (HBITMAP) ((wxBitmap& )bitmap).GetHBITMAP())); + bitmap2.SetHBITMAP( (WXHBITMAP) CreateMappedBitmap((WXHINSTANCE)wxGetInstance(), (WXHBITMAP) ((wxBitmap& )bitmap).GetHBITMAP())); } wxToolBarTool *tool = new wxToolBarTool(index, bitmap, bitmap2, toggle, xPos, yPos, helpString1, helpString2); @@ -378,7 +381,7 @@ wxToolBarTool *wxToolBarMSW::AddTool(int index, const wxBitmap& bitmap, const wx return tool; } -void wxToolBarMSW::Layout(void) +void wxToolBarMSW::LayoutTools() { m_currentRowsOrColumns = 0; m_lastX = m_xMargin; @@ -462,12 +465,20 @@ void wxToolBarMSW::Layout(void) node = node->Next(); } if ( GetWindowStyleFlag() & wxTB_HORIZONTAL ) + { m_maxWidth += maxToolWidth; + m_maxHeight += maxToolHeight; + } else + { + m_maxWidth += maxToolWidth; m_maxHeight += maxToolHeight; + } m_maxWidth += m_xMargin; m_maxHeight += m_yMargin; + + SetSize(m_maxWidth, m_maxHeight); }