]> git.saurik.com Git - wxWidgets.git/commitdiff
Old API depreciated. Use of new API. Source cleaning.
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 4 Jan 2005 19:35:52 +0000 (19:35 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 4 Jan 2005 19:35:52 +0000 (19:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
contrib/src/deprecated/proplist.cpp
contrib/src/fl/toolwnd.cpp
include/wx/palmos/treectrl.h
include/wx/settings.h
include/wx/treebase.h
include/wx/utils.h
src/cocoa/dialog.mm
src/common/dynload.cpp
src/common/settcmn.cpp
src/common/treebase.cpp
src/generic/grid.cpp
src/os2/listbox.cpp
src/xrc/xmlres.cpp

index 23d75cf99bd4526cb470e3a21f48f29f9421d41d..e962342691c978a6e85d2a0e580d091201ef179e 100644 (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 =
index f71ceaab405c32d32a7298d1a84945edb204edf5..c3bd5c88763903d309751dc27c683117d5dc18d3 100644 (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 );
index 36dedc2a06578b0f2073a00c4bc9e414b4f7306b..c73ffc730e17a11d07b0faf16c97c03cd35120cb 100644 (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
index 4ed8c4c64ad0fdde97a43557be72f59c92984feb..a4dc9145c112afc25e342a6a09bda68c12d56a72 100644 (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
index 28ec4e527148b341563ae42437c3c3562477624d..7bdc2d2a296cb2270d35c44ec1c6d966779f2805 100644 (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:
index b783dc25d61394c4603c335c7c6d5985bd58afa5..f71325bce7ffcbbd3689f7f61e6a9797a42137b7 100644 (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
 
index 59adee30689d20a6184591976eae094f4faf30b6..e15c2937aa8eaaf96ba5c66f16fde91958dbeba7 100644 (file)
@@ -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)
index 854d7c3049f27648eba7911ca481d49f67d408d2..ded5bbd2d636a099a217ed65f7ede05dda94d930 100644 (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;
 }
index b0b6faf2118dafefda64770dc28346af0ab17b94..f5862ba7afb8734bf80cc9f1bceefc21d7d467ed 100644 (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
index d166c7d7056e55e8c06d441e746a2374450b7555..50a8c96f811392dfee5562e17a59fa48371663cf 100644 (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
 
index 5e2fdb358ca9945c8091f27e1e420668c038bfea..6f849ff36c828772e5ef8e7c556954e23e92ef8a 100644 (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) )
@@ -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 );
index 1d8fbd18d38ec6f578552a90539318026f1b62a7..7cbcb464b9f909543d0fa1fa0d290b3955153449 100644 (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
index 5134702c5041b3a008f740cd1565a566c68bbe9e..a817ecd7ba16e7bb7a762ce0fab12544bad5a6d2 100644 (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