wxUSE_IMAGE cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -255,12 +255,16 @@ wxCursor::wxCursor(char **bits)
|
|||||||
|
|
||||||
bool wxCursor::CreateFromXpm(const char **bits)
|
bool wxCursor::CreateFromXpm(const char **bits)
|
||||||
{
|
{
|
||||||
|
#if wxUSE_IMAGE
|
||||||
wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") )
|
wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") )
|
||||||
wxXPMDecoder decoder;
|
wxXPMDecoder decoder;
|
||||||
wxImage img = decoder.ReadData(bits);
|
wxImage img = decoder.ReadData(bits);
|
||||||
wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") )
|
wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid cursor data") )
|
||||||
CreateFromImage( img ) ;
|
CreateFromImage( img ) ;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
WXHCURSOR wxCursor::GetHCURSOR() const
|
WXHCURSOR wxCursor::GetHCURSOR() const
|
||||||
@@ -291,6 +295,8 @@ short GetCTabIndex( CTabHandle colors , RGBColor *col )
|
|||||||
return retval ;
|
return retval ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_IMAGE
|
||||||
|
|
||||||
void wxCursor::CreateFromImage(const wxImage & image)
|
void wxCursor::CreateFromImage(const wxImage & image)
|
||||||
{
|
{
|
||||||
m_refData = new wxCursorRefData;
|
m_refData = new wxCursorRefData;
|
||||||
@@ -402,6 +408,8 @@ void wxCursor::CreateFromImage(const wxImage & image)
|
|||||||
M_CURSORDATA->m_isColorCursor = true ;
|
M_CURSORDATA->m_isColorCursor = true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //wxUSE_IMAGE
|
||||||
|
|
||||||
wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
|
wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
|
||||||
{
|
{
|
||||||
m_refData = new wxCursorRefData;
|
m_refData = new wxCursorRefData;
|
||||||
@@ -438,6 +446,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if wxUSE_IMAGE
|
||||||
wxImage image ;
|
wxImage image ;
|
||||||
image.LoadFile( cursor_file , flags ) ;
|
image.LoadFile( cursor_file , flags ) ;
|
||||||
if( image.Ok() )
|
if( image.Ok() )
|
||||||
@@ -447,6 +456,7 @@ wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int ho
|
|||||||
delete m_refData ;
|
delete m_refData ;
|
||||||
CreateFromImage(image) ;
|
CreateFromImage(image) ;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user