Old API depreciated. Use of new API. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2005-01-04 19:35:52 +00:00
parent 4aa7ecf1fa
commit ec157c8f95
13 changed files with 84 additions and 68 deletions

View File

@ -423,7 +423,7 @@ bool wxPropertyListView::CreateControls()
if (!panel)
return false;
wxFont guiFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
wxFont guiFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
#ifdef __WXMSW__
wxFont *boringFont =

View File

@ -164,7 +164,7 @@ void wxToolWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
int w,h;
GetSize( &w, &h );
wxBrush backGround( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE), wxSOLID );
wxBrush backGround( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID );
//dc.SetBrush( *wxLIGHT_GREY_BRUSH );
dc.SetBrush( backGround );
dc.SetPen( *wxTRANSPARENT_PEN );

View File

@ -221,15 +221,6 @@ public:
// get the parent of this item (may return NULL if root)
wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
#if WXWIN_COMPATIBILITY_2_2
// deprecated: Use GetItemParent instead.
wxTreeItemId GetParent(const wxTreeItemId& item) const
{ return GetItemParent( item ); }
// Expose the base class method hidden by the one above.
wxWindow *GetParent() const { return wxControl::GetParent(); }
#endif // WXWIN_COMPATIBILITY_2_2
// for this enumeration function you must pass in a "cookie" parameter
// which is opaque for the application but is necessary for the library
// to make these functions reentrant (i.e. allow more than one

View File

@ -180,7 +180,7 @@ class WXDLLEXPORT wxSystemSettings : public wxSystemSettingsNative
public:
#ifdef __WXUNIVERSAL__
// in wxUniversal we want to use the theme standard colours instead of the
// system ones, otherwuse wxSystemSettings is just the same as
// system ones, otherwise wxSystemSettings is just the same as
// wxSystemSettingsNative
static wxColour GetColour(wxSystemColour index);
#endif // __WXUNIVERSAL__
@ -195,15 +195,13 @@ public:
// Value
static wxSystemScreenType ms_screen;
#if WXWIN_COMPATIBILITY_2_4
// the backwards compatible versions of wxSystemSettingsNative functions,
// don't use these methods in the new code!
static wxColour GetSystemColour(int index)
{ return GetColour((wxSystemColour)index); }
static wxFont GetSystemFont(int index)
{ return GetFont((wxSystemFont)index); }
static int GetSystemMetric(int index)
{ return GetMetric((wxSystemMetric)index); }
wxDEPRECATED(static wxColour GetSystemColour(int index));
wxDEPRECATED(static wxFont GetSystemFont(int index));
wxDEPRECATED(static int GetSystemMetric(int index));
#endif
};
#endif

View File

@ -286,7 +286,7 @@ public:
#if WXWIN_COMPATIBILITY_2_2
// for compatibility only, don't use
int GetCode() const { return m_evtKey.GetKeyCode(); }
wxDEPRECATED( int GetCode() const);
#endif // WXWIN_COMPATIBILITY_2_2
private:

View File

@ -532,15 +532,15 @@ WXDLLIMPEXP_BASE bool wxYieldIfNeeded();
// Format a message on the standard error (UNIX) or the debugging
// stream (Windows)
WXDLLIMPEXP_BASE void wxDebugMsg(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1;
wxDEPRECATED( WXDLLIMPEXP_BASE void wxDebugMsg(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1 );
// Non-fatal error (continues)
WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxInternalErrorStr;
WXDLLIMPEXP_BASE void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr);
wxDEPRECATED( WXDLLIMPEXP_BASE void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr) );
// Fatal error (exits)
WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxFatalErrorStr;
WXDLLIMPEXP_BASE void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
wxDEPRECATED( WXDLLIMPEXP_BASE void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr) );
#endif // WXWIN_COMPATIBILITY_2_2

View File

@ -6,7 +6,7 @@
// Created: 2002/12/15
// RCS-ID: $Id:
// Copyright: 2002 David Elliott
// Licence: wxWidgets licence
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
@ -43,7 +43,7 @@ WX_IMPLEMENT_COCOA_OWNER(wxDialog,NSPanel,NSWindow,NSWindow)
void wxDialog::Init()
{
m_isModal = false;
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
}
bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
@ -222,9 +222,9 @@ void wxDialog::OnOK(wxCommandEvent& event)
void wxDialog::OnApply(wxCommandEvent& event)
{
if (Validate())
TransferDataFromWindow();
// TODO probably need to disable the Apply button until things change again
if (Validate())
TransferDataFromWindow();
// TODO probably need to disable the Apply button until things change again
}
void wxDialog::OnCancel(wxCommandEvent& event)

View File

@ -526,13 +526,13 @@ wxLibraries::wxLibraries():m_loaded(wxKEY_STRING)
wxLibraries::~wxLibraries()
{
wxNode *node = m_loaded.First();
wxNode *node = m_loaded.GetFirst();
while (node) {
wxLibrary *lib = (wxLibrary *)node->Data();
wxLibrary *lib = (wxLibrary *)node->GetData();
delete lib;
node = node->Next();
node = node->GetNext();
}
}
@ -543,7 +543,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
wxNode *node = m_loaded.Find(name.GetData());
if (node != NULL)
return ((wxLibrary *)node->Data());
return ((wxLibrary *)node->GetData());
// If DLL shares data, this is necessary.
old_sm_first = wxClassInfo::sm_first;
@ -567,15 +567,15 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
wxObject *wxLibraries::CreateObject(const wxString& path)
{
wxNode *node = m_loaded.First();
wxNode *node = m_loaded.GetFirst();
wxObject *obj;
while (node) {
obj = ((wxLibrary *)node->Data())->CreateObject(path);
obj = ((wxLibrary *)node->GetData())->CreateObject(path);
if (obj)
return obj;
node = node->Next();
node = node->GetNext();
}
return NULL;
}

View File

@ -72,3 +72,21 @@ void wxSystemSettings::SetScreenType( wxSystemScreenType screen )
ms_screen = screen;
}
#if WXWIN_COMPATIBILITY_2_4
wxColour wxSystemSettings::GetSystemColour(int index)
{
return GetColour((wxSystemColour)index);
}
wxFont wxSystemSettings::GetSystemFont(int index)
{
return GetFont((wxSystemFont)index);
}
int wxSystemSettings::GetSystemMetric(int index)
{
return GetMetric((wxSystemMetric)index);
}
#endif // WXWIN_COMPATIBILITY_2_4

View File

@ -90,5 +90,14 @@ wxTreeEvent::wxTreeEvent(const wxTreeEvent & event)
m_editCancelled = event.m_editCancelled;
}
#if WXWIN_COMPATIBILITY_2_2
int wxTreeEvent::GetCode() const
{
return m_evtKey.GetKeyCode();
}
#endif // WXWIN_COMPATIBILITY_2_2
#endif // wxUSE_TREECTRL

View File

@ -1597,18 +1597,18 @@ void wxGridCellRenderer::Draw(wxGrid& grid,
// grey out fields if the grid is disabled
if( grid.IsEnabled() )
{
if ( isSelected )
{
dc.SetBrush( wxBrush(grid.GetSelectionBackground(), wxSOLID) );
}
else
{
dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) );
}
if ( isSelected )
{
dc.SetBrush( wxBrush(grid.GetSelectionBackground(), wxSOLID) );
}
else
{
dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) );
}
}
else
{
dc.SetBrush(wxBrush(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID));
}
dc.SetPen( *wxTRANSPARENT_PEN );
@ -1644,8 +1644,8 @@ void wxGridCellStringRenderer::SetTextColoursAndFont(wxGrid& grid,
}
else
{
dc.SetTextBackground(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE));
dc.SetTextForeground(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_GRAYTEXT));
dc.SetTextBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
}
dc.SetFont( attr.GetFont() );
@ -1932,7 +1932,7 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params)
else
{
wxString tmp = params.BeforeFirst(_T(','));
if ( !!tmp )
if ( !tmp.empty() )
{
long width;
if ( tmp.ToLong(&width) )
@ -1946,7 +1946,7 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params)
}
tmp = params.AfterFirst(_T(','));
if ( !!tmp )
if ( !tmp.empty() )
{
long precision;
if ( tmp.ToLong(&precision) )

View File

@ -56,7 +56,7 @@ wxListBoxItem::wxListBoxItem(
const wxString& rsStr
)
: wxOwnerDrawn( rsStr
,FALSE
,false
)
{
//
@ -128,7 +128,7 @@ bool wxListBox::Create(
wxSystemSettings vSettings;
SetBackgroundColour(vSettings.GetSystemColour(wxSYS_COLOUR_WINDOW));
SetBackgroundColour(vSettings.GetColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(pParent->GetForegroundColour());
m_windowId = (vId == -1) ? (int)NewControlId() : vId;
@ -172,7 +172,7 @@ bool wxListBox::Create(
);
if (m_hWnd == 0)
{
return FALSE;
return false;
}
//
@ -221,7 +221,7 @@ bool wxListBox::Create(
,nHeight
);
delete pTextFont;
return TRUE;
return true;
} // end of wxListBox::Create
wxListBox::~wxListBox()
@ -435,7 +435,7 @@ bool wxListBox::IsSelected(
int N
) const
{
wxCHECK_MSG( N >= 0 && N < m_nNumItems, FALSE,
wxCHECK_MSG( N >= 0 && N < m_nNumItems, false,
wxT("invalid index in wxListBox::Selected") );
LONG lItem;
@ -785,7 +785,7 @@ bool wxListBox::OS2Command(
//
// Some event we're not interested in
//
return FALSE;
return false;
}
wxCommandEvent vEvent( eEvtType
,m_windowId
@ -873,14 +873,14 @@ bool wxListBox::OS2OnDraw (
//
// Only owner-drawn control should receive this message
//
wxCHECK(((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE);
wxCHECK(((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false);
//
// The item may be -1 for an empty listbox
//
if (lItemID == -1L)
return FALSE;
return false;
wxListBoxItem* pData = (wxListBoxItem*)PVOIDFROMMR( ::WinSendMsg( GetHwnd()
,LM_QUERYITEMHANDLE
@ -889,7 +889,7 @@ bool wxListBox::OS2OnDraw (
)
);
wxCHECK(pData, FALSE );
wxCHECK(pData, false );
wxDC vDc;
wxRect vRect( wxPoint( pDrawStruct->rclItem.xLeft
@ -962,7 +962,7 @@ bool wxListBox::OS2OnDraw (
// For now we don't care about anything else
// just ignore the entire message!
//
return TRUE;
return true;
}
}
return pData->OnDrawItem( vDc

View File

@ -103,7 +103,7 @@ bool wxXmlResource::Load(const wxString& filemask)
fnd = wxXmlFindFirst;
else
fnd = filemask;
while (!!fnd)
while (!fnd.empty())
{
// NB: Load() accepts both filenames and URLs (should probably be
// changed to filenames only, but embedded resources currently