Fixed cursor change not showing immediatly

Fixed error message when failed to create icon
This commit is contained in:
Lynix 2012-06-24 15:06:17 +02:00
parent bcf36e7a14
commit d97e4a7f43
4 changed files with 11 additions and 9 deletions

View File

@ -31,7 +31,7 @@ bool NzIcon::Create(const NzImage& icon)
m_impl = new NzIconImpl;
if (!m_impl->Create(icon))
{
NazaraError("Failed to create cursor implementation");
NazaraError("Failed to create icon implementation");
delete m_impl;
m_impl = nullptr;
return false;

View File

@ -21,11 +21,11 @@ bool NzCursorImpl::Create(const NzImage& cursor, int hotSpotX, int hotSpotY)
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms648052(v=vs.85).aspx
ICONINFO iconInfo;
iconInfo.fIcon = FALSE;
iconInfo.xHotspot = hotSpotX;
iconInfo.yHotspot = hotSpotY;
iconInfo.hbmMask = monoBitmap;
iconInfo.hbmColor = bitmap;
iconInfo.fIcon = FALSE;
iconInfo.xHotspot = hotSpotX;
iconInfo.yHotspot = hotSpotY;
iconInfo.hbmMask = monoBitmap;
iconInfo.hbmColor = bitmap;
m_cursor = CreateIconIndirect(&iconInfo);

View File

@ -20,9 +20,9 @@ bool NzIconImpl::Create(const NzImage& icon)
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms648052(v=vs.85).aspx
ICONINFO iconInfo;
iconInfo.fIcon = TRUE;
iconInfo.hbmMask = monoBitmap;
iconInfo.hbmColor = bitmap;
iconInfo.fIcon = TRUE;
iconInfo.hbmMask = monoBitmap;
iconInfo.hbmColor = bitmap;
m_icon = CreateIconIndirect(&iconInfo);

View File

@ -347,6 +347,8 @@ void NzWindowImpl::SetCursor(nzWindowCursor cursor)
void NzWindowImpl::SetCursor(const NzCursor& cursor)
{
m_cursor = cursor.m_impl->GetCursor();
::SetCursor(m_cursor);
}
void NzWindowImpl::SetEventListener(bool listener)