+ wxASSERT( size == wxDefaultSize || (size.x >= 0 && size.y > 0) );
+
+ // We need the standard system icon size when using FALLBACK_SYSTEM.
+ wxCoord sysX = 0,
+ sysY = 0;
+ if ( flags & FALLBACK_SYSTEM )
+ {
+ sysX = wxSystemSettings::GetMetric(wxSYS_ICON_X);
+ sysY = wxSystemSettings::GetMetric(wxSYS_ICON_Y);
+ }
+
+ // If size == wxDefaultSize, we use system default icon size by convention.
+ wxCoord sizeX = size.x;
+ wxCoord sizeY = size.y;
+ if ( size == wxDefaultSize )
+ {
+ wxASSERT_MSG( flags == FALLBACK_SYSTEM,
+ wxS("Must have valid size if not using FALLBACK_SYSTEM") );
+
+ sizeX = sysX;
+ sizeY = sysY;
+ }