+ w = LOWORD(lParam);
+ h = r.bottom - r.top;
+ if ( m_maxRows )
+ {
+ // FIXME: 6 is hardcoded separator line height...
+ h += 6;
+ h *= m_maxRows;
+ }
+ }
+
+ if ( MAKELPARAM(w, h) != lParam )
+ {
+ // size really changed
+ SetSize(w, h);
+ }
+
+ // message processed
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
+{
+ // erase any dummy separators which we used for aligning the controls if
+ // any here
+
+ // first of all, do we have any controls at all?
+ wxToolBarToolsList::Node *node;
+ for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
+ {
+ if ( node->GetData()->IsControl() )
+ break;
+ }
+
+ if ( !node )
+ {
+ // no controls, nothing to erase
+ return FALSE;
+ }
+
+ // prepare the DC on which we'll be drawing
+ wxClientDC dc(this);
+ dc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));
+ dc.SetPen(*wxTRANSPARENT_PEN);
+
+ RECT r;
+ if ( !GetUpdateRect(GetHwnd(), &r, FALSE) )
+ {
+ // nothing to redraw anyhow
+ return FALSE;
+ }
+
+ wxRect rectUpdate;
+ wxCopyRECTToRect(r, rectUpdate);