]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/gdiimage.cpp
more fixes to radio menu items: fixed Check() for them; allow separators inside the...
[wxWidgets.git] / src / os2 / gdiimage.cpp
index d3b1965074ffe4558683dd8be0f07baeddf9b757..33c15169e256b4c9a0eb02df153e9faea4862e89 100644 (file)
@@ -30,9 +30,7 @@
 #endif // WX_PRECOMP
 
 #include "wx/os2/private.h"
-
 #include "wx/app.h"
-
 #include "wx/os2/gdiimage.h"
 
 // ----------------------------------------------------------------------------
@@ -199,8 +197,8 @@ private:
 #if !USE_SHARED_LIBRARIES
     IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
     IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
-    IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxGDIImageHandler)
-    IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxGDIImageHandler)
+    IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxObject)
+    IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxObject)
 #endif
 
 // ----------------------------------------------------------------------------
@@ -335,7 +333,9 @@ void wxGDIImage::CleanUpHandlers()
         wxNode*                     pNext    = pNode->Next();
 
         delete pHandler;
+#if (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
         delete pNode;
+#endif
         pNode = pNext;
     }
 }
@@ -344,12 +344,6 @@ void wxGDIImage::InitStandardHandlers()
 {
     AddHandler(new wxBMPResourceHandler);
     AddHandler(new wxBMPFileHandler);
-
-    // Not added by default: include xpmhand.h in your app
-    // and call these in your wxApp::OnInit.
-    //  AddHandler(new wxXPMFileHandler);
-    //  AddHandler(new wxXPMDataHandler);
-
     AddHandler(new wxICOResourceHandler);
     AddHandler(new wxICOFileHandler);
 }
@@ -518,42 +512,23 @@ bool wxICOResourceHandler::LoadIcon(
 , const wxString&                   rName
 , HPS                               hPs
 , long                              lFlags
-, int                               nDesiredWidth
-, int                               nDesiredHeight
+, int                               WXUNUSED(nDesiredWidth)
+, int                               WXUNUSED(nDesiredHeight)
 )
 {
-    // TODO: load icon from a file
-    /*
-    HICON hicon;
+    HPOINTER                        hIcon;
 
-#if defined(__WIN32__) && !defined(__SC__)
-    if ( desiredWidth != -1 && desiredHeight != -1 )
-    {
-        hicon = (HICON)::LoadImage(wxGetInstance(), name, IMAGE_ICON,
-                                    desiredWidth, desiredHeight,
-                                    LR_DEFAULTCOLOR);
-    }
-    else
-#endif // Win32
-    {
-        hicon = ::LoadIcon(wxGetInstance(), name);
-    }
+    hIcon = ::WinLoadFileIcon( (PSZ)rName.c_str()
+                              ,TRUE // load for private use
+                             );
 
-    wxSize size = GetHiconSize(hicon);
-    icon->SetSize(size.x, size.y);
+    pIcon->SetSize(32, 32); // all OS/2 icons are 32 x 32
 
-    // Override the found values with desired values
-    if ( desiredWidth > -1 && desiredHeight > -1 )
-    {
-        icon->SetSize(desiredWidth, desiredHeight);
-    }
 
-    icon->SetHICON((WXHICON)hicon);
+    pIcon->SetHICON((WXHICON)hIcon);
 
-    return icon->Ok();
-    */
-    return(FALSE);
-}
+    return pIcon->Ok();
+} // end of wxICOResourceHandler::LoadIcon
 
 // ----------------------------------------------------------------------------
 // private functions