X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/81d66cf39f810503baed79213bc3122fda0ccc7b..520e470fdd0daef09c77938db642e4583933c90d:/src/msw/tbar95.cpp?ds=sidebyside diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 21d8624e2a..772e4cab64 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -24,7 +24,7 @@ #include "wx.h" #endif -#if USE_BUTTONBAR && USE_TOOLBAR && defined(__WIN95__) +#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR && defined(__WIN95__) #ifndef __GNUWIN32__ #include "malloc.h" @@ -100,12 +100,8 @@ bool wxToolBar95::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, co GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); m_foregroundColour = *wxBLACK ; - m_defaultForegroundColour = *wxBLACK ; - m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), - GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); - if (style & wxTB_VERTICAL) - wxMessageBox("Sorry, wxToolBar95 under Windows 95 only supports vertical tiling.", "wxToolBar95 usage", wxOK); + wxMessageBox("Sorry, wxToolBar95 under Windows 95 only supports horizontal orientation.", "wxToolBar95 usage", wxOK); m_maxWidth = -1; m_maxHeight = -1; @@ -383,7 +379,7 @@ void wxToolBar95::SetRows(int nRows) wxSize wxToolBar95::GetMaxSize(void) const { - if (m_maxWidth == -1 | m_maxHeight == -1) + if ((m_maxWidth == -1) || (m_maxHeight == -1)) { RECT rect; ::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_maxRows, TRUE), (LPARAM) & rect); @@ -432,6 +428,11 @@ void wxToolBar95::ToggleTool(int toolIndex, bool toggle) } } +bool wxToolBar95::GetToolState(int toolIndex) const +{ + return (::SendMessage((HWND) GetHWND(), TB_ISBUTTONCHECKED, (WPARAM)toolIndex, (LPARAM)0) != 0); +} + void wxToolBar95::ClearTools(void) { // TODO: Don't know how to reset the toolbar bitmap, as yet. @@ -446,7 +447,7 @@ void wxToolBar95::ClearTools(void) wxToolBarTool *wxToolBar95::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap, bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2) { - wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2); + wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2); tool->m_clientData = clientData; if (xPos > -1) @@ -470,8 +471,6 @@ void wxToolBar95::OnSysColourChanged(wxSysColourChangedEvent& event) { m_backgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); - m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), - GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); // Remap the buttons CreateTools();