#include "wx/log.h"
#include "wx/intl.h"
#include "wx/dynarray.h"
+ #include "wx/settings.h"
+ #include "wx/bitmap.h"
#endif
#if wxUSE_BUTTONBAR && wxUSE_TOOLBAR && defined(__WIN95__)
// ----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
- IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase)
+ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase)
#endif
BEGIN_EVENT_TABLE(wxToolBar95, wxToolBarBase)
if ( !CreateControl(parent, id, pos, size, style, name) )
return FALSE;
- // set up the colors and fonts
-#if 0
- wxRGBToColour(m_backgroundColour, GetSysColor(COLOR_BTNFACE));
- m_foregroundColour = *wxBLACK;
-
- SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
-#endif
-
// prepare flags
DWORD msflags = 0; // WS_VISIBLE | WS_CHILD always included
if (style & wxBORDER)
if (style & wxTB_FLAT)
{
if (wxTheApp->GetComCtl32Version() > 400)
- msflags |= TBSTYLE_FLAT | TBSTYLE_TRANSPARENT;
+ msflags |= TBSTYLE_FLAT;
}
// MSW-specific initialisation
if ( !wxControl::MSWCreateControl(TOOLBARCLASSNAME, msflags) )
return FALSE;
- // Toolbar-specific initialisation
+ // toolbar-specific post initialisation
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
+ // set up the colors and fonts
+ wxRGBToColour(m_backgroundColour, GetSysColor(COLOR_BTNFACE));
+ m_foregroundColour = *wxBLACK;
+
+ SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+
// position it
int x = pos.x;
int y = pos.y;
delete [] buttons;
+ // TBBUTTONINFO struct declaration is new (comctl32.dll 4.70+)
+#if !defined(__GNUWIN32__) && !defined(__WATCOMC__) && !defined(__BORLANDC__)
// adjust the controls size to fit nicely in the toolbar
size_t nControls = controlIds.GetCount();
for ( size_t nCtrl = 0; nCtrl < nControls; nCtrl++ )
// and position the control itself correctly vertically
RECT r;
- SendMessage(GetHwnd(), TB_GETRECT, 0, (LPARAM)(LPRECT)&r);
+ if ( !SendMessage(GetHwnd(), TB_GETRECT,
+ tool->m_index, (LPARAM)(LPRECT)&r) )
+ {
+ wxLogLastError("TB_GETRECT");
+ }
int height = r.bottom - r.top;
int diff = height - size.y;
control->Move(r.left, r.top + diff / 2);
}
+#endif // __GNUWIN32__
(void)::SendMessage(GetHwnd(), TB_AUTOSIZE, (WPARAM)0, (LPARAM) 0);