Updated depricated stuff

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2004-02-25 23:03:46 +00:00
parent ddefbe7ff2
commit 258f5b3ec3
2 changed files with 23 additions and 22 deletions

View File

@@ -28,6 +28,8 @@ class WXDLLEXPORT wxGDIImageRefData;
class WXDLLEXPORT wxGDIImageHandler; class WXDLLEXPORT wxGDIImageHandler;
class WXDLLEXPORT wxGDIImage; class WXDLLEXPORT wxGDIImage;
WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxGDIImageRefData: common data fields for all derived classes // wxGDIImageRefData: common data fields for all derived classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -149,7 +151,7 @@ class WXDLLEXPORT wxGDIImage : public wxGDIObject
{ {
public: public:
// handlers list interface // handlers list interface
static wxList& GetHandlers() { return ms_handlers; } static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; }
static void AddHandler(wxGDIImageHandler* hHandler); static void AddHandler(wxGDIImageHandler* hHandler);
static void InsertHandler(wxGDIImageHandler* hHandler); static void InsertHandler(wxGDIImageHandler* hHandler);
@@ -234,7 +236,7 @@ protected:
// create the data for the derived class here // create the data for the derived class here
virtual wxGDIImageRefData* CreateData() const = 0; virtual wxGDIImageRefData* CreateData() const = 0;
static wxList ms_handlers; static wxGDIImageHandlerList ms_handlers;
}; };
#endif // _WX_MSW_GDIIMAGE_H_ #endif // _WX_MSW_GDIIMAGE_H_

View File

@@ -33,6 +33,9 @@
#include "wx/app.h" #include "wx/app.h"
#include "wx/os2/gdiimage.h" #include "wx/os2/gdiimage.h"
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxGDIImageHandlerList);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -234,7 +237,7 @@ static wxSize GetHiconSize(WXHICON hicon);
// implementation // implementation
// ============================================================================ // ============================================================================
wxList wxGDIImage::ms_handlers; wxGDIImageHandlerList wxGDIImage::ms_handlers;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxGDIImage functions forwarded to wxGDIImageRefData // wxGDIImage functions forwarded to wxGDIImageRefData
@@ -333,33 +336,29 @@ wxGDIImageHandler* wxGDIImage::FindHandler(
long lType long lType
) )
{ {
wxNode* pNode = ms_handlers.First(); wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst();
while ( node )
while (pNode)
{ {
wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data(); wxGDIImageHandler *handler = node->GetData();
if ( handler->GetType() == type )
return handler;
if (pHandler->GetType() == lType) node = node->GetNext();
return pHandler;
pNode = pNode->Next();
} }
return(NULL);
return((wxGDIImageHandler*)NULL);
} }
void wxGDIImage::CleanUpHandlers() void wxGDIImage::CleanUpHandlers()
{ {
wxNode* pNode = ms_handlers.First(); wxGDIImageHandlerList::compatibility_iterator node = ms_handlers.GetFirst();
while ( node )
while (pNode)
{ {
wxGDIImageHandler* pHandler = (wxGDIImageHandler *)pNode->Data(); wxGDIImageHandler *handler = node->GetData();
wxNode* pNext = pNode->Next(); wxGDIImageHandlerList::compatibility_iterator next = node->GetNext();
delete handler;
delete pHandler; ms_handlers.Erase( node );
#if (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ))) node = next;
delete pNode;
#endif
pNode = pNext;
} }
} }