X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b941f2d3143c1205fc7c5b01bd254781db728b3..0c8b041f147ff9bb6ce38f0e2da1fd82f6484523:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 2d250e20d5..edfff6c1f2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -114,6 +114,30 @@ bool wxToolBarToolBase::SetLongHelp(const wxString& help) return true; } +#if WXWIN_COMPATIBILITY_2_2 + +const wxBitmap& wxToolBarToolBase::GetBitmap1() const +{ + return GetNormalBitmap(); +} + +const wxBitmap& wxToolBarToolBase::GetBitmap2() const +{ + return GetDisabledBitmap(); +} + +void wxToolBarToolBase::SetBitmap1(const wxBitmap& bmp) +{ + SetNormalBitmap(bmp); +} + +void wxToolBarToolBase::SetBitmap2(const wxBitmap& bmp) +{ + SetDisabledBitmap(bmp); +} + +#endif // WXWIN_COMPATIBILITY_2_2 + // ---------------------------------------------------------------------------- // wxToolBarBase adding/deleting items // ---------------------------------------------------------------------------- @@ -122,8 +146,10 @@ wxToolBarBase::wxToolBarBase() { // the list owns the pointers m_xMargin = m_yMargin = 0; - m_maxRows = m_maxCols = 0; + m_toolPacking = m_toolSeparation = 0; + m_defaultWidth = 16; + m_defaultHeight = 15; } wxToolBarToolBase *wxToolBarBase::DoAddTool(int id, @@ -539,7 +565,7 @@ bool wxToolBarBase::GetToolEnabled(int id) const wxString wxToolBarBase::GetToolShortHelp(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, _T(""), _T("no such tool") ); + wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); return tool->GetShortHelp(); } @@ -547,7 +573,7 @@ wxString wxToolBarBase::GetToolShortHelp(int id) const wxString wxToolBarBase::GetToolLongHelp(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, _T(""), _T("no such tool") ); + wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); return tool->GetLongHelp(); } @@ -714,8 +740,19 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out) { out = in.Copy(); - // assuming the pixels along the edges are of the background color - wxColour bgCol(in.GetRed(0, 0), in.GetGreen(0, 0), in.GetBlue(0, 0)); + unsigned char r, g, b; + if ( in.HasMask() ) + { + in.GetOrFindMaskColour(&r, &g, &b); + } + else // assuming the pixels along the edges are of the background color + { + r = in.GetRed(0, 0); + g = in.GetGreen(0, 0); + b = in.GetBlue(0, 0); + } + + wxColour bgCol(r, g, b); wxColour darkCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW) ; wxColour lightCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT) ;