even compile)
- For all wxInputStreams, Eof() becomes true after an attempt has been made
to read _past_ the end of file.
+- wxCHECK family of macros now must be followed by a semicolon
+
Deprecated methods since 2.6.x and their replacements
-----------------------------------------------------
#if wxUSE_IMAGE && wxUSE_XPM
UnRef();
- wxCHECK_MSG( xpm, false, wxT("invalid XPM data") )
+ wxCHECK_MSG( xpm, false, wxT("invalid XPM data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(xpm);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") )
+ wxCHECK_MSG( img.Ok(), false, wxT("invalid XPM data") );
*this = wxBitmap(img);
return true;
// ----------------------------------------------------------------------------
// debugging helper: just a convenient replacement of wxCHECK()
-#define wxDATETIME_CHECK(expr, msg) \
- if ( !(expr) ) \
- { \
- wxFAIL_MSG(msg); \
- *this = wxInvalidDateTime; \
- return *this; \
- }
+#define wxDATETIME_CHECK(expr, msg) \
+ wxCHECK2_MSG(expr, *this = wxInvalidDateTime; return *this, msg)
// ----------------------------------------------------------------------------
// private classes
depth = visual->depth;
wxCHECK_MSG( (depth == visual->depth) || (depth == 1) || (depth == 32), false,
- wxT("invalid bitmap depth") )
+ wxT("invalid bitmap depth") );
m_refData = new wxBitmapRefData();
M_BMPDATA->m_mask = (wxMask *) NULL;
{
UnRef();
- wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
GdkVisual *visual = wxTheApp->GetGdkVisual();
{
UnRef();
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") )
- wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") )
+ wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") );
if (image.GetWidth() <= 0 || image.GetHeight() <= 0)
return false;
GdkAtom format = drop_target->GetMatchingPair();
// this does happen somehow, see bug 555111
- wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") )
+ wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") );
/*
GdkDragAction action = GDK_ACTION_MOVE;
{
UnRef();
- wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
GdkVisual *visual = wxTheApp->GetGdkVisual();
{
UnRef();
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") )
- wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") )
+ wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") );
if (image.GetWidth() <= 0 || image.GetHeight() <= 0)
return false;
GdkAtom format = drop_target->GetMatchingPair();
// this does happen somehow, see bug 555111
- wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") )
+ wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") );
/*
GdkDragAction action = GDK_ACTION_MOVE;
{
GdkFont *font = (GdkFont *) NULL;
- wxCHECK_MSG( Ok(), font, wxT("invalid font") )
+ wxCHECK_MSG( Ok(), font, wxT("invalid font") );
long int_scale = long(scale * 100.0 + 0.5); // key for fontlist
int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100);
bool wxBitmap::CreateFromXpm(const char **bits)
{
#if wxUSE_IMAGE
- wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
wxBitmap::wxBitmap(const wxImage& image, int depth)
{
- wxCHECK_RET( image.Ok(), wxT("invalid image") )
+ wxCHECK_RET( image.Ok(), wxT("invalid image") );
// width and height of the device-dependent bitmap
int width = image.GetWidth();
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;
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 ) ;
return true;
#else
bool wxBitmap::CreateFromXpm(const char **bits)
{
- wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits);
- wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") )
+ wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") );
*this = wxBitmap(img);
return TRUE;
}
wxBitmap::wxBitmap(const wxImage& image, int depth)
{
- wxCHECK_RET( image.Ok(), wxT("invalid image") )
- wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") )
+ wxCHECK_RET( image.Ok(), wxT("invalid image") );
+ wxCHECK_RET( depth == -1, wxT("invalid bitmap depth") );
m_refData = new wxBitmapRefData();
bool wxCursor::CreateFromXpm(const char **bits)
{
- wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") )
+ wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid cursor data") );
wxXPMDecoder decoder;
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 ) ;
return TRUE;
}
{
UnRef();
- wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") )
+ wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") );
pixel_format_t pf_dummy;
pixel_format_t *pf;
bool wxBitmap::CreateFromXpm(const char **bits)
{
- wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
{
long width, height;
- wxCHECK_RET( image.Ok(), wxT("invalid image") )
+ wxCHECK_RET( image.Ok(), wxT("invalid image") );
width = image.GetWidth();
height = image.GetHeight();
bool wxBitmap::CreateFromXpm(const char **data)
{
#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
- wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") );
wxXPMDecoder decoder;
wxImage img = decoder.ReadData(data);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
*this = wxBitmap(img);
return true;
bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
WXWORD pos, WXHWND control)
{
- wxCHECK_MSG( control, false, wxT("scrolling what?") )
+ wxCHECK_MSG( control, false, wxT("scrolling what?") );
if ( wParam != SB_THUMBPOSITION )
{
// A hidden root can be neither expanded nor collapsed.
wxCHECK_RET( !(m_windowStyle & wxTR_HIDE_ROOT) || (HITEM(item) != TVI_ROOT),
- wxT("Can't expand/collapse hidden root node!") )
+ wxT("Can't expand/collapse hidden root node!") );
// TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must
// emulate them. This behaviour has changed slightly with comctl32.dll
WXWPARAM wParam = info->wVKey;
- int keyCode = wxCharCodeMSWToWX(info->wVKey);
+ int keyCode = wxCharCodeMSWToWX(wParam);
if ( !keyCode )
{
// wxCharCodeMSWToWX() returns 0 to indicate that this is a
#if wxUSE_IMAGE && wxUSE_XPM
Init();
- wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data"))
+ wxCHECK_MSG(ppData != NULL, false, wxT("invalid bitmap data"));
wxXPMDecoder vDecoder;
wxImage vImg = vDecoder.ReadData(ppData);
- wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data"))
+ wxCHECK_MSG(vImg.Ok(), false, wxT("invalid bitmap data"));
*this = wxBitmap(vImg);
return true;
WXWORD wPos,
WXHWND hControl )
{
- wxCHECK_MSG(hControl, false, wxT("scrolling what?") )
+ wxCHECK_MSG(hControl, false, wxT("scrolling what?") );
wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK, m_windowId );
int nVal = (int)wPos; // cast is important for negative values!
{
UnRef();
- wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") )
+ wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") );
m_refData = new wxBitmapRefData();
UnRef();
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") )
- wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") )
+ wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") );
m_refData = new wxBitmapRefData();
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth))
{
#if wxHAVE_LIB_XPM
- wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
+ wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
if (!bitmap->GetRefData())
bitmap->SetRefData( new wxBitmapRefData() );