]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/toplvcmn.cpp
added wxRTTI macros to stream classes (patch 1687073)
[wxWidgets.git] / src / common / toplvcmn.cpp
index 433e3a6aae7b2e7fec5560771a20ac7264b5197c..c1645bd9bec209455765167e66d79a5568965fa6 100644 (file)
@@ -315,6 +315,26 @@ bool wxTopLevelWindowBase::IsAlwaysMaximized() const
 #endif
 }
 
+// ----------------------------------------------------------------------------
+// icons
+// ----------------------------------------------------------------------------
+
+wxIcon wxTopLevelWindowBase::GetIcon() const
+{
+    return m_icons.IsEmpty() ? wxIcon() : m_icons.GetIcon( -1 );
+}
+
+void wxTopLevelWindowBase::SetIcon(const wxIcon& icon)
+{
+    // passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
+    // have any icon), but adding an invalid icon to wxIconBundle is not
+    wxIconBundle icons;
+    if ( icon.Ok() )
+        icons.AddIcon(icon);
+
+    SetIcons(icons);
+}
+
 // ----------------------------------------------------------------------------
 // event handlers
 // ----------------------------------------------------------------------------