+// ----------------------------------------------------------------------------
+// toolbar styles
+// ---------------------------------------------------------------------------
+
+void wxToolBar::SetWindowStyleFlag(long style)
+{
+ // there doesn't seem to be any reasonably simple way to prevent the
+ // toolbar from showing the icons so for now we don't honour wxTB_NOICONS
+ if ( (style & wxTB_TEXT) != (GetWindowStyle() & wxTB_TEXT) )
+ {
+ // update the strings of all toolbar buttons
+ //
+ // NB: we can only do it using TB_SETBUTTONINFO which is available
+ // in comctl32.dll >= 4.71 only
+#if defined(_WIN32_IE) && (_WIN32_IE >= 0x400 )
+ if ( wxTheApp->GetComCtl32Version() >= 471 )
+ {
+ // set the (underlying) separators width to be that of the
+ // control
+ TBBUTTONINFO tbbi;
+ tbbi.cbSize = sizeof(tbbi);
+ tbbi.dwMask = TBIF_TEXT;
+ if ( !(style & wxTB_TEXT) )
+ {
+ // don't show the text - remove the labels
+ tbbi.pszText = NULL;
+ }
+
+ for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxToolBarToolBase *tool = node->GetData();
+ if ( !tool->IsButton() )
+ {
+ continue;
+ }
+
+ if ( style & wxTB_TEXT )
+ {
+ // cast is harmless
+ tbbi.pszText = (wxChar *)tool->GetLabel().c_str();
+ }
+
+ if ( !SendMessage(GetHwnd(), TB_SETBUTTONINFO,
+ tool->GetId(), (LPARAM)&tbbi) )
+ {
+ // the id is probably invalid?
+ wxLogLastError(wxT("TB_SETBUTTONINFO"));
+ }
+ }
+
+ UpdateSize();
+ Refresh();
+ }
+#endif // comctl32.dll 4.71
+ }
+
+ wxToolBarBase::SetWindowStyleFlag(style);
+}
+