]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/statbr95.cpp
1) keyboard handling: now generates NavigationKey events instead of using
[wxWidgets.git] / src / msw / statbr95.cpp
index e740741b3141c18628c6414ca6a53ae84be8f31a..0b737b9e1dcb72fd9bb3f44b5df1af909c2fcecc 100644 (file)
@@ -116,7 +116,7 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style)
   return TRUE;
 }
 
-void wxStatusBar95::CopyFieldsWidth(const int *widths)
+void wxStatusBar95::CopyFieldsWidth(int *widths)
 {
   if (widths && !m_statusWidths)
     m_statusWidths = new int[m_nFields];
@@ -131,7 +131,7 @@ void wxStatusBar95::CopyFieldsWidth(const int *widths)
   }
 }
 
-void wxStatusBar95::SetFieldsCount(int nFields, const int *widths)
+void wxStatusBar95::SetFieldsCount(int nFields, int *widths)
 {
   wxASSERT( (nFields > 0) && (nFields < 255) );
 
@@ -141,7 +141,7 @@ void wxStatusBar95::SetFieldsCount(int nFields, const int *widths)
   SetFieldsWidth();
 }
 
-void wxStatusBar95::SetStatusWidths(int n, const int *widths)
+void wxStatusBar95::SetStatusWidths(int n, int *widths)
 {
   // @@ I don't understand what this function is for...
   wxASSERT( n == m_nFields );
@@ -161,7 +161,7 @@ void wxStatusBar95::SetFieldsWidth()
     // default: all fields have the same width
     int nWidth = nWindowWidth / m_nFields;
     for ( int i = 0; i < m_nFields; i++ )
-      pWidths[i] = (i + 1) * nWindowWidth;
+      pWidths[i] = (i + 1) * nWidth;
   }
   else {
     // -1 doesn't mean the same thing for wxWindows and Win32, recalc
@@ -202,7 +202,7 @@ void wxStatusBar95::SetFieldsWidth()
   delete [] pWidths;
 }
 
-void wxStatusBar95::SetStatusText(const wxString& strText, const int nField)
+void wxStatusBar95::SetStatusText(const wxString& strText, int nField)
 {
   if ( !StatusBar_SetText(hwnd, nField, strText) ) {
     wxLogDebug("StatusBar_SetText failed");
@@ -211,11 +211,14 @@ void wxStatusBar95::SetStatusText(const wxString& strText, const int nField)
 
 wxString wxStatusBar95::GetStatusText(int nField) const
 {
-  wxASSERT( (nField > 0) && (nField < m_nFields) );
+  wxASSERT( (nField > -1) && (nField < m_nFields) );
 
-  wxString str;
-  StatusBar_GetText(hwnd, nField, 
-                    str.GetWriteBuf(StatusBar_GetTextLen(hwnd, nField)));
+  wxString str("");
+  int len = StatusBar_GetTextLen(hwnd, nField);
+  if (len > 0)
+  {
+        StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
+  }
   return str;
 }