+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;
+}
+
+void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height)
+{
+ // the status bar wnd proc must be forwarded the WM_SIZE message whenever
+ // the stat bar position/size is changed because it normally positions the
+ // control itself along bottom or top side of the parent window - failing
+ // to do so will result in nasty visual effects
+ FORWARD_WM_SIZE(GetHwnd(), SIZE_RESTORED, x, y, SendMessage);
+
+ // but now, when the standard status bar wnd proc did all it wanted to do,
+ // move the status bar to its correct location - usually this call may be
+ // omitted because for normal status bars (positioned along the bottom
+ // edge) the position is already set correctly, but if the user wants to
+ // position them in some exotic location, this is really needed
+ wxWindowMSW::DoMoveWindow(x, y, width, height);
+
+ // adjust fields widths to the new size
+ SetFieldsWidth();
+
+ // we have to trigger wxSizeEvent if there are children window in status
+ // bar because GetFieldRect returned incorrect (not updated) values up to
+ // here, which almost certainly resulted in incorrectly redrawn statusbar
+ if ( m_children.GetCount() > 0 )
+ {
+ wxSizeEvent event(GetClientSize(), m_windowId);
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+ }
+}
+
+void wxStatusBar95::SetStatusStyles(int n, const int styles[])
+{
+ wxStatusBarBase::SetStatusStyles(n, styles);
+
+ if (n != m_nFields)
+ return;
+
+ for (int i = 0; i < n; i++)
+ {
+ int style;
+ switch(styles[i])
+ {
+ case wxSB_RAISED:
+ style = SBT_POPOUT;
+ break;
+ case wxSB_FLAT:
+ style = SBT_NOBORDERS;
+ break;
+ case wxSB_NORMAL:
+ default:
+ style = 0;
+ break;
+ }
+ // The SB_SETTEXT message is both used to set the field's text as well as
+ // the fields' styles. MSDN library doesn't mention
+ // that nField and style have to be 'ORed'
+ wxString text = GetStatusText(i);
+ if (!StatusBar_SetText(GetHwnd(), style | i, text))
+ {
+ wxLogLastError(wxT("StatusBar_SetText"));
+ }
+ }
+}
+
+#endif // __WIN95__ && wxUSE_NATIVE_STATUSBAR
+