/////////////////////////////////////////////////////////////////////////////
-// Name: icon.cpp
+// Name: src/mac/carbon/icon.cpp
// Purpose: wxIcon class
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#include "wx/icon.h"
-#include "wx/image.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/image.h"
+#endif
+
#include "wx/mac/private.h"
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
LoadFile( icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight );
}
+wxIcon::wxIcon(WXHICON icon, const wxSize& size)
+ : wxGDIObject()
+{
+ // as the icon owns that ref, we have to acquire it as well
+ if (icon)
+ AcquireIconRef( (IconRef) icon ) ;
+
+ m_refData = new wxIconRefData( icon ) ;
+ M_ICONDATA->SetWidth( size.x ) ;
+ M_ICONDATA->SetHeight( size.y ) ;
+}
+
wxIcon::~wxIcon()
{
}
{
}
-bool wxIcon::Ok() const
+bool wxIcon::IsOk() const
{
return m_refData != NULL ;
}
{
theId = kAlertStopIcon ;
}
+ else if ( filename == wxT("wxICON_FOLDER") )
+ {
+ theId = kGenericFolderIcon ;
+ }
+ else if ( filename == wxT("wxICON_FOLDER_OPEN") )
+ {
+ theId = kOpenFolderIcon ;
+ }
+ else if ( filename == wxT("wxICON_NORMAL_FILE") )
+ {
+ theId = kGenericDocumentIcon ;
+ }
else
{
#if 0
desiredHeight = loadimage.GetHeight() ;
if ( desiredWidth != loadimage.GetWidth() || desiredHeight != loadimage.GetHeight() )
loadimage.Rescale( desiredWidth , desiredHeight ) ;
-
+
wxBitmap bmp( loadimage );
CopyFromBitmap( bmp ) ;