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:
@@ -1015,7 +1015,9 @@
|
||||
#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
|
||||
|
@@ -24,20 +24,24 @@ public:
|
||||
// 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);
|
||||
|
||||
|
@@ -452,7 +452,7 @@ public:
|
||||
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
|
||||
|
@@ -1,11 +1,11 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "wx/dcclient.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
#if wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
@@ -53,11 +53,11 @@ wxStatusBarPalm::wxStatusBarPalm()
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -66,19 +66,47 @@ bool wxStatusBarPalm::Create(wxWindow *parent,
|
||||
|
||||
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
|
||||
@@ -244,5 +272,5 @@ void wxStatusBarPalm::DoMoveWindow(int x, int y, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_STATUSBAR
|
||||
#endif // wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
|
Reference in New Issue
Block a user