#ifndef wxUSE_NATIVE_STATUSBAR
# define wxUSE_NATIVE_STATUSBAR 0
#elif wxUSE_NATIVE_STATUSBAR
-# if defined(__WXUNIVERSAL__) || !(defined(__WXMSW__) || defined(__WXMAC__))
+# if defined(__WXUNIVERSAL__) || !( defined(__WXMSW__) || \
+ defined(__WXMAC__) || \
+ defined(__WXPALMOS__) )
# undef wxUSE_NATIVE_STATUSBAR
# define wxUSE_NATIVE_STATUSBAR 0
# endif
// ctors and such
wxStatusBarPalm();
wxStatusBarPalm(wxWindow *parent,
- wxWindowID id = -1,
- long style = wxST_SIZEGRIP,
- const wxString& name = wxEmptyString)
+ wxWindowID id = wxID_ANY,
+ long style = wxST_SIZEGRIP,
+ const wxString& name = wxEmptyString)
{
(void)Create(parent, id, style, name);
}
bool Create(wxWindow *parent,
- wxWindowID id = -1,
+ wxWindowID id = wxID_ANY,
long style = wxST_SIZEGRIP,
const wxString& name = wxEmptyString);
virtual ~wxStatusBarPalm();
+ // for native status bar use native check for visibility
+ virtual bool IsShown() const;
+ virtual bool Show( bool show = true );
+
// a status line can have several (<256) fields numbered from 0
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
virtual bool Enable( bool enable = true );
bool Disable() { return Enable(false); }
- bool IsShown() const { return m_isShown; }
+ virtual bool IsShown() const { return m_isShown; }
bool IsEnabled() const { return m_isEnabled; }
// get/set window style (setting style won't update the window and so
///////////////////////////////////////////////////////////////////////////////
-// Name: palmos/statbrpalm.cpp
+// Name: src/palmos/statbrpalm.cpp
// Purpose: Implementation of wxStatusBar for PalmOS
-// Author: William Osborne
-// Modified by:
+// Author: William Osborne - minimal working wxPalmOS port
+// Modified by: Wlodzimierz ABX Skiba - transition from faked drawing to native statusbar
// Created: 10/13/04
-// RCS-ID: $Id:
-// Copyright: (c) William Osborne
+// RCS-ID: $Id$
+// Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/dcclient.h"
#endif
-#if wxUSE_STATUSBAR
+#if wxUSE_NATIVE_STATUSBAR
#include "wx/intl.h"
#include "wx/log.h"
}
bool wxStatusBarPalm::Create(wxWindow *parent,
- wxWindowID id,
- long style,
- const wxString& name)
+ wxWindowID id,
+ long style,
+ const wxString& name)
{
- wxCHECK_MSG( parent, FALSE, wxT("status bar must have a parent") );
+ wxCHECK_MSG( parent, false, wxT("status bar must have a parent") );
StatusTextBuffer = NULL;
parent->AddChild(this);
- m_windowId = id == -1 ? NewControlId() : id;
+ m_windowId = id == wxID_ANY ? NewControlId() : id;
SetFieldsCount(1);
SubclassWin(m_hWnd);
- return TRUE;
+ return true;
}
wxStatusBarPalm::~wxStatusBarPalm()
{
+ Show();
+
DeleteStatusBuffer();
}
+bool wxStatusBarPalm::IsShown() const
+{
+ return StatGetAttribute ( statAttrBarVisible , NULL );
+}
+
+bool wxStatusBarPalm::Show( bool show )
+{
+ if(show)
+ {
+ // show it if hidden
+ if(IsShown())
+ return false;
+ status_t rc = StatShow();
+ wxCHECK_MSG( rc == errNone, false, wxT("cannot hide status bar") );
+ }
+ else
+ {
+ // hide it if shown
+ if(!IsShown())
+ return false;
+ status_t rc = StatHide();
+ wxCHECK_MSG( rc == errNone, false, wxT("cannot hide status bar") );
+ }
+ return true;
+}
+
void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths)
{
// this is a Windows limitation
{
}
-#endif // wxUSE_STATUSBAR
+#endif // wxUSE_NATIVE_STATUSBAR