+ if (rect.GetWidth() <= 0)
+ return; // happens when the status bar is shrinked in a very small area!
+
+ if (ShowsSizeGrip())
+ {
+ // don't write text over the size grip:
+ // NOTE: overloading DoGetClientSize() and GetClientAreaOrigin() wouldn't
+ // work because the adjustment needs to be done only when drawing
+ // the field text and not also when drawing the background, the
+ // size grip itself, etc
+ if (GetLayoutDirection() == wxLayout_RightToLeft && i == 0)
+ {
+ const wxRect& rc = GetSizeGripRect();
+
+ rect.x += rc.GetRight();
+ rect.width -= rc.GetRight();
+ }
+ else if (GetLayoutDirection() != wxLayout_RightToLeft && i == m_panes.GetCount()-1)
+ {
+ const wxRect& rc = GetSizeGripRect();
+
+ rect.width = rc.x - rect.x;
+ }
+ }
+
+ // eventually ellipsize the text so that it fits the field width