+ wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString,
+ _T("invalid statusbar field index") );
+
+ wxString str;
+ int len = StatusBar_GetTextLen(GetHwnd(), nField);
+ if ( len > 0 )
+ {
+ StatusBar_GetText(GetHwnd(), nField, wxStringBuffer(str, len));
+ }
+
+ return str;
+}
+
+int wxStatusBar95::GetBorderX() const
+{
+ int aBorders[3];
+ SendMessage(GetHwnd(), SB_GETBORDERS, 0, (LPARAM)aBorders);
+
+ return aBorders[0];
+}
+
+int wxStatusBar95::GetBorderY() const
+{
+ int aBorders[3];
+ SendMessage(GetHwnd(), SB_GETBORDERS, 0, (LPARAM)aBorders);
+
+ return aBorders[1];
+}
+
+void wxStatusBar95::SetMinHeight(int height)
+{
+ SendMessage(GetHwnd(), SB_SETMINHEIGHT, height + 2*GetBorderY(), 0);
+
+ // have to send a (dummy) WM_SIZE to redraw it now
+ SendMessage(GetHwnd(), WM_SIZE, 0, 0);
+}
+
+bool wxStatusBar95::GetFieldRect(int i, wxRect& rect) const
+{
+ wxCHECK_MSG( (i >= 0) && (i < m_nFields), false,
+ _T("invalid statusbar field index") );
+
+ RECT r;
+ if ( !::SendMessage(GetHwnd(), SB_GETRECT, i, (LPARAM)&r) )
+ {
+ wxLogLastError(wxT("SendMessage(SB_GETRECT)"));
+ }
+
+#if wxUSE_UXTHEME
+ wxUxThemeHandle theme((wxStatusBar95 *)this, L"Status"); // const_cast
+ if ( theme )
+ {
+ // by default Windows has a 2 pixel border to the right of the left
+ // divider (or it could be a bug) but it looks wrong so remove it
+ if ( i != 0 )
+ {
+ r.left -= 2;
+ }
+
+ wxUxThemeEngine::Get()->GetThemeBackgroundContentRect(theme, NULL,
+ 1 /* SP_PANE */, 0,
+ &r, &r);
+ }
+#endif
+
+ wxCopyRECTToRect(r, rect);
+
+ return true;