Lots of Unix/Unicode compile fixes, some of which
are just #ifdef 0 such as the wxExecute calls in gdcps.cpp. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -48,6 +48,10 @@ public:
|
|||||||
// Implicit conversion from the colour name
|
// Implicit conversion from the colour name
|
||||||
wxColour( const wxString &colourName ) { InitFromName(colourName); }
|
wxColour( const wxString &colourName ) { InitFromName(colourName); }
|
||||||
wxColour( const char *colourName ) { InitFromName(colourName); }
|
wxColour( const char *colourName ) { InitFromName(colourName); }
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxColour( const wxColour& col )
|
wxColour( const wxColour& col )
|
||||||
: wxGDIObject()
|
: wxGDIObject()
|
||||||
|
@@ -33,7 +33,7 @@ class wxComboBox;
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern const char* wxComboBoxNameStr;
|
extern const wxChar* wxComboBoxNameStr;
|
||||||
extern const wxChar* wxEmptyString;
|
extern const wxChar* wxEmptyString;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@@ -33,7 +33,7 @@ class wxGauge;
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern const char* wxGaugeNameStr;
|
extern const wxChar* wxGaugeNameStr;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxGaugeBox
|
// wxGaugeBox
|
||||||
|
@@ -39,14 +39,14 @@ public:
|
|||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = "notebook");
|
const wxString& name = wxT("notebook"));
|
||||||
// Create() function
|
// Create() function
|
||||||
bool Create(wxWindow *parent,
|
bool Create(wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = "notebook");
|
const wxString& name = wxT("notebook"));
|
||||||
// dtor
|
// dtor
|
||||||
virtual ~wxNotebook();
|
virtual ~wxNotebook();
|
||||||
|
|
||||||
|
@@ -59,8 +59,6 @@ public:
|
|||||||
virtual int GetMax() const;
|
virtual int GetMax() const;
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// --------------
|
|
||||||
|
|
||||||
void OnChar( wxKeyEvent &event );
|
void OnChar( wxKeyEvent &event );
|
||||||
|
|
||||||
bool IsOwnGtkWindow( GdkWindow *window );
|
bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
|
@@ -48,6 +48,10 @@ public:
|
|||||||
// Implicit conversion from the colour name
|
// Implicit conversion from the colour name
|
||||||
wxColour( const wxString &colourName ) { InitFromName(colourName); }
|
wxColour( const wxString &colourName ) { InitFromName(colourName); }
|
||||||
wxColour( const char *colourName ) { InitFromName(colourName); }
|
wxColour( const char *colourName ) { InitFromName(colourName); }
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxColour( const wxColour& col )
|
wxColour( const wxColour& col )
|
||||||
: wxGDIObject()
|
: wxGDIObject()
|
||||||
|
@@ -33,7 +33,7 @@ class wxComboBox;
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern const char* wxComboBoxNameStr;
|
extern const wxChar* wxComboBoxNameStr;
|
||||||
extern const wxChar* wxEmptyString;
|
extern const wxChar* wxEmptyString;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@@ -33,7 +33,7 @@ class wxGauge;
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern const char* wxGaugeNameStr;
|
extern const wxChar* wxGaugeNameStr;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxGaugeBox
|
// wxGaugeBox
|
||||||
|
@@ -39,14 +39,14 @@ public:
|
|||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = "notebook");
|
const wxString& name = wxT("notebook"));
|
||||||
// Create() function
|
// Create() function
|
||||||
bool Create(wxWindow *parent,
|
bool Create(wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = "notebook");
|
const wxString& name = wxT("notebook"));
|
||||||
// dtor
|
// dtor
|
||||||
virtual ~wxNotebook();
|
virtual ~wxNotebook();
|
||||||
|
|
||||||
|
@@ -59,8 +59,6 @@ public:
|
|||||||
virtual int GetMax() const;
|
virtual int GetMax() const;
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// --------------
|
|
||||||
|
|
||||||
void OnChar( wxKeyEvent &event );
|
void OnChar( wxKeyEvent &event );
|
||||||
|
|
||||||
bool IsOwnGtkWindow( GdkWindow *window );
|
bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
|
@@ -70,6 +70,7 @@ public:
|
|||||||
// Implementation
|
// Implementation
|
||||||
void DoSetBitmap();
|
void DoSetBitmap();
|
||||||
virtual void ChangeBackgroundColour();
|
virtual void ChangeBackgroundColour();
|
||||||
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxBitmap m_buttonBitmapFocus;
|
wxBitmap m_buttonBitmapFocus;
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/filename.h" // for SplitPath()
|
#include "wx/filename.h" // for SplitPath()
|
||||||
|
#include "wx/strconv.h"
|
||||||
|
|
||||||
#include "wx/dynload.h"
|
#include "wx/dynload.h"
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
@@ -167,7 +168,7 @@ bool wxDynamicLibrary::Load(wxString libname, int flags)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_handle = dlopen(libname.c_str(), rtldFlags);
|
m_handle = dlopen(libname.fn_str(), rtldFlags);
|
||||||
#endif // __VMS || __DARWIN__ ?
|
#endif // __VMS || __DARWIN__ ?
|
||||||
|
|
||||||
#elif defined(HAVE_SHL_LOAD)
|
#elif defined(HAVE_SHL_LOAD)
|
||||||
@@ -183,7 +184,7 @@ bool wxDynamicLibrary::Load(wxString libname, int flags)
|
|||||||
{
|
{
|
||||||
shlFlags |= BIND_IMMEDIATE;
|
shlFlags |= BIND_IMMEDIATE;
|
||||||
}
|
}
|
||||||
m_handle = shl_load(libname.c_str(), BIND_DEFERRED, 0);
|
m_handle = shl_load(libname.fn_str(), BIND_DEFERRED, 0);
|
||||||
|
|
||||||
#elif defined(__WINDOWS__)
|
#elif defined(__WINDOWS__)
|
||||||
m_handle = ::LoadLibrary(libname.c_str());
|
m_handle = ::LoadLibrary(libname.c_str());
|
||||||
@@ -195,7 +196,14 @@ bool wxDynamicLibrary::Load(wxString libname, int flags)
|
|||||||
{
|
{
|
||||||
wxString msg(_("Failed to load shared library '%s'"));
|
wxString msg(_("Failed to load shared library '%s'"));
|
||||||
#if defined(HAVE_DLERROR) && !defined(__EMX__)
|
#if defined(HAVE_DLERROR) && !defined(__EMX__)
|
||||||
const wxChar *err = dlerror();
|
|
||||||
|
#if defined(__WXGTK__) && wxUSE_UNICODE
|
||||||
|
wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() );
|
||||||
|
const wxChar *err = buffer;
|
||||||
|
#else
|
||||||
|
const wxChar *err = dlerror();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( err )
|
if( err )
|
||||||
wxLogError( msg, err );
|
wxLogError( msg, err );
|
||||||
#else
|
#else
|
||||||
@@ -252,10 +260,10 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
|||||||
DosQueryProcAddr( m_handle, 1L, name.c_str(), (PFN*)symbol );
|
DosQueryProcAddr( m_handle, 1L, name.c_str(), (PFN*)symbol );
|
||||||
|
|
||||||
#elif defined(HAVE_DLOPEN) || defined(__DARWIN__)
|
#elif defined(HAVE_DLOPEN) || defined(__DARWIN__)
|
||||||
symbol = dlsym( m_handle, name.c_str() );
|
symbol = dlsym( m_handle, name.fn_str() );
|
||||||
|
|
||||||
#elif defined(HAVE_SHL_LOAD)
|
#elif defined(HAVE_SHL_LOAD)
|
||||||
if( shl_findsym( &m_handle, name.c_str(), TYPE_UNDEFINED, &symbol ) != 0 )
|
if( shl_findsym( &m_handle, name.fn_str(), TYPE_UNDEFINED, &symbol ) != 0 )
|
||||||
symbol = 0;
|
symbol = 0;
|
||||||
|
|
||||||
#elif defined(__WINDOWS__)
|
#elif defined(__WINDOWS__)
|
||||||
@@ -269,7 +277,14 @@ void *wxDynamicLibrary::GetSymbol(const wxString &name, bool *success) const
|
|||||||
{
|
{
|
||||||
wxString msg(_("wxDynamicLibrary failed to GetSymbol '%s'"));
|
wxString msg(_("wxDynamicLibrary failed to GetSymbol '%s'"));
|
||||||
#if defined(HAVE_DLERROR) && !defined(__EMX__)
|
#if defined(HAVE_DLERROR) && !defined(__EMX__)
|
||||||
|
|
||||||
|
#if defined(__WXGTK__) && wxUSE_UNICODE
|
||||||
|
wxWCharBuffer buffer = wxConvLocal.cMB2WC( dlerror() );
|
||||||
|
const wxChar *err = buffer;
|
||||||
|
#else
|
||||||
const wxChar *err = dlerror();
|
const wxChar *err = dlerror();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( err )
|
if( err )
|
||||||
{
|
{
|
||||||
failed = TRUE;
|
failed = TRUE;
|
||||||
|
@@ -1040,9 +1040,9 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
|
|||||||
FILE *fp2 = (FILE *) NULL;
|
FILE *fp2 = (FILE *) NULL;
|
||||||
FILE *fp3 = (FILE *) NULL;
|
FILE *fp3 = (FILE *) NULL;
|
||||||
// Open the inputs and outputs
|
// Open the inputs and outputs
|
||||||
if ((fp1 = wxFopen (OS_FILENAME( file1 ), wxT("rb"))) == NULL ||
|
if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL ||
|
||||||
(fp2 = wxFopen (OS_FILENAME( file2 ), wxT("rb"))) == NULL ||
|
(fp2 = wxFopen ( file2, wxT("rb"))) == NULL ||
|
||||||
(fp3 = wxFopen (OS_FILENAME( outfile ), wxT("wb"))) == NULL)
|
(fp3 = wxFopen ( outfile, wxT("wb"))) == NULL)
|
||||||
{
|
{
|
||||||
if (fp1)
|
if (fp1)
|
||||||
fclose (fp1);
|
fclose (fp1);
|
||||||
|
@@ -640,7 +640,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
|||||||
|
|
||||||
// can use the cast here because the length doesn't change and the string
|
// can use the cast here because the length doesn't change and the string
|
||||||
// is not shared
|
// is not shared
|
||||||
int fdTemp = mkstemp((char *)path.mb_str());
|
int fdTemp = mkstemp((char*)(const char *)path.mb_str());
|
||||||
if ( fdTemp == -1 )
|
if ( fdTemp == -1 )
|
||||||
{
|
{
|
||||||
// this might be not necessary as mkstemp() on most systems should have
|
// this might be not necessary as mkstemp() on most systems should have
|
||||||
@@ -1601,7 +1601,7 @@ bool wxFileName::SetTimes(const wxDateTime *dtAccess,
|
|||||||
utimbuf utm;
|
utimbuf utm;
|
||||||
utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks();
|
utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks();
|
||||||
utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks();
|
utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks();
|
||||||
if ( utime(GetFullPath(), &utm) == 0 )
|
if ( utime(GetFullPath().fn_str(), &utm) == 0 )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1639,7 +1639,7 @@ bool wxFileName::Touch()
|
|||||||
{
|
{
|
||||||
#if defined(__UNIX_LIKE__)
|
#if defined(__UNIX_LIKE__)
|
||||||
// under Unix touching file is simple: just pass NULL to utime()
|
// under Unix touching file is simple: just pass NULL to utime()
|
||||||
if ( utime(GetFullPath(), NULL) == 0 )
|
if ( utime(GetFullPath().fn_str(), NULL) == 0 )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1660,7 +1660,7 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess,
|
|||||||
{
|
{
|
||||||
#if defined(__UNIX_LIKE__) || defined(__WXMAC__) || (defined(__DOS__) && defined(__WATCOMC__))
|
#if defined(__UNIX_LIKE__) || defined(__WXMAC__) || (defined(__DOS__) && defined(__WATCOMC__))
|
||||||
wxStructStat stBuf;
|
wxStructStat stBuf;
|
||||||
if ( wxStat(GetFullPath(), &stBuf) == 0 )
|
if ( wxStat(GetFullPath().fn_str(), &stBuf) == 0 )
|
||||||
{
|
{
|
||||||
if ( dtAccess )
|
if ( dtAccess )
|
||||||
dtAccess->Set(stBuf.st_atime);
|
dtAccess->Set(stBuf.st_atime);
|
||||||
|
@@ -83,7 +83,7 @@ void wxMessageOutputStderr::Printf(const wxChar* format, ...)
|
|||||||
out.PrintfV(format, args);
|
out.PrintfV(format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
fprintf(stderr, "%s", out.mb_str());
|
fprintf(stderr, "%s", (const char*) out.mb_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -102,7 +102,7 @@ void wxMessageOutputMessageBox::Printf(const wxChar* format, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
#ifndef __WXMSW__
|
#ifndef __WXMSW__
|
||||||
out.Replace("\t"," ");
|
out.Replace(wxT("\t"),wxT(" "));
|
||||||
#endif
|
#endif
|
||||||
::wxMessageBox(out);
|
::wxMessageBox(out);
|
||||||
}
|
}
|
||||||
|
@@ -260,7 +260,7 @@ bool wxTCPServer::Create(const wxString& serverName)
|
|||||||
{
|
{
|
||||||
// ensure that the file doesn't exist as otherwise calling socket() would
|
// ensure that the file doesn't exist as otherwise calling socket() would
|
||||||
// fail
|
// fail
|
||||||
int rc = remove(serverName);
|
int rc = remove(serverName.fn_str());
|
||||||
if ( rc < 0 && errno != ENOENT )
|
if ( rc < 0 && errno != ENOENT )
|
||||||
{
|
{
|
||||||
delete addr;
|
delete addr;
|
||||||
@@ -321,7 +321,7 @@ wxTCPServer::~wxTCPServer()
|
|||||||
#ifdef __UNIX_LIKE__
|
#ifdef __UNIX_LIKE__
|
||||||
if ( !m_filename.empty() )
|
if ( !m_filename.empty() )
|
||||||
{
|
{
|
||||||
if ( remove(m_filename) != 0 )
|
if ( remove(m_filename.fn_str()) != 0 )
|
||||||
{
|
{
|
||||||
wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str());
|
wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str());
|
||||||
}
|
}
|
||||||
|
@@ -328,12 +328,12 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ( keycode < 256 && keycode >= 0 && isprint(keycode) )
|
if ( keycode < 256 && keycode >= 0 && wxIsprint(keycode) )
|
||||||
{
|
{
|
||||||
// FIXME this is not going to work for non letters...
|
// FIXME this is not going to work for non letters...
|
||||||
if ( !event.ShiftDown() )
|
if ( !event.ShiftDown() )
|
||||||
{
|
{
|
||||||
keycode = tolower(keycode);
|
keycode = wxTolower(keycode);
|
||||||
}
|
}
|
||||||
|
|
||||||
ch = (wxChar)keycode;
|
ch = (wxChar)keycode;
|
||||||
|
@@ -115,9 +115,7 @@ license is as follows:
|
|||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef __VISUALC__
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/xpmdecod.h"
|
#include "wx/xpmdecod.h"
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#if wxUSE_POSTSCRIPT
|
#if wxUSE_POSTSCRIPT
|
||||||
|
|
||||||
|
#include "wx/setup.h"
|
||||||
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/dcmemory.h"
|
#include "wx/dcmemory.h"
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
@@ -1577,7 +1579,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message )
|
|||||||
m_printData.SetFilename(filename);
|
m_printData.SetFilename(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pstream = wxFopen( m_printData.GetFilename().fn_str(), wxT("w+") );
|
m_pstream = wxFopen( m_printData.GetFilename().c_str(), wxT("w+") ); // FIXME: use fn_str() here under Unicode?
|
||||||
|
|
||||||
if (!m_pstream)
|
if (!m_pstream)
|
||||||
{
|
{
|
||||||
@@ -1748,7 +1750,10 @@ void wxPostScriptDC::EndDoc ()
|
|||||||
argv[0] = WXSTRINGCAST previewCommand;
|
argv[0] = WXSTRINGCAST previewCommand;
|
||||||
argv[1] = WXSTRINGCAST filename;
|
argv[1] = WXSTRINGCAST filename;
|
||||||
argv[2] = (wxChar*) NULL;
|
argv[2] = (wxChar*) NULL;
|
||||||
|
#if defined(__WXGTK20__) && wxUSE_UNICODE
|
||||||
|
#else
|
||||||
wxExecute( argv, TRUE );
|
wxExecute( argv, TRUE );
|
||||||
|
#endif
|
||||||
wxRemoveFile( m_printData.GetFilename() );
|
wxRemoveFile( m_printData.GetFilename() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1766,7 +1771,10 @@ void wxPostScriptDC::EndDoc ()
|
|||||||
|
|
||||||
argv[argc++] = WXSTRINGCAST filename;
|
argv[argc++] = WXSTRINGCAST filename;
|
||||||
argv[argc++] = (wxChar *) NULL;
|
argv[argc++] = (wxChar *) NULL;
|
||||||
|
#if defined(__WXGTK20__) && wxUSE_UNICODE
|
||||||
|
#else
|
||||||
wxExecute( argv, TRUE );
|
wxExecute( argv, TRUE );
|
||||||
|
#endif
|
||||||
wxRemoveFile( filename );
|
wxRemoveFile( filename );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "wx/html/helpdata.h"
|
#include "wx/html/helpdata.h"
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
#include "wx/wfstream.h"
|
#include "wx/wfstream.h"
|
||||||
|
@@ -113,7 +113,19 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
(XtPointer) this);
|
(XtPointer) this);
|
||||||
|
|
||||||
SetCanAddEventHandler(TRUE);
|
SetCanAddEventHandler(TRUE);
|
||||||
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
|
|
||||||
|
wxSize newSize = size;
|
||||||
|
|
||||||
|
if (m_buttonBitmap.Ok())
|
||||||
|
{
|
||||||
|
int border = (style & wxNO_BORDER) ? 4 : 10;
|
||||||
|
if (newSize.x == -1)
|
||||||
|
newSize.x = m_buttonBitmap.GetWidth()+border;
|
||||||
|
if (newSize.y == -1)
|
||||||
|
newSize.y = m_buttonBitmap.GetHeight()+border;
|
||||||
|
}
|
||||||
|
|
||||||
|
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, newSize.x, newSize.y);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -262,3 +274,23 @@ void wxBitmapButton::ChangeBackgroundColour()
|
|||||||
// Must reset the bitmaps since the colours have changed.
|
// Must reset the bitmaps since the colours have changed.
|
||||||
DoSetBitmap();
|
DoSetBitmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize wxBitmapButton::DoGetBestSize() const
|
||||||
|
{
|
||||||
|
wxSize ret( 30,30 );
|
||||||
|
|
||||||
|
if (m_buttonBitmap.Ok())
|
||||||
|
{
|
||||||
|
int border = (GetWindowStyle() & wxNO_BORDER) ? 4 : 10;
|
||||||
|
ret.x = m_buttonBitmap.GetWidth()+border;
|
||||||
|
ret.y = m_buttonBitmap.GetHeight()+border;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HasFlag(wxBU_EXACTFIT))
|
||||||
|
{
|
||||||
|
if (ret.x < 80) ret.x = 80;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -719,10 +719,10 @@ wxDialUpManagerImpl::CheckIfconfig()
|
|||||||
hasModem = strstr(output,"ipdptp") != (char *)NULL;
|
hasModem = strstr(output,"ipdptp") != (char *)NULL;
|
||||||
hasLAN = strstr(output, "hme") != (char *)NULL;
|
hasLAN = strstr(output, "hme") != (char *)NULL;
|
||||||
#elif defined(__LINUX__) || defined (__FREEBSD__)
|
#elif defined(__LINUX__) || defined (__FREEBSD__)
|
||||||
hasModem = strstr(output,"ppp") // ppp
|
hasModem = strstr(output.fn_str(),"ppp") // ppp
|
||||||
|| strstr(output,"sl") // slip
|
|| strstr(output.fn_str(),"sl") // slip
|
||||||
|| strstr(output,"pl"); // plip
|
|| strstr(output.fn_str(),"pl"); // plip
|
||||||
hasLAN = strstr(output, "eth") != NULL;
|
hasLAN = strstr(output.fn_str(), "eth") != NULL;
|
||||||
#elif defined(__SGI__) // IRIX
|
#elif defined(__SGI__) // IRIX
|
||||||
hasModem = strstr(output, "ppp") != NULL; // PPP
|
hasModem = strstr(output, "ppp") != NULL; // PPP
|
||||||
#elif defined(__HPUX__)
|
#elif defined(__HPUX__)
|
||||||
|
@@ -303,7 +303,7 @@ bool wxDir::HasSubDirs(const wxString& spec)
|
|||||||
// caller will learn it soon enough when it calls GetFirst(wxDIR)
|
// caller will learn it soon enough when it calls GetFirst(wxDIR)
|
||||||
// anyhow
|
// anyhow
|
||||||
wxStructStat stBuf;
|
wxStructStat stBuf;
|
||||||
if ( wxStat(M_DIR->GetName(), &stBuf) == 0 )
|
if ( wxStat(M_DIR->GetName().fn_str(), &stBuf) == 0 )
|
||||||
{
|
{
|
||||||
switch ( stBuf.st_nlink )
|
switch ( stBuf.st_nlink )
|
||||||
{
|
{
|
||||||
|
@@ -107,7 +107,12 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
|||||||
{
|
{
|
||||||
char *font = fonts[n];
|
char *font = fonts[n];
|
||||||
#if wxUSE_REGEX
|
#if wxUSE_REGEX
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxString sfont( wxConvLocal.cMB2WC( font ) );
|
||||||
|
if ( !re.Matches(sfont) )
|
||||||
|
#else
|
||||||
if ( !re.Matches(font) )
|
if ( !re.Matches(font) )
|
||||||
|
#endif
|
||||||
#else // !wxUSE_REGEX
|
#else // !wxUSE_REGEX
|
||||||
if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) )
|
if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) )
|
||||||
#endif // wxUSE_REGEX/!wxUSE_REGEX
|
#endif // wxUSE_REGEX/!wxUSE_REGEX
|
||||||
@@ -120,7 +125,11 @@ static bool ProcessFamiliesFromFontList(wxFontEnumerator *This,
|
|||||||
char *family = dash + 1;
|
char *family = dash + 1;
|
||||||
dash = strchr(family, '-');
|
dash = strchr(family, '-');
|
||||||
*dash = '\0'; // !NULL because Matches() above succeeded
|
*dash = '\0'; // !NULL because Matches() above succeeded
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxString fam( wxConvLocal.cMB2WC( family ) );
|
||||||
|
#else
|
||||||
wxString fam(family);
|
wxString fam(family);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( families.Index(fam) == wxNOT_FOUND )
|
if ( families.Index(fam) == wxNOT_FOUND )
|
||||||
{
|
{
|
||||||
|
@@ -455,7 +455,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize,
|
|||||||
|
|
||||||
(void) tokenizer.NextToken();
|
(void) tokenizer.NextToken();
|
||||||
|
|
||||||
newFontName += wxString::Format("%d-", pointSize);
|
newFontName += wxString::Format(wxT("%d-"), pointSize);
|
||||||
|
|
||||||
while(tokenizer.HasMoreTokens())
|
while(tokenizer.HasMoreTokens())
|
||||||
newFontName += tokenizer.GetNextToken();
|
newFontName += tokenizer.GetNextToken();
|
||||||
|
@@ -151,7 +151,7 @@ private:
|
|||||||
LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
|
LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
|
||||||
{
|
{
|
||||||
// try to open the file
|
// try to open the file
|
||||||
m_fdLock = open(m_nameLock,
|
m_fdLock = open(m_nameLock.fn_str(),
|
||||||
O_WRONLY | O_CREAT | O_EXCL,
|
O_WRONLY | O_CREAT | O_EXCL,
|
||||||
S_IRUSR | S_IWUSR);
|
S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
|
|||||||
wxLogSysError(_("Failed to lock the lock file '%s'"),
|
wxLogSysError(_("Failed to lock the lock file '%s'"),
|
||||||
m_nameLock.c_str());
|
m_nameLock.c_str());
|
||||||
|
|
||||||
unlink(m_nameLock);
|
unlink(m_nameLock.fn_str());
|
||||||
|
|
||||||
return LOCK_ERROR;
|
return LOCK_ERROR;
|
||||||
}
|
}
|
||||||
@@ -257,7 +257,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
|
|||||||
{
|
{
|
||||||
if ( kill(m_pidLocker, 0) != 0 )
|
if ( kill(m_pidLocker, 0) != 0 )
|
||||||
{
|
{
|
||||||
if ( unlink(name) != 0 )
|
if ( unlink(name.fn_str()) != 0 )
|
||||||
{
|
{
|
||||||
wxLogError(_("Failed to remove stale lock file '%s'."),
|
wxLogError(_("Failed to remove stale lock file '%s'."),
|
||||||
name.c_str());
|
name.c_str());
|
||||||
@@ -291,7 +291,7 @@ void wxSingleInstanceCheckerImpl::Unlock()
|
|||||||
{
|
{
|
||||||
if ( m_fdLock != -1 )
|
if ( m_fdLock != -1 )
|
||||||
{
|
{
|
||||||
if ( unlink(m_nameLock) != 0 )
|
if ( unlink(m_nameLock.fn_str()) != 0 )
|
||||||
{
|
{
|
||||||
wxLogSysError(_("Failed to remove lock file '%s'"),
|
wxLogSysError(_("Failed to remove lock file '%s'"),
|
||||||
m_nameLock.c_str());
|
m_nameLock.c_str());
|
||||||
|
@@ -210,7 +210,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType)
|
|||||||
m_isOk = err == 0;
|
m_isOk = err == 0;
|
||||||
if ( !m_isOk )
|
if ( !m_isOk )
|
||||||
{
|
{
|
||||||
wxLogApiError("pthread_mutex_init()", err);
|
wxLogApiError( wxT("pthread_mutex_init()"), err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ wxMutexInternal::~wxMutexInternal()
|
|||||||
int err = pthread_mutex_destroy(&m_mutex);
|
int err = pthread_mutex_destroy(&m_mutex);
|
||||||
if ( err != 0 )
|
if ( err != 0 )
|
||||||
{
|
{
|
||||||
wxLogApiError("pthread_mutex_destroy()", err);
|
wxLogApiError( wxT("pthread_mutex_destroy()"), err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -253,7 +253,11 @@ long wxExecute( const wxString& command, int flags, wxProcess *process )
|
|||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
|
|
||||||
// do execute the command
|
// do execute the command
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
long lRc = -1;
|
||||||
|
#else
|
||||||
long lRc = wxExecute(argv, flags, process);
|
long lRc = wxExecute(argv, flags, process);
|
||||||
|
#endif
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
argc = 0;
|
argc = 0;
|
||||||
@@ -1105,9 +1109,9 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
|
|||||||
#if defined(HAVE_STATFS) || defined(HAVE_STATVFS)
|
#if defined(HAVE_STATFS) || defined(HAVE_STATVFS)
|
||||||
// the case to "char *" is needed for AIX 4.3
|
// the case to "char *" is needed for AIX 4.3
|
||||||
wxStatFs fs;
|
wxStatFs fs;
|
||||||
if ( statfs((char *)path.fn_str(), &fs) != 0 )
|
if ( statfs((char *)(const char*)path.fn_str(), &fs) != 0 )
|
||||||
{
|
{
|
||||||
wxLogSysError("Failed to get file system statistics");
|
wxLogSysError( wxT("Failed to get file system statistics") );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user