+ if (m_labelHeight > 0)
+ {
+ sz.y += (m_labelHeight + m_labelMargin);
+
+ if (!tool->GetShortHelp().empty())
+ {
+ wxClientDC dc(this);
+ dc.SetFont(GetFont());
+ int tw, th;
+ dc.GetTextExtent(tool->GetShortHelp(), & tw, & th);
+
+ // If the label is bigger than the icon, the label width
+ // becomes the new tool width, and we need to centre the
+ // the bitmap in this box.
+ if (tw > sz.x)
+ {
+ int newX = int(tool->m_x + (tw - sz.x)/2.0);
+ tool->GetButton()->Move(newX, tool->m_y);
+ sz.x = tw;
+ }
+ }
+ }
+