From: Vadim Zeitlin Date: Tue, 19 Oct 2004 23:17:30 +0000 (+0000) Subject: fixed status bar source file name; removed wxUSE_NATIVE_STATUS_BAR; removed generic... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/771be77f9a134e71facb6611bd490d45cf30b142 fixed status bar source file name; removed wxUSE_NATIVE_STATUS_BAR; removed generic status bar file from makefile git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/build/palmos/makefile b/build/palmos/makefile index 4af137dc84..8461041858 100644 --- a/build/palmos/makefile +++ b/build/palmos/makefile @@ -181,7 +181,6 @@ SOURCES = ../../samples/minimal/minimal.cpp \ ../../src/common/zipstrm.cpp \ ../../src/common/zstream.cpp \ ../../src/generic/renderg.cpp \ -../../src/generic/statusbr.cpp \ ../../src/palmos/accel.cpp \ ../../src/palmos/app.cpp \ ../../src/palmos/base.cpp \ @@ -266,7 +265,7 @@ SOURCES = ../../samples/minimal/minimal.cpp \ ../../src/palmos/spinctrl.cpp \ ../../src/palmos/statbmp.cpp \ ../../src/palmos/statbox.cpp \ -../../src/palmos/statusbar.cpp \ +../../src/palmos/statbrpalm.cpp \ ../../src/palmos/statline.cpp \ ../../src/palmos/stattext.cpp \ ../../src/palmos/taskbar.cpp \ @@ -368,8 +367,8 @@ ADDITIONAL_SIM_LINK_LIBRARIES = # Additionally, you must explicly specify the "-I" prior to each # path included in this variable. Spaces are used to separate # each path from each other. -LOCAL_INCLUDE_PATHS = -Irsc -I../../include -LOCAL_SIM_INCLUDE_PATHS = -Irsc -I../../include +LOCAL_INCLUDE_PATHS = -Irsc -I../../lib/gcc_lib/palmos -I../../include +LOCAL_SIM_INCLUDE_PATHS = $(LOCAL_INCLUDE_PATHS) # Additional paths to look for #include
# (Palm OS SDK directories are automatically included) diff --git a/include/wx/statusbr.h b/include/wx/statusbr.h index ea67d427bc..d60562e139 100644 --- a/include/wx/statusbr.h +++ b/include/wx/statusbr.h @@ -150,10 +150,10 @@ protected: #define wxStatusBarUniv wxStatusBar #include "wx/univ/statusbr.h" -#elif defined(__PALMOS__) && wxUSE_NATIVE_STATUSBAR +#elif defined(__PALMOS__) #define wxStatusBarPalm wxStatusBar - #include "wx/palmos/statbrpalm.h" + #include "wx/palmos/statusbr.h" #elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR #define wxStatusBar95 wxStatusBar diff --git a/src/palmos/statbrpalm.cpp b/src/palmos/statbrpalm.cpp new file mode 100644 index 0000000000..ae4b758f3a --- /dev/null +++ b/src/palmos/statbrpalm.cpp @@ -0,0 +1,248 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: palmos/statbrpalm.cpp +// Purpose: Implementation of wxStatusBar for PalmOS +// Author: William Osborne +// Modified by: +// Created: 10/13/04 +// RCS-ID: $Id: +// Copyright: (c) William Osborne +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) +#pragma implementation "statusbr.h" +#endif + +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/setup.h" + #include "wx/frame.h" + #include "wx/settings.h" + #include "wx/dcclient.h" +#endif + +#if wxUSE_STATUSBAR + +#include "wx/intl.h" +#include "wx/log.h" +#include "wx/statusbr.h" + +// ---------------------------------------------------------------------------- +// macros +// ---------------------------------------------------------------------------- + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// wxStatusBarPalm class +// ---------------------------------------------------------------------------- + +wxStatusBarPalm::wxStatusBarPalm() +{ + SetParent(NULL); + m_hWnd = 0; + m_windowId = 0; +} + +bool wxStatusBarPalm::Create(wxWindow *parent, + wxWindowID id, + long style, + const wxString& name) +{ + wxCHECK_MSG( parent, FALSE, wxT("status bar must have a parent") ); + + StatusTextBuffer = NULL; + + SetName(name); + SetParent(parent); + + parent->AddChild(this); + + m_windowId = id == -1 ? NewControlId() : id; + + SetFieldsCount(1); + SubclassWin(m_hWnd); + + return TRUE; +} + +wxStatusBarPalm::~wxStatusBarPalm() +{ + DeleteStatusBuffer(); +} + +void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths) +{ + // this is a Windows limitation + wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") ); + + wxStatusBarBase::SetFieldsCount(nFields, widths); + + SetFieldsWidth(); +} + +void wxStatusBarPalm::SetStatusWidths(int n, const int widths[]) +{ + wxStatusBarBase::SetStatusWidths(n, widths); + + SetFieldsWidth(); +} + +void wxStatusBarPalm::SetFieldsWidth() +{ + // clear the status bar + DeleteStatusBuffer(); +} + +void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField) +{ + wxCHECK_RET( (nField >= 0) && (nField < m_nFields), + _T("invalid statusbar field index") ); + + SetStatusBufferText(strText,nField); + DrawStatusBar(); +} + +wxString wxStatusBarPalm::GetStatusText(int nField) const +{ + wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString, + _T("invalid statusbar field index") ); + + wxString text; + return text; +} + +void wxStatusBarPalm::DrawStatusBar() +{ + int i=0; + int leftPos=0; + wxArrayInt widthsAbs; + wxString text; + + RectangleType EraseRect; + EraseRect.topLeft.x=0; + EraseRect.topLeft.y=160-FntCharHeight()-1; + EraseRect.extent.x=159; + EraseRect.extent.y=159; + WinEraseRectangle(&EraseRect,0); + + if(m_nFields>0) + widthsAbs=CalculateAbsWidths(160 - 2*(m_nFields - 1)); + + for(i=0;iInsert(tmp); +} + +wxString wxStatusBarPalm::GetStatusBufferText(int number) +{ + wxListString *st = GetStatusBufferStack(number); + if(st==0) + return ""; + + wxListString::compatibility_iterator top = st->GetFirst(); + return(*top->GetData()); +} + +wxListString *wxStatusBarPalm::GetOrCreateStatusBuffer(int i) +{ + if(!StatusTextBuffer) + { + StatusTextBuffer = new wxListString*[m_nFields]; + + size_t j; + for(j = 0; j < (size_t)m_nFields; ++j) StatusTextBuffer[j] = 0; + } + + if(!StatusTextBuffer[i]) + { + StatusTextBuffer[i] = new wxListString(); + } + else + { + wxListString *st=StatusTextBuffer[i]; + wxListString::compatibility_iterator top = st->GetFirst(); + delete top->GetData(); + st->Erase(top); + delete st; + + StatusTextBuffer[i] = new wxListString(); + } + + return StatusTextBuffer[i]; +} + +wxListString *wxStatusBarPalm::GetStatusBufferStack(int i) const +{ + if(!StatusTextBuffer) + return 0; + return StatusTextBuffer[i]; +} + +void wxStatusBarPalm::DeleteStatusBuffer() +{ + if(!StatusTextBuffer) + { + return; + } + + for(int i=0;iGetFirst(); + delete top->GetData(); + st->Erase(top); + delete st; + StatusTextBuffer[i]=0; + } + } + delete[] m_statusTextStacks; +} + +int wxStatusBarPalm::GetBorderX() const +{ + return 0; +} + +int wxStatusBarPalm::GetBorderY() const +{ + return 0; +} + +void wxStatusBarPalm::SetMinHeight(int height) +{ +} + +bool wxStatusBarPalm::GetFieldRect(int i, wxRect& rect) const +{ +} + +void wxStatusBarPalm::DoMoveWindow(int x, int y, int width, int height) +{ +} + +#endif // wxUSE_STATUSBAR + diff --git a/src/palmos/statusbr.cpp b/src/palmos/statusbr.cpp deleted file mode 100644 index a4dd9a1499..0000000000 --- a/src/palmos/statusbr.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: palmos/statusbr.cpp -// Purpose: Implementation of wxStatusBar for PalmOS -// Author: William Osborne -// Modified by: -// Created: 10/13/04 -// RCS-ID: $Id: -// Copyright: (c) William Osborne -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "statusbr.h" -#endif - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/setup.h" - #include "wx/frame.h" - #include "wx/settings.h" - #include "wx/dcclient.h" -#endif - -#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR - -#include "wx/intl.h" -#include "wx/log.h" -#include "wx/statusbr.h" - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStatusBarPalm class -// ---------------------------------------------------------------------------- - -wxStatusBarPalm::wxStatusBarPalm() -{ - SetParent(NULL); - m_hWnd = 0; - m_windowId = 0; -} - -bool wxStatusBarPalm::Create(wxWindow *parent, - wxWindowID id, - long style, - const wxString& name) -{ - wxCHECK_MSG( parent, FALSE, wxT("status bar must have a parent") ); - - StatusTextBuffer = NULL; - - SetName(name); - SetParent(parent); - - parent->AddChild(this); - - m_windowId = id == -1 ? NewControlId() : id; - - SetFieldsCount(1); - SubclassWin(m_hWnd); - - return TRUE; -} - -wxStatusBarPalm::~wxStatusBarPalm() -{ - DeleteStatusBuffer(); -} - -void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths) -{ - // this is a Windows limitation - wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") ); - - wxStatusBarBase::SetFieldsCount(nFields, widths); - - SetFieldsWidth(); -} - -void wxStatusBarPalm::SetStatusWidths(int n, const int widths[]) -{ - wxStatusBarBase::SetStatusWidths(n, widths); - - SetFieldsWidth(); -} - -void wxStatusBarPalm::SetFieldsWidth() -{ - // clear the status bar - DeleteStatusBuffer(); -} - -void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField) -{ - wxCHECK_RET( (nField >= 0) && (nField < m_nFields), - _T("invalid statusbar field index") ); - - SetStatusBufferText(strText,nField); - DrawStatusBar(); -} - -wxString wxStatusBarPalm::GetStatusText(int nField) const -{ - wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString, - _T("invalid statusbar field index") ); - - wxString text; - return text; -} - -void wxStatusBarPalm::DrawStatusBar() -{ - int i=0; - int leftPos=0; - wxArrayInt widthsAbs; - wxString text; - - RectangleType EraseRect; - EraseRect.topLeft.x=0; - EraseRect.topLeft.y=160-FntCharHeight()-1; - EraseRect.extent.x=159; - EraseRect.extent.y=159; - WinEraseRectangle(&EraseRect,0); - - if(m_nFields>0) - widthsAbs=CalculateAbsWidths(160 - 2*(m_nFields - 1)); - - for(i=0;iInsert(tmp); -} - -wxString wxStatusBarPalm::GetStatusBufferText(int number) -{ - wxListString *st = GetStatusBufferStack(number); - if(st==0) - return ""; - - wxListString::compatibility_iterator top = st->GetFirst(); - return(*top->GetData()); -} - -wxListString *wxStatusBarPalm::GetOrCreateStatusBuffer(int i) -{ - if(!StatusTextBuffer) - { - StatusTextBuffer = new wxListString*[m_nFields]; - - size_t j; - for(j = 0; j < (size_t)m_nFields; ++j) StatusTextBuffer[j] = 0; - } - - if(!StatusTextBuffer[i]) - { - StatusTextBuffer[i] = new wxListString(); - } - else - { - wxListString *st=StatusTextBuffer[i]; - wxListString::compatibility_iterator top = st->GetFirst(); - delete top->GetData(); - st->Erase(top); - delete st; - - StatusTextBuffer[i] = new wxListString(); - } - - return StatusTextBuffer[i]; -} - -wxListString *wxStatusBarPalm::GetStatusBufferStack(int i) const -{ - if(!StatusTextBuffer) - return 0; - return StatusTextBuffer[i]; -} - -void wxStatusBarPalm::DeleteStatusBuffer() -{ - int i=0; - - if(!StatusTextBuffer) - { - return; - } - - for(i=0;iGetFirst(); - delete top->GetData(); - st->Erase(top); - delete st; - StatusTextBuffer[i]=0; - } - } - delete[] m_statusTextStacks; -} - -int wxStatusBarPalm::GetBorderX() const -{ - return 0; -} - -int wxStatusBarPalm::GetBorderY() const -{ - return 0; -} - -void wxStatusBarPalm::SetMinHeight(int height) -{ -} - -bool wxStatusBarPalm::GetFieldRect(int i, wxRect& rect) const -{ -} - -void wxStatusBarPalm::DoMoveWindow(int x, int y, int width, int height) -{ -} - -#endif // wxUSE_NATIVE_STATUSBAR -