-------------------- 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 ---------------------
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;
#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 },
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
+#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
// wxBitmap
//-----------------------------------------------------------------------------
-class wxBitmap: public wxObject
+class wxBitmap: public wxGDIObject
{
public:
wxBitmap();
#include "wx/object.h"
#include "wx/string.h"
#include "wx/palette.h"
+#include "wx/gdiobj.h"
//-----------------------------------------------------------------------------
// classes
// wxBitmap
//-----------------------------------------------------------------------------
-class wxBitmap: public wxObject
+class wxBitmap: public wxGDIObject
{
public:
wxBitmap();
// SetDocument(doc);
m_viewDocument = (wxDocument*) NULL;
- m_viewTypeName = "";
+ m_viewTypeName = wxT("");
m_viewFrame = (wxFrame *) NULL;
}
m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
m_fileHistoryN ++;
buf.Printf(wxT("file%d"), m_fileHistoryN+1);
- historyFile = "";
+ historyFile = wxT("");
}
AddFilesToMenu();
}
// 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
}
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;
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;
}
wxASSERT_MSG( !pathNew || (pathNew[0] != wxCONFIG_PATH_SEPARATOR),
- _T("should be a relative path") );
+ wxT("should be a relative path") );
path += pathNew;
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++ )
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++ )
}
else
{
- wxLogDebug(_T("corrupted config data - invalid encoding %ld "
+ wxLogDebug(wxT("corrupted config data - invalid encoding %ld "
"for charset '%s'"), value, charset.c_str());
}
}
{
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 )
}
}
}
- 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 )
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];
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 )
{
}
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());
}
}
bool wxZipFSHandler::CanOpen(const wxString& location)
{
wxString p = GetProtocol(location);
- return (p == "zip");
+ return (p == wxT("zip") );
}
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));
}
m_Archive = NULL;
}
- if (GetProtocol(left) != "file") {
+ if (GetProtocol(left) != wxT("file")) {
return wxEmptyString;
}
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();
m_user = wxT("anonymous");
m_passwd = wxGetUserId();
- m_passwd += '@';
+ m_passwd += wxT('@');
m_passwd += wxGetHostName();
SetNotify(0);
wxBitmapList::~wxBitmapList ()
{
-#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
delete bitmap;
node = next;
}
-#endif
}
// Pen and Brush lists
wxPenList::~wxPenList ()
{
-#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
delete pen;
node = next;
}
-#endif
}
void wxPenList::AddPen (wxPen * pen)
wxBrushList::~wxBrushList ()
{
-#if defined(__WXMSW__) || defined(__WXMOTIF__)
wxNode *node = First ();
while (node)
{
delete brush;
node = next;
}
-#endif
}
void wxBrushList::AddBrush (wxBrush * brush)
#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;
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;
}
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;
}
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;
}
((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)
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;
}
}
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;
{
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;
class wxImageRefData: public wxObjectRefData
{
-
public:
wxImageRefData();
~wxImageRefData();
wxImageRefData::~wxImageRefData()
{
- if (m_data) free( m_data );
+ if (m_data)
+ free( m_data );
}
wxList wxImage::sm_handlers;
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();
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;
}
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;
}
}
- wxLogWarning( wxT("No handler found for this image.") );
+ wxLogWarning( _("No handler found for image type.") );
return FALSE;
}
if (handler == NULL)
{
- wxLogWarning( wxT("No image handler for type %d defined."), type );
+ wxLogWarning( _("No image handler for type %d defined."), type );
return FALSE;
}
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;
}
if (handler == NULL)
{
- wxLogWarning( wxT("No image handler for type %d defined."), type );
+ wxLogWarning( _("No image handler for type %d defined."), type );
return FALSE;
}
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;
}
}
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;
}
{
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;
/* 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;
if (!verbose) cinfo.err->output_message=NULL;
/* Establish the setjmp return context for my_error_exit to use. */
- 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."));
- jpeg_destroy_compress(&cinfo);
- return FALSE;
+ 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(_("JPEG: Couldn't save image."));
+ jpeg_destroy_compress(&cinfo);
+ return FALSE;
}
jpeg_create_compress(&cinfo);
if (!CanRead(stream))
{
if (verbose)
- wxLogError(wxT("wxPCXHandler: this is not a PCX file"));
+ wxLogError(_("PCX: this is not a PCX file."));
return FALSE;
}
{
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();
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;
}
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() )
{
#include "wx/image.h"
#include "wx/log.h"
+#include "wx/intl.h"
#include "wx/txtstrm.h"
//-----------------------------------------------------------------------------
}
}
-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;
if (buf_stream.GetC()==wxT('P')) c=buf_stream.GetC();
switch (c)
- {
- case wxT('2'):
- wxLogError(wxT("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."));
- return FALSE;
- case wxT('3'): case wxT('6'): break;
- default :
- wxLogError(wxT("Loading PNM image : file not recognized."));
- return FALSE;
- }
+ {
+ case wxT('2'):
+ if (verbose) wxLogError(_("Loading Grey Ascii PNM image is not yet implemented."));
+ return FALSE;
+ case wxT('5'):
+ if (verbose) wxLogError(_("Loading Grey Raw PNM image is not yet implemented."));
+ return FALSE;
+ case wxT('3'):
+ case wxT('6'): break;
+ default:
+ if (verbose) wxLogError(_("PNM: File format is not recognized."));
+ return FALSE;
+ }
text_stream.ReadLine(); // for the \n
Skip_Comment(buf_stream);
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;
}
if (buf_stream.LastError()!=wxSTREAM_NOERROR)
{
- wxLogError(wxT("Loading PNM image : file seems truncated."));
+ if (verbose) wxLogError(_("PNM: File seems truncated."));
return FALSE;
}
}
if (!tif)
{
if (verbose)
- wxLogError( _("Error loading TIFF image.") );
+ wxLogError( _("TIFF: Error loading image.") );
return FALSE;
}
if (!raster)
{
if (verbose)
- wxLogError( _("Not enough memory for loading TIFF image.") );
+ wxLogError( _("TIFF: Couldn't allocate memory.") );
return FALSE;
}
if (!image->Ok())
{
if (verbose)
- wxLogError( _("Not enough memory for loading TIFF image.") );
+ wxLogError( _("TIFF: Couldn't allocate memory.") );
_TIFFfree( raster );
if (!TIFFReadRGBAImage( tif, w, h, raster, 0 ))
{
if (verbose)
- wxLogError( _("Error reading TIFF image.") );
+ wxLogError( _("TIFF: Error reading image.") );
_TIFFfree( raster );
image->Destroy();
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
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;
}
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/log.h"
+#include "wx/intl.h"
#include "wx/gsocket.h"
#include "wx/sckaddr.h"
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;
}
#include "wx/utils.h"
#include "wx/module.h"
#include "wx/log.h"
+#include "wx/intl.h"
#include <stdlib.h>
#include <string.h>
if (sig != 0xfeeddead)
{
- wxLogMessage(wxT("Warning: invalid signature returned to ReadMsg"));
+ wxLogWarning( _("TCP: invalid signature returned to ReadMsg."));
goto exit;
}
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;
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());
// --------- wxURL get ------------------------------------------
// --------------------------------------------------------------
-wxInputStream *wxURL::GetInputStream(void)
+wxInputStream *wxURL::GetInputStream()
{
wxInputStream *the_i_stream = NULL;
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 );
}
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;
bool wxDirItemData::HasSubDirs()
{
- wxString search = m_path + "/*";
+ wxString search = m_path + wxT("/*");
wxLogNull log;
wxString path = wxFindFirstFile( search, wxDIR );
return (bool)(!path.IsNull());
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
class wxBrushRefData: public wxObjectRefData
{
- public:
-
+public:
wxBrushRefData();
wxBrushRefData( const wxBrushRefData& data );
wxBrushRefData::wxBrushRefData()
{
- m_style = 0;
+ m_style = 0;
}
wxBrushRefData::wxBrushRefData( const wxBrushRefData& data )
{
- m_style = data.m_style;
- m_stipple = data.m_stipple;
- m_colour = data.m_colour;
+ m_style = data.m_style;
+ m_stipple = data.m_stipple;
+ m_colour = data.m_colour;
}
//-----------------------------------------------------------------------------
wxBrush::wxBrush()
{
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxColour &colour, int style )
{
- m_refData = new wxBrushRefData();
- M_BRUSHDATA->m_style = style;
- M_BRUSHDATA->m_colour = colour;
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_style = style;
+ M_BRUSHDATA->m_colour = colour;
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{
- m_refData = new wxBrushRefData();
- M_BRUSHDATA->m_style = wxSTIPPLE;
- M_BRUSHDATA->m_colour = *wxBLACK;
- M_BRUSHDATA->m_stipple = stippleBitmap;
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_style = wxSTIPPLE;
+ M_BRUSHDATA->m_colour = *wxBLACK;
+ M_BRUSHDATA->m_stipple = stippleBitmap;
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxBrush &brush )
{
- Ref( brush );
+ Ref( brush );
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::~wxBrush()
{
- if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
+ if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
}
wxBrush& wxBrush::operator = ( const wxBrush& brush )
{
- if (*this == brush) return (*this);
- Ref( brush );
- return *this;
+ if (*this == brush) return (*this);
+ Ref( brush );
+ return *this;
}
bool wxBrush::operator == ( const wxBrush& brush )
{
- return m_refData == brush.m_refData;
+ return m_refData == brush.m_refData;
}
bool wxBrush::operator != ( const wxBrush& brush )
{
- return m_refData != brush.m_refData;
+ return m_refData != brush.m_refData;
}
bool wxBrush::Ok() const
{
- return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
+ return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
}
int wxBrush::GetStyle() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return 0;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return 0;
+ }
- return M_BRUSHDATA->m_style;
+ return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return wxNullColour;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return wxNullColour;
+ }
- return M_BRUSHDATA->m_colour;
+ return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return &wxNullBitmap;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return &wxNullBitmap;
+ }
- return &M_BRUSHDATA->m_stipple;
+ return &M_BRUSHDATA->m_stipple;
}
void wxBrush::SetColour( const wxColour& col )
{
- Unshare();
- M_BRUSHDATA->m_colour = col;
+ Unshare();
+ M_BRUSHDATA->m_colour = col;
}
void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
{
- Unshare();
- M_BRUSHDATA->m_colour.Set( r, g, b );
+ Unshare();
+ M_BRUSHDATA->m_colour.Set( r, g, b );
}
void wxBrush::SetStyle( int style )
{
- Unshare();
- M_BRUSHDATA->m_style = style;
+ Unshare();
+ M_BRUSHDATA->m_style = style;
}
void wxBrush::SetStipple( const wxBitmap& stipple )
{
- Unshare();
- M_BRUSHDATA->m_stipple = stipple;
+ Unshare();
+ M_BRUSHDATA->m_stipple = stipple;
}
void wxBrush::Unshare()
{
- if (!m_refData)
- {
- m_refData = new wxBrushRefData();
- }
- else
- {
- wxBrushRefData* ref = new wxBrushRefData( *(wxBrushRefData*)m_refData );
- UnRef();
- m_refData = ref;
- }
+ if (!m_refData)
+ {
+ m_refData = new wxBrushRefData();
+ }
+ else
+ {
+ wxBrushRefData* ref = new wxBrushRefData( *(wxBrushRefData*)m_refData );
+ UnRef();
+ m_refData = ref;
+ }
}
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;
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);
}
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);
}
}
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
}
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
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() );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this );
-#endif // GTK+ version
}
wxFontDialog::~wxFontDialog()
wxString wxJoystick::GetProductName(void) const
{
- return "";
+ return wxT("");
}
int wxJoystick::GetXMin(void) const
#if wxUSE_SPINCTRL
#include "wx/utils.h"
-#include "wx/spinbutt.h"
#include <math.h>
extern bool g_blockEventsOnDrag;
-static const float sensitivity = 0.02;
-
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
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 );
- }
}
//-----------------------------------------------------------------------------
class wxBrushRefData: public wxObjectRefData
{
- public:
-
+public:
wxBrushRefData();
wxBrushRefData( const wxBrushRefData& data );
wxBrushRefData::wxBrushRefData()
{
- m_style = 0;
+ m_style = 0;
}
wxBrushRefData::wxBrushRefData( const wxBrushRefData& data )
{
- m_style = data.m_style;
- m_stipple = data.m_stipple;
- m_colour = data.m_colour;
+ m_style = data.m_style;
+ m_stipple = data.m_stipple;
+ m_colour = data.m_colour;
}
//-----------------------------------------------------------------------------
wxBrush::wxBrush()
{
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxColour &colour, int style )
{
- m_refData = new wxBrushRefData();
- M_BRUSHDATA->m_style = style;
- M_BRUSHDATA->m_colour = colour;
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_style = style;
+ M_BRUSHDATA->m_colour = colour;
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{
- m_refData = new wxBrushRefData();
- M_BRUSHDATA->m_style = wxSTIPPLE;
- M_BRUSHDATA->m_colour = *wxBLACK;
- M_BRUSHDATA->m_stipple = stippleBitmap;
+ m_refData = new wxBrushRefData();
+ M_BRUSHDATA->m_style = wxSTIPPLE;
+ M_BRUSHDATA->m_colour = *wxBLACK;
+ M_BRUSHDATA->m_stipple = stippleBitmap;
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::wxBrush( const wxBrush &brush )
{
- Ref( brush );
+ Ref( brush );
- if (wxTheBrushList) wxTheBrushList->AddBrush( this );
+ if (wxTheBrushList) wxTheBrushList->AddBrush( this );
}
wxBrush::~wxBrush()
{
- if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
+ if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
}
wxBrush& wxBrush::operator = ( const wxBrush& brush )
{
- if (*this == brush) return (*this);
- Ref( brush );
- return *this;
+ if (*this == brush) return (*this);
+ Ref( brush );
+ return *this;
}
bool wxBrush::operator == ( const wxBrush& brush )
{
- return m_refData == brush.m_refData;
+ return m_refData == brush.m_refData;
}
bool wxBrush::operator != ( const wxBrush& brush )
{
- return m_refData != brush.m_refData;
+ return m_refData != brush.m_refData;
}
bool wxBrush::Ok() const
{
- return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
+ return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
}
int wxBrush::GetStyle() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return 0;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return 0;
+ }
- return M_BRUSHDATA->m_style;
+ return M_BRUSHDATA->m_style;
}
wxColour &wxBrush::GetColour() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return wxNullColour;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return wxNullColour;
+ }
- return M_BRUSHDATA->m_colour;
+ return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- if (m_refData == NULL)
- {
- wxFAIL_MSG( wxT("invalid brush") );
- return &wxNullBitmap;
- }
+ if (m_refData == NULL)
+ {
+ wxFAIL_MSG( wxT("invalid brush") );
+ return &wxNullBitmap;
+ }
- return &M_BRUSHDATA->m_stipple;
+ return &M_BRUSHDATA->m_stipple;
}
void wxBrush::SetColour( const wxColour& col )
{
- Unshare();
- M_BRUSHDATA->m_colour = col;
+ Unshare();
+ M_BRUSHDATA->m_colour = col;
}
void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
{
- Unshare();
- M_BRUSHDATA->m_colour.Set( r, g, b );
+ Unshare();
+ M_BRUSHDATA->m_colour.Set( r, g, b );
}
void wxBrush::SetStyle( int style )
{
- Unshare();
- M_BRUSHDATA->m_style = style;
+ Unshare();
+ M_BRUSHDATA->m_style = style;
}
void wxBrush::SetStipple( const wxBitmap& stipple )
{
- Unshare();
- M_BRUSHDATA->m_stipple = stipple;
+ Unshare();
+ M_BRUSHDATA->m_stipple = stipple;
}
void wxBrush::Unshare()
{
- if (!m_refData)
- {
- m_refData = new wxBrushRefData();
- }
- else
- {
- wxBrushRefData* ref = new wxBrushRefData( *(wxBrushRefData*)m_refData );
- UnRef();
- m_refData = ref;
- }
+ if (!m_refData)
+ {
+ m_refData = new wxBrushRefData();
+ }
+ else
+ {
+ wxBrushRefData* ref = new wxBrushRefData( *(wxBrushRefData*)m_refData );
+ UnRef();
+ m_refData = ref;
+ }
}
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;
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);
}
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);
}
}
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
}
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
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() );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this );
-#endif // GTK+ version
}
wxFontDialog::~wxFontDialog()
wxString wxJoystick::GetProductName(void) const
{
- return "";
+ return wxT("");
}
int wxJoystick::GetXMin(void) const
#if wxUSE_SPINCTRL
#include "wx/utils.h"
-#include "wx/spinbutt.h"
#include <math.h>
extern bool g_blockEventsOnDrag;
-static const float sensitivity = 0.02;
-
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
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 );
- }
}
//-----------------------------------------------------------------------------