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:
@@ -4,9 +4,9 @@
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Created: 2002/12/15
|
||||
// RCS-ID: $Id:
|
||||
// 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,
|
||||
@@ -194,15 +194,15 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
||||
event.Veto();
|
||||
|
||||
static wxList closing;
|
||||
|
||||
|
||||
if ( closing.Member(this) )
|
||||
{
|
||||
wxLogDebug(wxT("WARNING: Attempting to recursively call Close for dialog"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
closing.Append(this);
|
||||
|
||||
|
||||
wxLogTrace(wxTRACE_COCOA,wxT("Sending Cancel Event"));
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
@@ -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)
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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) )
|
||||
@@ -3653,7 +3653,7 @@ void wxGridCornerLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
rect.SetY( 1 );
|
||||
rect.SetWidth( client_width - 2 );
|
||||
rect.SetHeight( client_height - 2 );
|
||||
|
||||
|
||||
wxRendererNative::Get().DrawHeaderButton( this, dc, rect, 0 );
|
||||
#else
|
||||
dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW),1, wxSOLID) );
|
||||
@@ -7220,9 +7220,9 @@ void wxGrid::DrawRowLabel( wxDC& dc, int row )
|
||||
rect.SetY( GetRowTop(row) + 1 );
|
||||
rect.SetWidth( m_rowLabelWidth - 2 );
|
||||
rect.SetHeight( GetRowHeight(row) - 2 );
|
||||
|
||||
|
||||
CalcScrolledPosition( 0, rect.y, NULL, &rect.y );
|
||||
|
||||
|
||||
wxWindowDC *win_dc = (wxWindowDC*) &dc;
|
||||
|
||||
wxRendererNative::Get().DrawHeaderButton( win_dc->m_owner, dc, rect, 0 );
|
||||
@@ -7277,14 +7277,14 @@ void wxGrid::DrawColLabel( wxDC& dc, int col )
|
||||
return;
|
||||
|
||||
int colLeft = GetColLeft(col);
|
||||
|
||||
|
||||
wxRect rect;
|
||||
#ifdef __WXGTK__
|
||||
rect.SetX( colLeft + 1 );
|
||||
rect.SetY( 1 );
|
||||
rect.SetWidth( GetColWidth(col) - 2 );
|
||||
rect.SetHeight( m_colLabelHeight - 2 );
|
||||
|
||||
|
||||
wxWindowDC *win_dc = (wxWindowDC*) &dc;
|
||||
|
||||
wxRendererNative::Get().DrawHeaderButton( win_dc->m_owner, dc, rect, 0 );
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user