Reenable wxPalmOS status bar after recent changes. Start transition from faked drawing of the bar to usage of the native status bar. Source cleaning as usually.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-01-21 11:22:11 +00:00
parent 1e219378a3
commit b08cd3bf53
4 changed files with 53 additions and 19 deletions

View File

@@ -1015,7 +1015,9 @@
#ifndef wxUSE_NATIVE_STATUSBAR #ifndef wxUSE_NATIVE_STATUSBAR
# define wxUSE_NATIVE_STATUSBAR 0 # define wxUSE_NATIVE_STATUSBAR 0
#elif wxUSE_NATIVE_STATUSBAR #elif wxUSE_NATIVE_STATUSBAR
# if defined(__WXUNIVERSAL__) || !(defined(__WXMSW__) || defined(__WXMAC__)) # if defined(__WXUNIVERSAL__) || !( defined(__WXMSW__) || \
defined(__WXMAC__) || \
defined(__WXPALMOS__) )
# undef wxUSE_NATIVE_STATUSBAR # undef wxUSE_NATIVE_STATUSBAR
# define wxUSE_NATIVE_STATUSBAR 0 # define wxUSE_NATIVE_STATUSBAR 0
# endif # endif

View File

@@ -24,20 +24,24 @@ public:
// ctors and such // ctors and such
wxStatusBarPalm(); wxStatusBarPalm();
wxStatusBarPalm(wxWindow *parent, wxStatusBarPalm(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
long style = wxST_SIZEGRIP, long style = wxST_SIZEGRIP,
const wxString& name = wxEmptyString) const wxString& name = wxEmptyString)
{ {
(void)Create(parent, id, style, name); (void)Create(parent, id, style, name);
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
long style = wxST_SIZEGRIP, long style = wxST_SIZEGRIP,
const wxString& name = wxEmptyString); const wxString& name = wxEmptyString);
virtual ~wxStatusBarPalm(); 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 // a status line can have several (<256) fields numbered from 0
virtual void SetFieldsCount(int number = 1, const int *widths = NULL); virtual void SetFieldsCount(int number = 1, const int *widths = NULL);

View File

@@ -452,7 +452,7 @@ public:
virtual bool Enable( bool enable = true ); virtual bool Enable( bool enable = true );
bool Disable() { return Enable(false); } bool Disable() { return Enable(false); }
bool IsShown() const { return m_isShown; } virtual bool IsShown() const { return m_isShown; }
bool IsEnabled() const { return m_isEnabled; } bool IsEnabled() const { return m_isEnabled; }
// get/set window style (setting style won't update the window and so // get/set window style (setting style won't update the window and so

View File

@@ -1,11 +1,11 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: palmos/statbrpalm.cpp // Name: src/palmos/statbrpalm.cpp
// Purpose: Implementation of wxStatusBar for PalmOS // Purpose: Implementation of wxStatusBar for PalmOS
// Author: William Osborne // Author: William Osborne - minimal working wxPalmOS port
// Modified by: // Modified by: Wlodzimierz ABX Skiba - transition from faked drawing to native statusbar
// Created: 10/13/04 // Created: 10/13/04
// RCS-ID: $Id: // RCS-ID: $Id$
// Copyright: (c) William Osborne // Copyright: (c) William Osborne, Wlodzimierz Skiba
// Licence: wxWindows licence // Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@@ -27,7 +27,7 @@
#include "wx/dcclient.h" #include "wx/dcclient.h"
#endif #endif
#if wxUSE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
#include "wx/intl.h" #include "wx/intl.h"
#include "wx/log.h" #include "wx/log.h"
@@ -53,11 +53,11 @@ wxStatusBarPalm::wxStatusBarPalm()
} }
bool wxStatusBarPalm::Create(wxWindow *parent, bool wxStatusBarPalm::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
long style, long style,
const wxString& name) 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; StatusTextBuffer = NULL;
@@ -66,19 +66,47 @@ bool wxStatusBarPalm::Create(wxWindow *parent,
parent->AddChild(this); parent->AddChild(this);
m_windowId = id == -1 ? NewControlId() : id; m_windowId = id == wxID_ANY ? NewControlId() : id;
SetFieldsCount(1); SetFieldsCount(1);
SubclassWin(m_hWnd); SubclassWin(m_hWnd);
return TRUE; return true;
} }
wxStatusBarPalm::~wxStatusBarPalm() wxStatusBarPalm::~wxStatusBarPalm()
{ {
Show();
DeleteStatusBuffer(); 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) void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths)
{ {
// this is a Windows limitation // this is a Windows limitation
@@ -244,5 +272,5 @@ void wxStatusBarPalm::DoMoveWindow(int x, int y, int width, int height)
{ {
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_NATIVE_STATUSBAR