- wxASSERT( (nField > -1) && (nField < m_nFields) );
-
- wxString str("");
- int len = StatusBar_GetTextLen(hwnd, nField);
- if (len > 0)
- {
- StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
- str.UngetWriteBuf();
- }
- return str;
+ 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)"));
+ }
+
+ wxCopyRECTToRect(r, rect);
+
+ return TRUE;