String changes for translations,

Made wxBitmap derive from wxGDIObject,
  Removed #ifdefs around destrctors for GDI lists (wxBrushList etc),
  Created wxEVT_COMMAND_SPINCTRL_UPDATE with obvious usage.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-12-04 10:37:39 +00:00
parent 4f72fe4f1a
commit 58c837a4e6
39 changed files with 262 additions and 317 deletions

View File

@@ -1,17 +1,11 @@
-------------------- High priority ---------------------
Fix bug that thread sample reports about non-finished threads.
More testing of Unicode support.
Add ID based i18n system as a replacement for the
unelegant gettext system.
Add controls to wxToolbar.
Add TIFF handler. Someone? (Hint, hint).
Improve, update translations. Install *.mo files somewehere.
-------------------- Medium priority ---------------------

View File

@@ -66,6 +66,7 @@ const wxEventType wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_FIRST + 14;
const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_FIRST + 15;
const wxEventType wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_FIRST + 16;
const wxEventType wxEVT_COMMAND_TOOL_ENTER = wxEVT_FIRST + 17;
const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_FIRST + 18;
/* Sockets send events, too */
const wxEventType wxEVT_SOCKET = wxEVT_FIRST + 50;
@@ -1649,6 +1650,7 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
#define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
#define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
#define EVT_SPINCTRL(id, fn) { wxEVT_COMMAND_SPINCTRL_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
// Generic command events
#define EVT_COMMAND_LEFT_CLICK(id, fn) { wxEVT_COMMAND_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },

View File

@@ -19,6 +19,7 @@
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
@@ -57,7 +58,7 @@ private:
// wxBitmap
//-----------------------------------------------------------------------------
class wxBitmap: public wxObject
class wxBitmap: public wxGDIObject
{
public:
wxBitmap();

View File

@@ -19,6 +19,7 @@
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
@@ -57,7 +58,7 @@ private:
// wxBitmap
//-----------------------------------------------------------------------------
class wxBitmap: public wxObject
class wxBitmap: public wxGDIObject
{
public:
wxBitmap();

View File

@@ -522,7 +522,7 @@ wxView::wxView()
// SetDocument(doc);
m_viewDocument = (wxDocument*) NULL;
m_viewTypeName = "";
m_viewTypeName = wxT("");
m_viewFrame = (wxFrame *) NULL;
}
@@ -1989,7 +1989,7 @@ void wxFileHistory::Load(wxConfigBase& config)
m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
m_fileHistoryN ++;
buf.Printf(wxT("file%d"), m_fileHistoryN+1);
historyFile = "";
historyFile = wxT("");
}
AddFilesToMenu();
}

View File

@@ -190,7 +190,7 @@ wxDllLoader::GetProgramHandle(void)
// shl_findsymbol with NULL handle looks up in main program
return 0;
#else
wxFAIL_MSG(_("This method is not implemented under Windows or OS/2"));
wxFAIL_MSG( wxT("This method is not implemented under Windows or OS/2"));
return 0;
#endif
}
@@ -321,13 +321,13 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
wxString libPath("/lib:/usr/lib"); // system path first
const char *envLibPath = getenv("LD_LIBRARY_PATH");
if ( envLibPath )
libPath << ':' << envLibPath;
libPath << wxT(':') << envLibPath;
wxStringTokenizer tokenizer(libPath, wxT(':'));
while ( tokenizer.HasMoreToken() )
{
wxString fullname(tokenizer.NextToken());
fullname << '/' << libname;
fullname << wxT('/') << libname;
if ( wxFileExists(fullname) )
{
libname = fullname;

View File

@@ -206,7 +206,7 @@ wxFontMapper::~wxFontMapper()
void wxFontMapper::SetConfigPath(const wxString& prefix)
{
wxCHECK_RET( !prefix.IsEmpty() && prefix[0] == wxCONFIG_PATH_SEPARATOR,
_T("an absolute path should be given to "
wxT("an absolute path should be given to "
"wxFontMapper::SetConfigPath()") );
m_configRootPath = prefix;
@@ -254,7 +254,7 @@ bool wxFontMapper::ChangePath(const wxString& pathNew, wxString *pathOld)
}
wxASSERT_MSG( !pathNew || (pathNew[0] != wxCONFIG_PATH_SEPARATOR),
_T("should be a relative path") );
wxT("should be a relative path") );
path += pathNew;
@@ -278,7 +278,7 @@ wxString wxFontMapper::GetEncodingDescription(wxFontEncoding encoding)
size_t count = WXSIZEOF(gs_encodingDescs);
wxASSERT_MSG( count == WXSIZEOF(gs_encodings),
_T("inconsitency detected - forgot to update one of "
wxT("inconsitency detected - forgot to update one of "
"the arrays?") );
for ( size_t i = 0; i < count; i++ )
@@ -301,7 +301,7 @@ wxString wxFontMapper::GetEncodingName(wxFontEncoding encoding)
size_t count = WXSIZEOF(gs_encodingNames);
wxASSERT_MSG( count == WXSIZEOF(gs_encodings),
_T("inconsitency detected - forgot to update one of "
wxT("inconsitency detected - forgot to update one of "
"the arrays?") );
for ( size_t i = 0; i < count; i++ )
@@ -342,7 +342,7 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
}
else
{
wxLogDebug(_T("corrupted config data - invalid encoding %ld "
wxLogDebug(wxT("corrupted config data - invalid encoding %ld "
"for charset '%s'"), value, charset.c_str());
}
}
@@ -368,20 +368,20 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
{
cs.MakeUpper();
if ( !cs || cs == _T("US-ASCII") )
if ( !cs || cs == wxT("US-ASCII") )
encoding = wxFONTENCODING_DEFAULT;
else if ( cs == _T("KOI8-R") || cs == _T("KOI8-U") )
else if ( cs == wxT("KOI8-R") || cs == wxT("KOI8-U") )
encoding = wxFONTENCODING_KOI8;
else if ( cs.Left(3) == _T("ISO") )
else if ( cs.Left(3) == wxT("ISO") )
{
// the dash is optional (or, to be exact, it is not, but
// several brokenmails "forget" it)
const wxChar *p = cs.c_str() + 3;
if ( *p == _T('-') )
if ( *p == wxT('-') )
p++;
unsigned int value;
if ( wxSscanf(p, _T("8859-%u"), &value) == 1 )
if ( wxSscanf(p, wxT("8859-%u"), &value) == 1 )
{
if ( value < wxFONTENCODING_ISO8859_MAX -
wxFONTENCODING_ISO8859_1 )
@@ -392,7 +392,7 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
}
}
}
else if ( cs.Left(8) == _T("WINDOWS-") )
else if ( cs.Left(8) == wxT("WINDOWS-") )
{
int value;
if ( wxSscanf(cs.c_str() + 8, wxT("%u"), &value) == 1 )
@@ -433,7 +433,7 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
size_t count = WXSIZEOF(gs_encodingDescs);
wxASSERT_MSG( count == WXSIZEOF(gs_encodings),
_T("inconsitency detected - forgot to update one of "
wxT("inconsitency detected - forgot to update one of "
"the arrays?") );
wxString *encodingNamesTranslated = new wxString[count];
@@ -499,7 +499,7 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info,
bool interactive)
{
wxCHECK_MSG( info, FALSE, _T("bad pointer in GetAltForEncoding") );
wxCHECK_MSG( info, FALSE, wxT("bad pointer in GetAltForEncoding") );
if ( encoding == wxFONTENCODING_DEFAULT )
{
@@ -542,7 +542,7 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
}
else
{
wxLogDebug(_T("corrupted config data: string '%s' is not "
wxLogDebug(wxT("corrupted config data: string '%s' is not "
"a valid font encoding info"), fontinfo.c_str());
}
}

View File

@@ -61,7 +61,7 @@ wxZipFSHandler::~wxZipFSHandler()
bool wxZipFSHandler::CanOpen(const wxString& location)
{
wxString p = GetProtocol(location);
return (p == "zip");
return (p == wxT("zip") );
}
@@ -73,14 +73,14 @@ wxFSFile* wxZipFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& l
wxString left = GetLeftLocation(location);
wxInputStream *s;
if (GetProtocol(left) != "file") {
if (GetProtocol(left) != wxT("file")) {
return NULL;
}
s = new wxZipInputStream(left, right);
if (s && (s -> LastError() == wxStream_NOERROR)) {
return new wxFSFile(s,
left + "#zip:" + right,
left + wxT("#zip:") + right,
GetMimeTypeFromExt(location),
GetAnchor(location));
}
@@ -101,7 +101,7 @@ wxString wxZipFSHandler::FindFirst(const wxString& spec, int flags)
m_Archive = NULL;
}
if (GetProtocol(left) != "file") {
if (GetProtocol(left) != wxT("file")) {
return wxEmptyString;
}
@@ -146,7 +146,7 @@ wxString wxZipFSHandler::DoFind()
while (match == wxEmptyString)
{
unzGetCurrentFileInfo((unzFile)m_Archive, NULL, namebuf, 1024, NULL, 0, NULL, 0);
for (c = namebuf; *c; c++) if (*c == '\\') *c = '/';
for (c = namebuf; *c; c++) if (*c == wxT('\\')) *c = wxT('/');
fn = namebuf;
if (fn.Last() == wxT('/')) {
fn.RemoveLast();

View File

@@ -65,7 +65,7 @@ wxFTP::wxFTP()
m_user = wxT("anonymous");
m_passwd = wxGetUserId();
m_passwd += '@';
m_passwd += wxT('@');
m_passwd += wxGetHostName();
SetNotify(0);

View File

@@ -455,7 +455,6 @@ wxBitmapList::wxBitmapList ()
wxBitmapList::~wxBitmapList ()
{
#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
@@ -465,13 +464,11 @@ wxBitmapList::~wxBitmapList ()
delete bitmap;
node = next;
}
#endif
}
// Pen and Brush lists
wxPenList::~wxPenList ()
{
#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
@@ -481,7 +478,6 @@ wxPenList::~wxPenList ()
delete pen;
node = next;
}
#endif
}
void wxPenList::AddPen (wxPen * pen)
@@ -521,7 +517,6 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
wxBrushList::~wxBrushList ()
{
#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
@@ -531,7 +526,6 @@ wxBrushList::~wxBrushList ()
delete brush;
node = next;
}
#endif
}
void wxBrushList::AddBrush (wxBrush * brush)

View File

@@ -64,7 +64,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBMPHandler,wxImageHandler)
#define poffset (line * width * 3 + column * 3)
bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSED(verbose), int WXUNUSED(index) )
bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
{
int rshift = 0, gshift = 0, bshift = 0;
wxUint8 aByte;
@@ -97,12 +97,14 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int height = (int)wxINT32_SWAP_ON_BE( dbuf[1] );
if (width > 32767)
{
wxLogError( wxT("Image width > 32767 pixels for file.") );
if (verbose)
wxLogError( _("BMP: Image width > 32767 pixels for file.") );
return FALSE;
}
if (height > 32767)
{
wxLogError( wxT("Image height > 32767 pixels for file.") );
if (verbose)
wxLogError( _("BMP: Image height > 32767 pixels for file.") );
return FALSE;
}
@@ -115,7 +117,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int bpp = (int)wxUINT16_SWAP_ON_BE( aWord );
if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
{
wxLogError( wxT("unknown bitdepth in file.") );
if (verbose)
wxLogError( _("BMP: Unknown bitdepth in file.") );
return FALSE;
}
@@ -123,7 +126,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
int comp = (int)wxINT32_SWAP_ON_BE( dbuf[0] );
if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS)
{
wxLogError( wxT("unknown encoding in Windows BMP file.") );
if (verbose)
wxLogError( _("BMP: Unknown encoding in file.") );
return FALSE;
}
@@ -136,7 +140,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
((comp == BI_RLE8) && (bpp != 8)) ||
((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32)))
{
wxLogError( wxT("encoding of BMP doesn't match bitdepth.") );
if (verbose)
wxLogError( _("BMP: Encoding doesn't match bitdepth.") );
return FALSE;
}
if (bpp < 16)
@@ -144,7 +149,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
cmap = (struct _cmap *)malloc(sizeof(struct _cmap) * ncolors);
if (!cmap)
{
wxLogError( wxT("Cannot allocate RAM for color map in BMP file.") );
if (verbose)
wxLogError( _("BMP: Couldn't allocate memory.") );
return FALSE;
}
}
@@ -155,7 +161,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
unsigned char *ptr = image->GetData();
if (!ptr)
{
wxLogError( wxT("Cannot allocate RAM for RGB data in file.") );
if (verbose)
wxLogError( _("BMP: Couldn't allocate memory.") );
if (cmap)
free(cmap);
return FALSE;
@@ -263,7 +270,8 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
{
if (comp == BI_RLE4)
{
wxLogError( wxT("Can't deal with 4bit encoded yet.") );
if (verbose)
wxLogError( _("BMP: Cannot deal with 4bit encoded yet.") );
image->Destroy();
free(cmap);
return FALSE;

View File

@@ -45,7 +45,6 @@
class wxImageRefData: public wxObjectRefData
{
public:
wxImageRefData();
~wxImageRefData();
@@ -72,7 +71,8 @@ wxImageRefData::wxImageRefData()
wxImageRefData::~wxImageRefData()
{
if (m_data) free( m_data );
if (m_data)
free( m_data );
}
wxList wxImage::sm_handlers;
@@ -195,8 +195,8 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight())
, image, wxT("invalid subimage size") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()),
image, wxT("invalid subimage size") );
int subwidth=rect.GetWidth();
const int subheight=rect.GetHeight();
@@ -383,9 +383,9 @@ bool wxImage::LoadFile( const wxString& filename, long type )
wxFileInputStream stream(filename);
return LoadFile(stream, type);
}
else {
wxLogError( wxT("Can't load image from file '%s': file does not exist."), filename.c_str() );
else
{
wxLogError( _("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE;
}
@@ -402,9 +402,9 @@ bool wxImage::LoadFile( const wxString& filename, const wxString& mimetype )
wxFileInputStream stream(filename);
return LoadFile(stream, mimetype);
}
else {
wxLogError( wxT("Can't load image from file '%s': file does not exist."), filename.c_str() );
else
{
wxLogError( _("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE;
}
@@ -483,7 +483,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type )
}
wxLogWarning( wxT("No handler found for this image.") );
wxLogWarning( _("No handler found for image type.") );
return FALSE;
}
@@ -491,7 +491,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type )
if (handler == NULL)
{
wxLogWarning( wxT("No image handler for type %d defined."), type );
wxLogWarning( _("No image handler for type %d defined."), type );
return FALSE;
}
@@ -509,7 +509,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype )
if (handler == NULL)
{
wxLogWarning( wxT("No image handler for type %s defined."), mimetype.GetData() );
wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() );
return FALSE;
}
@@ -525,7 +525,7 @@ bool wxImage::SaveFile( wxOutputStream& stream, int type )
if (handler == NULL)
{
wxLogWarning( wxT("No image handler for type %d defined."), type );
wxLogWarning( _("No image handler for type %d defined."), type );
return FALSE;
}
@@ -541,7 +541,7 @@ bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype )
if (handler == NULL)
{
wxLogWarning( wxT("No image handler for type %s defined."), mimetype.GetData() );
wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() );
return FALSE;
}
@@ -680,7 +680,7 @@ bool wxImageHandler::CanRead( const wxString& name )
}
else {
wxLogError( wxT("Can't check image format of file '%s': file does not exist."), name.c_str() );
wxLogError( _("Can't check image format of file '%s': file does not exist."), name.c_str() );
return FALSE;
}

View File

@@ -54,9 +54,9 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
{
switch (error)
{
case E_FORMATO: wxLogError(wxT("wxGIFHandler: error in image format")); break;
case E_MEMORIA: wxLogError(wxT("wxGIFHandler: couldn't allocate memory")); break;
default: wxLogError(wxT("wxGIFHandler: unknown error !!!"));
case E_FORMATO: wxLogError(_("GIF: Error in image format.")); break;
case E_MEMORIA: wxLogError(_("GIF: Couldn't allocate memory.")); break;
default: wxLogError(_("GIF: Unknown error."));
}
}
delete decod;

View File

@@ -169,7 +169,8 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
/* If we get here, the JPEG code has signaled an error.
* We need to clean up the JPEG object, close the input file, and return.
*/
if (verbose) wxLogError(_("Couldn't load a JPEG image - probably file is corrupted."));
if (verbose)
wxLogError(_("JPEG: Couldn't load - file is probably corrupted."));
jpeg_destroy_decompress(&cinfo);
if (image->Ok()) image->Destroy();
return FALSE;
@@ -280,11 +281,13 @@ bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo
if (!verbose) cinfo.err->output_message=NULL;
/* Establish the setjmp return context for my_error_exit to use. */
if (setjmp(jerr.setjmp_buffer)) {
if (setjmp(jerr.setjmp_buffer))
{
/* If we get here, the JPEG code has signaled an error.
* We need to clean up the JPEG object, close the input file, and return.
*/
if (verbose) wxLogError(_("Couldn't save a JPEG image - probably file is corrupted."));
if (verbose)
wxLogError(_("JPEG: Couldn't save image."));
jpeg_destroy_compress(&cinfo);
return FALSE;
}

View File

@@ -229,7 +229,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
if (!CanRead(stream))
{
if (verbose)
wxLogError(wxT("wxPCXHandler: this is not a PCX file"));
wxLogError(_("PCX: this is not a PCX file."));
return FALSE;
}
@@ -242,10 +242,10 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
{
switch (error)
{
case E_FORMATO: wxLogError(wxT("wxPCXHandler: image format unsupported")); break;
case E_MEMORIA: wxLogError(wxT("wxPCXHandler: couldn't allocate memory")); break;
case E_VERSION: wxLogError(wxT("wxPCXHandler: version number too low")); break;
default: wxLogError(wxT("wxPCXHandler: unknown error !!!"));
case E_FORMATO: wxLogError(_("PCX: Image format unsupported.")); break;
case E_MEMORIA: wxLogError(_("PCX: Couldn't allocate memory.")); break;
case E_VERSION: wxLogError(_("PCX: Wrong version number.")); break;
default: wxLogError(_("PCX: Unknown error."));
}
}
image->Destroy();
@@ -257,8 +257,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose )
{
if (verbose)
wxLogError(wxT("wxPCXHandler::SaveFile still not implemented"));
wxFAIL_MSG(wxT("wxPCXHandler::SaveFile still not implemented"));
return FALSE;
}

View File

@@ -243,7 +243,8 @@ bool wxPNGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
error_nolines:
lines = NULL; // called from before it was set
error:
wxLogError(_("Couldn't load a PNG image - probably file is corrupted."));
if (verbose)
wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory."));
if ( image->Ok() )
{

View File

@@ -27,6 +27,7 @@
#include "wx/image.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/txtstrm.h"
//-----------------------------------------------------------------------------
@@ -50,7 +51,7 @@ void Skip_Comment(wxInputStream &stream)
}
}
bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSED(verbose), int WXUNUSED(index) )
bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) )
{
wxUint32 width, height;
wxUint16 maxval;
@@ -71,14 +72,15 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
switch (c)
{
case wxT('2'):
wxLogError(wxT("Loading Grey Ascii PNM image is not yet implemented."));
if (verbose) wxLogError(_("Loading Grey Ascii PNM image is not yet implemented."));
return FALSE;
case wxT('5'):
wxLogError(wxT("Loading Grey Raw PNM image is not yet implemented."));
if (verbose) wxLogError(_("Loading Grey Raw PNM image is not yet implemented."));
return FALSE;
case wxT('3'): case wxT('6'): break;
case wxT('3'):
case wxT('6'): break;
default:
wxLogError(wxT("Loading PNM image : file not recognized."));
if (verbose) wxLogError(_("PNM: File format is not recognized."));
return FALSE;
}
@@ -93,7 +95,8 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
unsigned char *ptr = image->GetData();
if (!ptr)
{
wxLogError( wxT("Cannot allocate RAM for RGB data in PNM file.") );
if (verbose)
wxLogError( _("PNM: Couldn't allocate memory.") );
return FALSE;
}
@@ -109,7 +112,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE
if (buf_stream.LastError()!=wxSTREAM_NOERROR)
{
wxLogError(wxT("Loading PNM image : file seems truncated."));
if (verbose) wxLogError(_("PNM: File seems truncated."));
return FALSE;
}
}

View File

@@ -128,7 +128,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
if (!tif)
{
if (verbose)
wxLogError( _("Error loading TIFF image.") );
wxLogError( _("TIFF: Error loading image.") );
return FALSE;
}
@@ -157,7 +157,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
if (!raster)
{
if (verbose)
wxLogError( _("Not enough memory for loading TIFF image.") );
wxLogError( _("TIFF: Couldn't allocate memory.") );
return FALSE;
}
@@ -166,7 +166,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
if (!image->Ok())
{
if (verbose)
wxLogError( _("Not enough memory for loading TIFF image.") );
wxLogError( _("TIFF: Couldn't allocate memory.") );
_TIFFfree( raster );
@@ -176,7 +176,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
if (!TIFFReadRGBAImage( tif, w, h, raster, 0 ))
{
if (verbose)
wxLogError( _("Error reading TIFF image.") );
wxLogError( _("TIFF: Error reading image.") );
_TIFFfree( raster );
image->Destroy();

View File

@@ -308,8 +308,8 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName0)
FIXME: UNICODE SUPPORT: must use CHARSET specifier!
*/
wxString szName = szName0;
if(szName.Find('.') != -1) // contains a dot
szName = szName.Left(szName.Find('.'));
if(szName.Find(wxT('.')) != -1) // contains a dot
szName = szName.Left(szName.Find(wxT('.')));
// FIXME VZ: I forgot the exact meaning of LC_PATH - anyone to remind me?
// KB: search path where to find the mo files, probably : delimited

View File

@@ -363,14 +363,14 @@ void wxPreviewControlBar::CreateButtons()
if (m_buttonFlags & wxPREVIEW_PREVIOUS)
{
m_previousPageButton = new wxButton(this, wxID_PREVIEW_PREVIOUS, "<<", wxPoint(x, y),
m_previousPageButton = new wxButton(this, wxID_PREVIEW_PREVIOUS, wxT("<<"), wxPoint(x, y),
wxSize(buttonWidth, buttonHeight));
x += gap + buttonWidth;
}
if (m_buttonFlags & wxPREVIEW_NEXT)
{
m_nextPageButton = new wxButton(this, wxID_PREVIEW_NEXT, ">>",
m_nextPageButton = new wxButton(this, wxID_PREVIEW_NEXT, wxT(">>"),
wxPoint(x, y), wxSize(buttonWidth, buttonHeight));
x += gap + buttonWidth;
}

View File

@@ -33,6 +33,7 @@
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/log.h"
#include "wx/intl.h"
#include "wx/gsocket.h"
#include "wx/sckaddr.h"
@@ -103,8 +104,9 @@ wxIPV4address::~wxIPV4address()
bool wxIPV4address::Hostname(const wxString& name)
{
// Some people are sometimes fool.
if (name == wxT("")) {
wxLogWarning( wxT("Trying to solve a NULL hostname: giving up") );
if (name == wxT(""))
{
wxLogWarning( _("Trying to solve a NULL hostname: giving up") );
return FALSE;
}

View File

@@ -33,6 +33,7 @@
#include "wx/utils.h"
#include "wx/module.h"
#include "wx/log.h"
#include "wx/intl.h"
#include <stdlib.h>
#include <string.h>
@@ -315,7 +316,7 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes)
if (sig != 0xfeeddead)
{
wxLogMessage(wxT("Warning: invalid signature returned to ReadMsg"));
wxLogWarning( _("TCP: invalid signature returned to ReadMsg."));
goto exit;
}
@@ -451,8 +452,8 @@ wxUint32 wxSocketBase::DeferWrite(const char *buffer, wxUint32 nbytes)
m_defer_timer = NULL;
m_defering = NO_DEFER;
wxString s;
s.Printf(wxT("Saliendo de DeferWrite: total %d bytes"), nbytes-m_defer_nbytes);
//wxString s;
//s.Printf(wxT("Saliendo de DeferWrite: total %d bytes"), nbytes-m_defer_nbytes);
//wxLogMessage(s);
return nbytes-m_defer_nbytes;

View File

@@ -162,7 +162,7 @@ bool wxURL::PrepHost(wxString& url)
wxString temp_url;
int pos, pos2;
if ((url.GetChar(0) != '/') || (url.GetChar(1) != '/'))
if ((url.GetChar(0) != wxT('/')) || (url.GetChar(1) != wxT('/')))
return FALSE;
url = url(2, url.Length());
@@ -240,7 +240,7 @@ bool wxURL::FetchProtocol()
// --------- wxURL get ------------------------------------------
// --------------------------------------------------------------
wxInputStream *wxURL::GetInputStream(void)
wxInputStream *wxURL::GetInputStream()
{
wxInputStream *the_i_stream = NULL;

View File

@@ -25,7 +25,7 @@
wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message)
: wxFrame(parent, -1, "", wxPoint(0, 0), wxSize(400, 80), wxTHICK_FRAME | wxSIMPLE_BORDER | wxFRAME_TOOL_WINDOW)
: wxFrame(parent, -1, wxT(""), wxPoint(0, 0), wxSize(400, 80), wxTHICK_FRAME | wxSIMPLE_BORDER | wxFRAME_TOOL_WINDOW)
{
wxPanel *p = new wxPanel( this );
wxStaticText *s = new wxStaticText( p, -1, message, wxPoint(20, 20), wxSize(360, 40), wxALIGN_CENTER );

View File

@@ -124,7 +124,7 @@ wxGenericColourDialog::wxGenericColourDialog()
}
wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent, wxColourData *data):
wxDialog(parent, -1, "Colour", wxPoint(0, 0), wxSize(900, 900), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
wxDialog(parent, -1, wxT("Colour"), wxPoint(0, 0), wxSize(900, 900), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
{
whichKind = 1;
colourSelection = 0;

View File

@@ -146,7 +146,7 @@ void wxDirItemData::SetNewDirName( wxString path )
bool wxDirItemData::HasSubDirs()
{
wxString search = m_path + "/*";
wxString search = m_path + wxT("/*");
wxLogNull log;
wxString path = wxFindFirstFile( search, wxDIR );
return (bool)(!path.IsNull());

View File

@@ -174,7 +174,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip"));
wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,25) );
wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) );
#if defined(__WXMSW__)
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
#else

View File

@@ -22,7 +22,6 @@
class wxBrushRefData: public wxObjectRefData
{
public:
wxBrushRefData();
wxBrushRefData( const wxBrushRefData& data );

View File

@@ -92,7 +92,6 @@ void wxColour::InitFromName( const wxString &colourName )
if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
wxFAIL_MSG( wxT("wxColour: couldn't find colour") );
wxPrintf( wxT("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;

View File

@@ -813,7 +813,7 @@ void wxWindowDC::DoGetTextExtent(const wxString &string,
wxCoord wxWindowDC::GetCharWidth() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, _T("invalid font") );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
@@ -821,7 +821,7 @@ wxCoord wxWindowDC::GetCharWidth() const
wxCoord wxWindowDC::GetCharHeight() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, _T("invalid font") );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord((font->ascent + font->descent) / m_scaleY);
}

View File

@@ -84,7 +84,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
}
else
{
wxFAIL_MSG(_T("no registry in X font spec?"));
wxFAIL_MSG( wxT("no registry in X font spec?") );
}
// restore the dash we changed to NUL above
@@ -92,7 +92,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
}
else
{
wxFAIL_MSG(_T("no encoding in X font spec?"));
wxFAIL_MSG( wxT("no encoding in X font spec?") );
}
// transfer the X registry/encoding to wxFontData - they are used by
@@ -150,9 +150,7 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *fontdata )
wxFAIL_MSG( wxT("wxXX creation failed") );
return;
}
#ifndef __WXGTK12__
wxFAIL_MSG( wxT("TODO") );
#else // GTK+ 1.2
wxString m_message( _("Choose font") );
m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() );
@@ -176,7 +174,6 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *fontdata )
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this );
#endif // GTK+ version
}
wxFontDialog::~wxFontDialog()

View File

@@ -201,7 +201,7 @@ int wxJoystick::GetProductId(void) const
wxString wxJoystick::GetProductName(void) const
{
return "";
return wxT("");
}
int wxJoystick::GetXMin(void) const

View File

@@ -17,7 +17,6 @@
#if wxUSE_SPINCTRL
#include "wx/utils.h"
#include "wx/spinbutt.h"
#include <math.h>
@@ -37,8 +36,6 @@ extern bool g_isIdle;
extern bool g_blockEventsOnDrag;
static const float sensitivity = 0.02;
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
@@ -50,34 +47,10 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
if (!win->m_hasVMT) return;
if (g_blockEventsOnDrag) return;
float diff = win->m_adjust->value - win->m_oldPos;
if (fabs(diff) < sensitivity) return;
win->m_oldPos = win->m_adjust->value;
wxEventType command = wxEVT_NULL;
float line_step = win->m_adjust->step_increment;
if (fabs(diff-line_step) < sensitivity) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < sensitivity) command = wxEVT_SCROLL_LINEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)ceil(win->m_adjust->value);
wxSpinEvent event( command, win->GetId());
event.SetPosition( value );
wxCommandEvent event( wxEVT_COMMAND_SPINCTRL_UPDATED, win->GetId());
event.SetEventObject( win );
event.SetInt( win->GetValue() );
win->GetEventHandler()->ProcessEvent( event );
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
command = wxEVT_SCROLL_THUMBTRACK;
wxSpinEvent event2( command, win->GetId());
event2.SetPosition( value );
event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 );
}
}
//-----------------------------------------------------------------------------

View File

@@ -22,7 +22,6 @@
class wxBrushRefData: public wxObjectRefData
{
public:
wxBrushRefData();
wxBrushRefData( const wxBrushRefData& data );

View File

@@ -92,7 +92,6 @@ void wxColour::InitFromName( const wxString &colourName )
if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
wxFAIL_MSG( wxT("wxColour: couldn't find colour") );
wxPrintf( wxT("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;

View File

@@ -813,7 +813,7 @@ void wxWindowDC::DoGetTextExtent(const wxString &string,
wxCoord wxWindowDC::GetCharWidth() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, _T("invalid font") );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
@@ -821,7 +821,7 @@ wxCoord wxWindowDC::GetCharWidth() const
wxCoord wxWindowDC::GetCharHeight() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, _T("invalid font") );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord((font->ascent + font->descent) / m_scaleY);
}

View File

@@ -84,7 +84,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
}
else
{
wxFAIL_MSG(_T("no registry in X font spec?"));
wxFAIL_MSG( wxT("no registry in X font spec?") );
}
// restore the dash we changed to NUL above
@@ -92,7 +92,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
}
else
{
wxFAIL_MSG(_T("no encoding in X font spec?"));
wxFAIL_MSG( wxT("no encoding in X font spec?") );
}
// transfer the X registry/encoding to wxFontData - they are used by
@@ -150,9 +150,7 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *fontdata )
wxFAIL_MSG( wxT("wxXX creation failed") );
return;
}
#ifndef __WXGTK12__
wxFAIL_MSG( wxT("TODO") );
#else // GTK+ 1.2
wxString m_message( _("Choose font") );
m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() );
@@ -176,7 +174,6 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *fontdata )
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this );
#endif // GTK+ version
}
wxFontDialog::~wxFontDialog()

View File

@@ -201,7 +201,7 @@ int wxJoystick::GetProductId(void) const
wxString wxJoystick::GetProductName(void) const
{
return "";
return wxT("");
}
int wxJoystick::GetXMin(void) const

View File

@@ -17,7 +17,6 @@
#if wxUSE_SPINCTRL
#include "wx/utils.h"
#include "wx/spinbutt.h"
#include <math.h>
@@ -37,8 +36,6 @@ extern bool g_isIdle;
extern bool g_blockEventsOnDrag;
static const float sensitivity = 0.02;
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
@@ -50,34 +47,10 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
if (!win->m_hasVMT) return;
if (g_blockEventsOnDrag) return;
float diff = win->m_adjust->value - win->m_oldPos;
if (fabs(diff) < sensitivity) return;
win->m_oldPos = win->m_adjust->value;
wxEventType command = wxEVT_NULL;
float line_step = win->m_adjust->step_increment;
if (fabs(diff-line_step) < sensitivity) command = wxEVT_SCROLL_LINEDOWN;
else if (fabs(diff+line_step) < sensitivity) command = wxEVT_SCROLL_LINEUP;
else command = wxEVT_SCROLL_THUMBTRACK;
int value = (int)ceil(win->m_adjust->value);
wxSpinEvent event( command, win->GetId());
event.SetPosition( value );
wxCommandEvent event( wxEVT_COMMAND_SPINCTRL_UPDATED, win->GetId());
event.SetEventObject( win );
event.SetInt( win->GetValue() );
win->GetEventHandler()->ProcessEvent( event );
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
command = wxEVT_SCROLL_THUMBTRACK;
wxSpinEvent event2( command, win->GetId());
event2.SetPosition( value );
event2.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event2 );
}
}
//-----------------------------------------------------------------------------