From 8495ba53688a1d5de6cecffdd1a0e783f8b43a00 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Tue, 24 Jun 2003 19:49:13 +0000 Subject: [PATCH] updated code to not use deprecated methods git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/fl/garbagec.h | 2 +- contrib/src/fl/controlbar.cpp | 48 ++++++++++++++++---------------- contrib/src/fl/frmview.cpp | 42 ++++++++++++++-------------- contrib/src/fl/garbagec.cpp | 46 +++++++++++++++--------------- contrib/src/fl/gcupdatesmgr.cpp | 24 ++++++++-------- contrib/src/fl/rowdragpl.cpp | 14 +++++----- contrib/src/fl/updatesmgr.cpp | 18 ++++++------ 7 files changed, 97 insertions(+), 97 deletions(-) diff --git a/contrib/include/wx/fl/garbagec.h b/contrib/include/wx/fl/garbagec.h index 652854fc01..4ea0640e8e 100644 --- a/contrib/include/wx/fl/garbagec.h +++ b/contrib/include/wx/fl/garbagec.h @@ -27,7 +27,7 @@ struct GCItem inline void* gc_node_to_obj( wxNode* pGCNode ) { - return ( (GCItem*) (pGCNode->Data()) )->mpObj; + return ( (GCItem*) (pGCNode->GetData()) )->mpObj; } /* diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index 6d6a930fdc..592d39c1b3 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -402,11 +402,11 @@ void wxFrameLayout::ReparentWindow( wxWindow* pChild, wxWindow* pNewParent ) void wxFrameLayout::DestroyBarWindows() { - wxNode* pSpy = mBarSpyList.First(); + wxNode* pSpy = mBarSpyList.GetFirst(); while( pSpy ) { - cbBarSpy& spy = *((cbBarSpy*)pSpy->Data()); + cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData()); if ( spy.mpBarWnd->GetEventHandler() == &spy ) @@ -414,7 +414,7 @@ void wxFrameLayout::DestroyBarWindows() delete &spy; - pSpy = pSpy->Next(); + pSpy = pSpy->GetNext(); } mBarSpyList.Clear(); @@ -432,15 +432,15 @@ void wxFrameLayout::DestroyBarWindows() void wxFrameLayout::ShowFloatedWindows( bool show ) { - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); pFFrm->Show( show ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -491,11 +491,11 @@ wxFrameLayout::~wxFrameLayout() if ( mpNECursor ) delete mpNECursor; - wxNode* pSpy = mBarSpyList.First(); + wxNode* pSpy = mBarSpyList.GetFirst(); while( pSpy ) { - cbBarSpy& spy = *((cbBarSpy*)pSpy->Data()); + cbBarSpy& spy = *((cbBarSpy*)pSpy->GetData()); if ( spy.mpBarWnd->GetEventHandler() == &spy ) @@ -503,7 +503,7 @@ wxFrameLayout::~wxFrameLayout() delete &spy; - pSpy = pSpy->Next(); + pSpy = pSpy->GetNext(); } for ( i = 0; i != mAllBars.Count(); ++i ) @@ -715,11 +715,11 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) { pBar->mpBarWnd->Show(FALSE); // to avoid flicker upon reparenting - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); if ( pFFrm->GetBar() == pBar ) { @@ -739,7 +739,7 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) pFFrm->Destroy(); break; } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } // FOR NOW:: excessive! @@ -826,11 +826,11 @@ void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar ) { if ( !(mFloatingOn && pBar->mFloatingOn)) return; - wxNode* pNode = mFloatedFrames.First(); + wxNode* pNode = mFloatedFrames.GetFirst(); while( pNode ) { - cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->Data()); + cbFloatedBarWindow* pFFrm = ((cbFloatedBarWindow*)pNode->GetData()); if ( pFFrm->GetBar() == pBar ) { @@ -848,7 +848,7 @@ void wxFrameLayout::RepositionFloatedBar( cbBarInfo* pBar ) break; } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -2128,9 +2128,9 @@ IMPLEMENT_DYNAMIC_CLASS( cbBarInfo, wxObject ) cbBarInfo::cbBarInfo(void) : mpRow( NULL ), + mFloatingOn( TRUE ), mpNext( NULL ), - mpPrev( NULL ), - mFloatingOn( TRUE ) + mpPrev( NULL ) {} cbBarInfo::~cbBarInfo() @@ -2500,7 +2500,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY ) int range = lowerY - upperY; int oneThird = range / 3; - wxNode* pRow = mRows.First(); + wxNode* pRow = mRows.GetFirst(); int row = 0; int curY = 0; @@ -2508,7 +2508,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY ) while( pRow ) { - int rowHeight = GetRowHeight( (wxList*)pRow->Data() ); + int rowHeight = GetRowHeight( (wxList*)pRow->GetData() ); if ( upperY >= curY && lowerY < curY ) return row; @@ -2527,7 +2527,7 @@ int cbDockPane::GetRowAt( int upperY, int lowerY ) ++row; curY += rowHeight; - pRow = pRow->Next(); + pRow = pRow->GetNext(); } */ @@ -3489,10 +3489,10 @@ void cbDockPane::GetRowShapeData( cbRowInfo* pRow, wxList* pLst ) void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst ) { - if ( pLst->First() == NULL ) + if ( pLst->GetFirst() == NULL ) return; - wxNode* pData = pLst->First(); + wxNode* pData = pLst->GetFirst(); size_t i; for ( i = 0; i != pRow->mBars.Count(); ++i ) @@ -3501,12 +3501,12 @@ void cbDockPane::SetRowShapeData( cbRowInfo* pRow, wxList* pLst ) cbBarInfo& bar = *pRow->mBars[i];; - cbBarShapeData& data = *((cbBarShapeData*)pData->Data()); + cbBarShapeData& data = *((cbBarShapeData*)pData->GetData()); bar.mBounds = data.mBounds; bar.mLenRatio = data.mLenRatio; - pData = pData->Next(); + pData = pData->GetNext(); } } diff --git a/contrib/src/fl/frmview.cpp b/contrib/src/fl/frmview.cpp index 0ed194084f..163b5fedee 100644 --- a/contrib/src/fl/frmview.cpp +++ b/contrib/src/fl/frmview.cpp @@ -171,13 +171,13 @@ void wxFrameManager::DestroyViews() { DeactivateCurrentView(); - wxNode* pNode = mViews.First(); + wxNode* pNode = mViews.GetFirst(); while ( pNode ) { - delete (wxFrameView*)pNode->Data(); + delete (wxFrameView*)pNode->GetData(); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } if ( mActiveViewNo != -1 && GetParentFrame() ) @@ -187,17 +187,17 @@ void wxFrameManager::DestroyViews() int wxFrameManager::GetViewNo( wxFrameView* pView ) { - wxNode* pNode = mViews.First(); + wxNode* pNode = mViews.GetFirst(); int n = 0; while ( pNode ) { - if ( (wxFrameView*)pNode->Data() == pView ) + if ( (wxFrameView*)pNode->GetData() == pView ) return n; ++n; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } return -1; @@ -228,7 +228,7 @@ void wxFrameManager::EnableMenusForView( wxFrameView* pView, bool enable ) void wxFrameManager::SyncAllMenus() { - wxNode* pNode = mViews.First(); + wxNode* pNode = mViews.GetFirst(); int i = 0; while ( pNode ) @@ -237,7 +237,7 @@ void wxFrameManager::SyncAllMenus() EnableMenusForView( (wxFrameView*)pNode->GetData(), FALSE ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } EnableMenusForView( GetView( mActiveViewNo ), TRUE ); @@ -264,16 +264,16 @@ void wxFrameManager::Init( wxWindow* pMainFrame, const wxString& settingsFile ) mSettingsFile = settingsFile; mpFrameWnd = pMainFrame; - wxNode* pNode = mViews.First(); + wxNode* pNode = mViews.GetFirst(); while ( pNode ) { - wxFrameView* pView = (wxFrameView*)pNode->Data(); + wxFrameView* pView = (wxFrameView*)pNode->GetData(); pView->OnInit(); pView->OnInitMenus(); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } if ( !ReloadViews() ) @@ -281,19 +281,19 @@ void wxFrameManager::Init( wxWindow* pMainFrame, const wxString& settingsFile ) // if loading of settings file failed (e.g. was not found), // do recreation of items in each view - pNode = mViews.First(); + pNode = mViews.GetFirst(); while ( pNode ) { - wxFrameView* pView = (wxFrameView*)pNode->Data(); + wxFrameView* pView = (wxFrameView*)pNode->GetData(); pView->OnRecreate(); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } - if ( mActiveViewNo >= mViews.Number() ) + if ( mActiveViewNo >= mViews.GetCount() ) mActiveViewNo = -1; ActivateView( GetView( ( mActiveViewNo == -1 ) ? 0 : mActiveViewNo ) ); @@ -321,15 +321,15 @@ int wxFrameManager::GetActiveViewNo() wxFrameView* wxFrameManager::GetActiveView() { - wxNode* pNode = mViews.Nth( mActiveViewNo ); + wxNode* pNode = mViews.Item( mActiveViewNo ); - if ( pNode ) return (wxFrameView*)pNode->Data(); + if ( pNode ) return (wxFrameView*)pNode->GetData(); else return NULL; } wxNode* wxFrameManager::GetActiveViewNode() { - return mViews.Nth( mActiveViewNo ); + return mViews.Item( mActiveViewNo ); } wxFrame* wxFrameManager::GetParentFrame() @@ -344,9 +344,9 @@ wxWindow* wxFrameManager::GetParentWindow() wxFrameView* wxFrameManager::GetView( int viewNo ) { - wxNode* pNode = mViews.Nth( viewNo ); + wxNode* pNode = mViews.Item( viewNo ); - if ( pNode ) return (wxFrameView*)pNode->Data(); + if ( pNode ) return (wxFrameView*)pNode->GetData(); else return NULL; } @@ -444,6 +444,6 @@ bool wxFrameManager::ReloadViews() bool wxFrameManager::ViewsAreLoaded() { - return ( mViews.Number() != 0 ); + return ( mViews.GetCount() != 0 ); } diff --git a/contrib/src/fl/garbagec.cpp b/contrib/src/fl/garbagec.cpp index 993da58553..79148099a1 100644 --- a/contrib/src/fl/garbagec.cpp +++ b/contrib/src/fl/garbagec.cpp @@ -32,7 +32,7 @@ inline static GCItem& node_to_item( wxNode* pNode ) { - return *( (GCItem*)(pNode->Data()) ); + return *( (GCItem*)(pNode->GetData()) ); } GarbageCollector::~GarbageCollector() @@ -44,13 +44,13 @@ GarbageCollector::~GarbageCollector() void GarbageCollector::DestroyItemList( wxList& lst ) { - wxNode* pNode = lst.First(); + wxNode* pNode = lst.GetFirst(); while( pNode ) { delete &node_to_item( pNode ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } lst.Clear(); @@ -58,7 +58,7 @@ void GarbageCollector::DestroyItemList( wxList& lst ) wxNode* GarbageCollector::FindItemNode( void* pForObj ) { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.GetFirst(); while( pNode ) { @@ -66,7 +66,7 @@ wxNode* GarbageCollector::FindItemNode( void* pForObj ) return pNode; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } int avoidCompilerWarning = 0; @@ -77,15 +77,15 @@ wxNode* GarbageCollector::FindItemNode( void* pForObj ) wxNode* GarbageCollector::FindReferenceFreeItemNode() { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.GetFirst(); while( pNode ) { - if ( node_to_item( pNode ).mRefs.Number() == 0 ) + if ( node_to_item( pNode ).mRefs.GetCount() == 0 ) return pNode; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } return 0; @@ -93,18 +93,18 @@ wxNode* GarbageCollector::FindReferenceFreeItemNode() void GarbageCollector::RemoveReferencesToNode( wxNode* pItemNode ) { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.GetFirst(); while( pNode ) { wxList& refLst = node_to_item( pNode ).mRefs; - wxNode* pRefNode = refLst.First(); + wxNode* pRefNode = refLst.GetFirst(); while( pRefNode ) { - if ( pRefNode->Data() == (wxObject*)pItemNode ) + if ( pRefNode->GetData() == (wxObject*)pItemNode ) { - wxNode* pNext = pRefNode->Next(); + wxNode* pNext = pRefNode->GetNext(); refLst.DeleteNode( pRefNode ); @@ -112,31 +112,31 @@ void GarbageCollector::RemoveReferencesToNode( wxNode* pItemNode ) continue; } - else pRefNode = pRefNode->Next(); + else pRefNode = pRefNode->GetNext(); } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } void GarbageCollector::ResolveReferences() { - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.GetFirst(); while( pNode ) { GCItem& item = node_to_item( pNode ); - wxNode* pRefNode = item.mRefs.First(); + wxNode* pRefNode = item.mRefs.GetFirst(); while( pRefNode ) { - pRefNode->SetData( (wxObject*) FindItemNode( (void*)pRefNode->Data() ) ); + pRefNode->SetData( (wxObject*) FindItemNode( (void*)pRefNode->GetData() ) ); - pRefNode = pRefNode->Next(); + pRefNode = pRefNode->GetNext(); } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } @@ -173,7 +173,7 @@ void GarbageCollector::ArrangeCollection() // append it to the list, where items are contained // in the increasing order of dependencies - mRegularLst.Append( pItemNode->Data() ); + mRegularLst.Append( pItemNode->GetData() ); mAllNodes.DeleteNode( pItemNode ); @@ -187,13 +187,13 @@ void GarbageCollector::ArrangeCollection() // otherwise, what is left - all nodes, which // are involved into cycled chains (rings) - wxNode* pNode = mAllNodes.First(); + wxNode* pNode = mAllNodes.GetFirst(); while( pNode ) { - mCycledLst.Append( pNode->Data() ); + mCycledLst.Append( pNode->GetData() ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } mAllNodes.Clear(); diff --git a/contrib/src/fl/gcupdatesmgr.cpp b/contrib/src/fl/gcupdatesmgr.cpp index 3a55694b35..d98cf4d38b 100644 --- a/contrib/src/fl/gcupdatesmgr.cpp +++ b/contrib/src/fl/gcupdatesmgr.cpp @@ -53,7 +53,7 @@ struct cbRectInfo static inline cbRectInfo& node_to_rect_info( wxNode* pNode ) { - return *( (cbRectInfo*) (pNode->Data()) ); + return *( (cbRectInfo*) (pNode->GetData()) ); } /***** Implementation for class cbSimpleUpdatesMgr *****/ @@ -276,13 +276,13 @@ void cbGCUpdatesMgr::UpdateNow() void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) { - wxNode* pNode1 = items.First(); + wxNode* pNode1 = items.GetFirst(); while( pNode1 ) { cbRectInfo& info = node_to_rect_info( pNode1 ); - wxNode* pNode2 = items.First(); + wxNode* pNode2 = items.GetFirst(); // and node itself @@ -305,10 +305,10 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) mGC.AddDependency( &info, &otherInfo ); } - pNode2 = pNode2->Next(); + pNode2 = pNode2->GetNext(); } - pNode1 = pNode1->Next(); + pNode1 = pNode1->GetNext(); } mGC.ArrangeCollection(); // order nodes according "least-dependency" rule, @@ -318,7 +318,7 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) // they stand in linear (not cyclic) dependency with other // regular nodes). - wxNode* pNode = mGC.GetRegularObjects().First(); + wxNode* pNode = mGC.GetRegularObjects().GetFirst(); while ( pNode ) { @@ -330,12 +330,12 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) else info.mpPane->SizeBar( info.mpBar ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } // cycled item nodes, need to be both resized and repainted - pNode = mGC.GetCycledObjects().First(); + pNode = mGC.GetCycledObjects().GetFirst(); while ( pNode ) { @@ -380,20 +380,20 @@ void cbGCUpdatesMgr::DoRepositionItems( wxList& items ) pWnd->Refresh(); } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } // release data prepared for GC alg. - pNode = items.First(); + pNode = items.GetFirst(); while( pNode ) { - cbRectInfo* pInfo = (cbRectInfo*)(pNode->Data()); + cbRectInfo* pInfo = (cbRectInfo*)(pNode->GetData()); delete pInfo; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } mGC.Reset(); // reinit GC diff --git a/contrib/src/fl/rowdragpl.cpp b/contrib/src/fl/rowdragpl.cpp index 062e312bc5..815055194d 100644 --- a/contrib/src/fl/rowdragpl.cpp +++ b/contrib/src/fl/rowdragpl.cpp @@ -423,19 +423,19 @@ void cbRowDragPlugin::OnDrawPaneBackground ( cbDrawPaneDecorEvent& event ) int cbRowDragPlugin::GetHRowsCountForPane( cbDockPane* pPane ) { - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.GetFirst(); int maxIconNo = -1; while( pNode ) { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->GetData(); if ( pHBInfo->mAlignment == pPane->mAlignment ) maxIconNo = wxMax( maxIconNo, pHBInfo->mIconNo ); - pNode = pNode->Next(); + pNode = pNode->GetNext(); } return ( maxIconNo + 1 ); @@ -805,7 +805,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) cbRowInfo* pNewRow = new cbRowInfo(); - wxNode* pNode = mHiddenBars.First(); + wxNode* pNode = mHiddenBars.GetFirst(); int rowNo = 0; @@ -813,7 +813,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) while( pNode ) { - cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->Data(); + cbHiddenBarInfo* pHBInfo = (cbHiddenBarInfo*)pNode->GetData(); if ( pHBInfo->mAlignment == mpPane->mAlignment && pHBInfo->mIconNo == collapsedIconIdx ) @@ -831,7 +831,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) // remove bar info from internal list - wxNode* pNext = pNode->Next(); + wxNode* pNext = pNode->GetNext(); delete pHBInfo; mHiddenBars.DeleteNode( pNode ); @@ -848,7 +848,7 @@ void cbRowDragPlugin::ExpandRow( int collapsedIconIdx ) --pHBInfo->mIconNo; - pNode = pNode->Next(); + pNode = pNode->GetNext(); } } diff --git a/contrib/src/fl/updatesmgr.cpp b/contrib/src/fl/updatesmgr.cpp index c126fbfb03..cf08383c9e 100644 --- a/contrib/src/fl/updatesmgr.cpp +++ b/contrib/src/fl/updatesmgr.cpp @@ -249,25 +249,25 @@ void cbSimpleUpdatesMgr::UpdateNow() // step #2 - do ordered refreshing and resizing of bar window objects now - wxNode* pNode = mBarsToRefresh.First(); - wxNode* pPaneNode = mPanesList.First(); + wxNode* pNode = mBarsToRefresh.GetFirst(); + wxNode* pPaneNode = mPanesList.GetFirst(); while( pNode ) { - cbBarInfo* pBar = (cbBarInfo*) pNode->Data(); - cbDockPane* pPane = (cbDockPane*)pPaneNode->Data(); + cbBarInfo* pBar = (cbBarInfo*) pNode->GetData(); + cbDockPane* pPane = (cbDockPane*)pPaneNode->GetData(); pPane->SizeBar( pBar ); - pNode = pNode->Next(); - pPaneNode = pPaneNode->Next(); + pNode = pNode->GetNext(); + pPaneNode = pPaneNode->GetNext(); } - pNode = mBarsToRefresh.First(); + pNode = mBarsToRefresh.GetFirst(); while( pNode ) { - cbBarInfo* pBar = (cbBarInfo*)pNode->Data(); + cbBarInfo* pBar = (cbBarInfo*)pNode->GetData(); if ( pBar->mpBarWnd ) { @@ -278,7 +278,7 @@ void cbSimpleUpdatesMgr::UpdateNow() //info.mpBarWnd->Show(TRUE); } - pNode = pNode->Next(); + pNode = pNode->GetNext(); } if ( clientWindowChanged ) -- 2.45.2