git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56374
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
reference counting, the copy is very quick. It is safe to
delete @a icon after calling this function.
reference counting, the copy is very quick. It is safe to
delete @a icon after calling this function.
+ @note In wxMSW, @a icon must be either 16x16 or 32x32 icon.
+
+ @see wxIcon, SetIcons()
*/
void SetIcon(const wxIcon& icon);
*/
void SetIcon(const wxIcon& icon);
@param icons
The icons to associate with this window.
@param icons
The icons to associate with this window.
+ @note In wxMSW, @a icons must contain a 16x16 or 32x32 icon,
+ preferably both.
+
+ @see wxIconBundle
*/
virtual void SetIcons(const wxIconBundle& icons);
*/
virtual void SetIcons(const wxIconBundle& icons);
-void wxTopLevelWindowMSW::DoSelectAndSetIcon(const wxIconBundle& icons,
+bool wxTopLevelWindowMSW::DoSelectAndSetIcon(const wxIconBundle& icons,
if ( icon.Ok() )
{
::SendMessage(GetHwnd(), WM_SETICON, i, (LPARAM)GetHiconOf(icon));
if ( icon.Ok() )
{
::SendMessage(GetHwnd(), WM_SETICON, i, (LPARAM)GetHiconOf(icon));
}
void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
{
wxTopLevelWindowBase::SetIcons(icons);
}
void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
{
wxTopLevelWindowBase::SetIcons(icons);
- DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL);
- DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG);
+ bool ok = DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL);
+ if ( DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
+ ok = true;
+
+ wxASSERT_MSG( ok, "icon bundle doesn't contain any suitable icon" );
}
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
}
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)