OK, while I wait for the non-Unicode build to compile, I can report

that now all files in gtk/ compiles in Unicode mode. unix/ is still
missing, but that probably wouldn't take too long.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven 1999-04-15 14:36:04 +00:00
parent 95dee6514a
commit 05939a8140
10 changed files with 446 additions and 358 deletions

View File

@ -204,13 +204,13 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
m_hasToolAlready = TRUE;
wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL,
"invalid bitmap for wxToolBar icon" );
_T("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL,
"wxToolBar doesn't support GdkBitmap" );
_T("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL,
"wxToolBar::Add needs a wxBitmap" );
_T("wxToolBar::Add needs a wxBitmap") );
GtkWidget *tool_pixmap = (GtkWidget *)NULL;
@ -238,7 +238,7 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
ctype,
(GtkWidget *)NULL,
(const char *)NULL,
helpString1,
helpString1.mbc_str(),
"",
tool_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
@ -264,7 +264,7 @@ void wxToolBar::AddSeparator()
void wxToolBar::ClearTools()
{
wxFAIL_MSG( "wxToolBar::ClearTools not implemented" );
wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") );
}
bool wxToolBar::Realize()
@ -314,7 +314,7 @@ void wxToolBar::EnableTool(int toolIndex, bool enable)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
}
void wxToolBar::ToggleTool( int toolIndex, bool toggle )
@ -333,7 +333,7 @@ void wxToolBar::ToggleTool( int toolIndex, bool toggle )
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
}
wxObject *wxToolBar::GetToolClientData( int index ) const
@ -346,7 +346,7 @@ wxObject *wxToolBar::GetToolClientData( int index ) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return (wxObject*)NULL;
}
@ -361,7 +361,7 @@ bool wxToolBar::GetToolState(int toolIndex) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return FALSE;
}
@ -376,14 +376,14 @@ bool wxToolBar::GetToolEnabled(int toolIndex) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return FALSE;
}
void wxToolBar::SetMargins( int x, int y )
{
wxCHECK_RET( !m_hasToolAlready, "wxToolBar::SetMargins must be called before adding tool." );
wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") );
if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well
@ -393,7 +393,7 @@ void wxToolBar::SetMargins( int x, int y )
void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
wxFAIL_MSG( "wxToolBar::SetToolPacking not implemented" );
wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") );
}
void wxToolBar::SetToolSeparation( int separation )
@ -425,9 +425,9 @@ wxString wxToolBar::GetToolLongHelp(int toolIndex)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return "";
return _T("");
}
wxString wxToolBar::GetToolShortHelp(int toolIndex)
@ -443,9 +443,9 @@ wxString wxToolBar::GetToolShortHelp(int toolIndex)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return "";
return _T("");
}
void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
@ -462,7 +462,7 @@ void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return;
}
@ -481,7 +481,7 @@ void wxToolBar::SetToolShortHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return;
}

View File

@ -195,7 +195,12 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
if (!value.IsEmpty())
{
gint tmp = 0;
#if wxUSE_UNICODE
wxWX2MBbuf val = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), val, strlen(val), &tmp );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
#endif
if (multi_line)
{
@ -276,14 +281,14 @@ void wxTextCtrl::CalculateScrollbar()
wxString wxTextCtrl::GetValue() const
{
wxCHECK_MSG( m_text != NULL, "", "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") );
wxString tmp;
if (m_windowStyle & wxTE_MULTILINE)
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), 0, len );
tmp = text;
tmp = wxString(text,*wxConv_current);
g_free( text );
}
else
@ -295,26 +300,31 @@ wxString wxTextCtrl::GetValue() const
void wxTextCtrl::SetValue( const wxString &value )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
wxString tmp = "";
wxString tmp = _T("");
if (!value.IsNull()) tmp = value;
if (m_windowStyle & wxTE_MULTILINE)
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
gtk_editable_delete_text( GTK_EDITABLE(m_text), 0, len );
len = 0;
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmp, tmp.Length(), &len );
#if wxUSE_UNICODE
wxWX2MBbuf tmpbuf = tmp.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmpbuf, strlen(tmpbuf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmp.mbc_str(), tmp.Length(), &len );
#endif
}
else
{
gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
}
}
void wxTextCtrl::WriteText( const wxString &text )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (text.IsNull()) return;
@ -323,7 +333,12 @@ void wxTextCtrl::WriteText( const wxString &text )
/* this moves the cursor pos to behind the inserted text */
gint len = GTK_EDITABLE(m_text)->current_pos;
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos = gtk_text_get_point( GTK_TEXT(m_text) );
@ -332,7 +347,12 @@ void wxTextCtrl::WriteText( const wxString &text )
{
/* this moves the cursor pos to behind the inserted text */
gint len = GTK_EDITABLE(m_text)->current_pos;
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos += text.Len();
@ -344,26 +364,31 @@ void wxTextCtrl::WriteText( const wxString &text )
void wxTextCtrl::AppendText( const wxString &text )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
/* we'll insert at the last position */
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos = gtk_text_get_point( GTK_TEXT(m_text) );
}
else
{
gtk_entry_append_text( GTK_ENTRY(m_text), text );
gtk_entry_append_text( GTK_ENTRY(m_text), text.mbc_str() );
}
}
bool wxTextCtrl::LoadFile( const wxString &file )
{
wxCHECK_MSG( m_text != NULL, FALSE, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
if (!wxFileExists(file)) return FALSE;
@ -372,8 +397,8 @@ bool wxTextCtrl::LoadFile( const wxString &file )
FILE *fp = (FILE*) NULL;
struct stat statb;
if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
!(fp = fopen ((char*) (const char*) file, "r")))
if ((stat (FNSTRINGCAST file.fn_str(), &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
!(fp = fopen (FNSTRINGCAST file.fn_str(), "r")))
{
return FALSE;
}
@ -412,13 +437,13 @@ bool wxTextCtrl::LoadFile( const wxString &file )
bool wxTextCtrl::SaveFile( const wxString &file )
{
wxCHECK_MSG( m_text != NULL, FALSE, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
if (file == "") return FALSE;
if (file == _T("")) return FALSE;
FILE *fp;
if (!(fp = fopen ((char*) (const char*) file, "w")))
if (!(fp = fopen (FNSTRINGCAST file.fn_str(), "w")))
{
return FALSE;
}
@ -466,7 +491,7 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const
if (text)
{
wxString buf("");
wxString buf(_T(""));
long i;
int currentLine = 0;
for (i = 0; currentLine != lineNo && text[i]; i++ )
@ -494,7 +519,7 @@ void wxTextCtrl::OnDropFiles( wxDropFilesEvent &WXUNUSED(event) )
{
/* If you implement this, don't forget to update the documentation!
* (file docs/latex/wx/text.tex) */
wxFAIL_MSG( "wxTextCtrl::OnDropFiles not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") );
}
long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
@ -510,10 +535,10 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
*x=0; // First Col
*y=0; // First Line
const char* stop = text.c_str() + pos;
for ( const char *p = text.c_str(); p < stop; p++ )
const wxChar* stop = text.c_str() + pos;
for ( const wxChar *p = text.c_str(); p < stop; p++ )
{
if (*p == '\n')
if (*p == _T('\n'))
{
(*y)++;
*x=0;
@ -589,7 +614,7 @@ int wxTextCtrl::GetNumberOfLines() const
void wxTextCtrl::SetInsertionPoint( long pos )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
@ -626,7 +651,7 @@ void wxTextCtrl::SetInsertionPoint( long pos )
void wxTextCtrl::SetInsertionPointEnd()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text)));
@ -636,7 +661,7 @@ void wxTextCtrl::SetInsertionPointEnd()
void wxTextCtrl::SetEditable( bool editable )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
gtk_text_set_editable( GTK_TEXT(m_text), editable );
@ -646,26 +671,26 @@ void wxTextCtrl::SetEditable( bool editable )
void wxTextCtrl::SetSelection( long from, long to )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
{
wxFAIL_MSG( "wxTextCtrl::ShowPosition not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::ShowPosition not implemented") );
}
long wxTextCtrl::GetInsertionPoint() const
{
wxCHECK_MSG( m_text != NULL, 0, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
return (long) GTK_EDITABLE(m_text)->current_pos;
}
long wxTextCtrl::GetLastPosition() const
{
wxCHECK_MSG( m_text != NULL, 0, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
@ -678,24 +703,29 @@ long wxTextCtrl::GetLastPosition() const
void wxTextCtrl::Remove( long from, long to )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
if (value.IsNull()) return;
gint pos = (gint)from;
#if wxUSE_UNICODE
wxWX2MBbuf buf = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &pos );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
#endif
}
void wxTextCtrl::Cut()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
@ -706,7 +736,7 @@ void wxTextCtrl::Cut()
void wxTextCtrl::Copy()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
@ -717,7 +747,7 @@ void wxTextCtrl::Copy()
void wxTextCtrl::Paste()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
@ -751,26 +781,26 @@ bool wxTextCtrl::CanPaste() const
void wxTextCtrl::Undo()
{
// TODO
wxFAIL_MSG( "wxTextCtrl::Undo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") );
}
void wxTextCtrl::Redo()
{
// TODO
wxFAIL_MSG( "wxTextCtrl::Redo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") );
}
bool wxTextCtrl::CanUndo() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::CanUndo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") );
return FALSE;
}
bool wxTextCtrl::CanRedo() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::CanRedo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") );
return FALSE;
}
@ -781,24 +811,24 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
// TODO
*from = 0;
*to = 0;
wxFAIL_MSG( "wxTextCtrl::GetSelection not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::GetSelection not implemented") );
}
bool wxTextCtrl::IsEditable() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::IsEditable not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::IsEditable not implemented") );
return FALSE;
}
void wxTextCtrl::Clear()
{
SetValue( "" );
SetValue( _T("") );
}
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER))
{
@ -904,21 +934,21 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
// doesn't work
}
void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
// doesn't work
}
void wxTextCtrl::SetBackgroundColour( const wxColour &colour )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
wxControl::SetBackgroundColour( colour );

View File

@ -69,7 +69,7 @@ void wxToolTip::Apply( wxWindow *win )
m_window = win;
if (m_text.IsEmpty())
m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
m_window->ApplyToolTip( ss_tooltips, (wxChar*) NULL );
else
m_window->ApplyToolTip( ss_tooltips, m_text );
}

View File

@ -39,9 +39,9 @@
// Yuck this is really BOTH site and platform dependent
// so we should use some other strategy!
#ifdef __SUN__
#define DEFAULT_XRESOURCE_DIR "/usr/openwin/lib/app-defaults"
#define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults")
#else
#define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults"
#define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults")
#endif
//-----------------------------------------------------------------------------
@ -55,26 +55,26 @@ extern XrmDatabase wxResourceDatabase;
// utility functions for get/write resources
//-----------------------------------------------------------------------------
static char *GetResourcePath(char *buf, char *name, bool create)
static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create)
{
if (create && FileExists(name))
{
strcpy(buf, name);
wxStrcpy(buf, name);
return buf; // Exists so ...
}
if (*name == '/')
strcpy(buf, name);
if (*name == _T('/'))
wxStrcpy(buf, name);
else
{
// Put in standard place for resource files if not absolute
strcpy(buf, DEFAULT_XRESOURCE_DIR);
strcat(buf, "/");
strcat(buf, FileNameFromPath(name));
wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
wxStrcat(buf, _T("/"));
wxStrcat(buf, FileNameFromPath(name));
}
if (create)
{
// Touch the file to create it
FILE *fd = fopen(buf, "w");
FILE *fd = fopen(wxConv_file.cWX2MB(buf), "w");
if (fd) fclose(fd);
}
return buf;
@ -83,30 +83,30 @@ static char *GetResourcePath(char *buf, char *name, bool create)
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
static char *GetIniFile(char *dest, const char *filename)
static wxChar *GetIniFile(wxChar *dest, const wxChar *filename)
{
char *home = (char *) NULL;
wxChar *home = (wxChar *) NULL;
if (filename && wxIsAbsolutePath(filename))
{
strcpy(dest, filename);
wxStrcpy(dest, filename);
}
else
{
if ((home = wxGetUserHome(wxString())) != NULL)
{
strcpy(dest, home);
if (dest[strlen(dest) - 1] != '/') strcat(dest, "/");
wxStrcpy(dest, home);
if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/"));
if (filename == NULL)
{
if ((filename = getenv("XENVIRONMENT")) == NULL) filename = ".Xdefaults";
if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults");
}
else
if (*filename != '.') strcat(dest, ".");
strcat(dest, filename);
if (*filename != _T('.')) wxStrcat(dest, _T("."));
wxStrcat(dest, filename);
}
else
{
dest[0] = '\0';
dest[0] = _T('\0');
}
}
return dest;
@ -115,10 +115,10 @@ static char *GetIniFile(char *dest, const char *filename)
static void wxXMergeDatabases()
{
XrmDatabase homeDB, serverDB, applicationDB;
char filenamebuf[1024];
wxChar filenamebuf[1024];
char *filename = &filenamebuf[0];
char *environment;
wxChar *filename = &filenamebuf[0];
wxChar *environment;
char *classname = gdk_progclass; // Robert Roebling ??
char name[256];
(void)strcpy(name, "/usr/lib/X11/app-defaults/");
@ -138,8 +138,8 @@ static void wxXMergeDatabases()
}
else
{
(void)GetIniFile(filename, (char *) NULL);
serverDB = XrmGetFileDatabase(filename);
(void)GetIniFile(filename, (wxChar *) NULL);
serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
}
if (serverDB)
XrmMergeDatabases(serverDB, &wxResourceDatabase);
@ -147,18 +147,32 @@ static void wxXMergeDatabases()
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
if ((environment = getenv("XENVIRONMENT")) == NULL)
if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL)
{
size_t len;
environment = GetIniFile(filename, (const char *) NULL);
len = strlen(environment);
#if wxUSE_UNICODE
char hostbuf[1024];
#endif
environment = GetIniFile(filename, (const wxChar *) NULL);
len = wxStrlen(environment);
#if !defined(SVR4) || defined(__sgi)
#if wxUSE_UNICODE
(void)gethostname(hostbuf, 1024 - len);
#else
(void)gethostname(environment + len, 1024 - len);
#endif
#else
#if wxUSE_UNICODE
(void)sysinfo(SI_HOSTNAME, hostbuf, 1024 - len);
#else
(void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
#endif
#endif
#if wxUSE_UNICODE
wxStrcat(environment, wxConv_libc.cMB2WX(hostbuf));
#endif
}
if ((homeDB = XrmGetFileDatabase(environment)))
if ((homeDB = XrmGetFileDatabase(wxConv_file.cWX2MB(environment))))
XrmMergeDatabases(homeDB, &wxResourceDatabase);
}
@ -168,17 +182,17 @@ static void wxXMergeDatabases()
void wxFlushResources()
{
char nameBuffer[512];
wxChar nameBuffer[512];
wxNode *node = wxTheResourceCache->First();
while (node) {
wxString str = node->GetKeyString();
char *file = WXSTRINGCAST str;
wxChar *file = WXSTRINGCAST str;
// If file doesn't exist, create it first.
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
XrmPutFileDatabase(database, nameBuffer);
XrmPutFileDatabase(database, wxConv_file.cWX2MB(nameBuffer));
XrmDestroyDatabase(database);
wxNode *next = node->Next();
// delete node;
@ -186,10 +200,10 @@ void wxFlushResources()
}
}
void wxDeleteResources(const char *file)
void wxDeleteResources(const wxChar *file)
{
wxLogTrace(wxTraceResAlloc, "Delete: Number = %d", wxTheResourceCache->Number());
char buffer[500];
wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number());
wxChar buffer[500];
(void)GetIniFile(buffer, file);
wxNode *node = wxTheResourceCache->Find(buffer);
@ -206,7 +220,7 @@ void wxDeleteResources(const char *file)
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file )
{
char buffer[500];
wxChar buffer[500];
if (!entry) return FALSE;
@ -217,15 +231,15 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr
if (node)
database = (XrmDatabase)node->Data();
else {
database = XrmGetFileDatabase(buffer);
wxLogTrace(wxTraceResAlloc, "Write: Number = %d", wxTheResourceCache->Number());
database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
char resName[300];
strcpy(resName, !section.IsNull() ? WXSTRINGCAST section : "wxWindows");
strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows");
strcat(resName, ".");
strcat(resName, entry);
XrmPutStringResource(&database, resName, value);
strcat(resName, entry.mb_str());
XrmPutStringResource(&database, resName, value.mb_str());
return TRUE;
};
@ -258,7 +272,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
XrmDatabase database;
if (!file.IsEmpty())
{
char buffer[500];
wxChar buffer[500];
// Is this right? Trying to get it to look in the user's
// home directory instead of current directory -- JACS
(void)GetIniFile(buffer, file);
@ -271,8 +285,8 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
}
else
{
database = XrmGetFileDatabase(buffer);
wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number());
database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
} else
@ -281,9 +295,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
XrmValue xvalue;
char *str_type[20];
char buf[150];
strcpy(buf, section);
strcpy(buf, section.mb_str());
strcat(buf, ".");
strcat(buf, entry);
strcat(buf, entry.mb_str());
bool success = XrmGetResource(database, buf, "*", str_type, &xvalue);
// Try different combinations of upper/lower case, just in case...

View File

@ -1434,7 +1434,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
wxASSERT_MSG( m_isWindow, "Init() must have been called before!" );
wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") );
PreCreation( parent, id, pos, size, style, name );
@ -1641,7 +1641,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
wxASSERT_MSG( (!m_needParent) || (parent), "Need complete parent." );
wxASSERT_MSG( (!m_needParent) || (parent), _T("Need complete parent.") );
m_widget = (GtkWidget*) NULL;
m_wxwindow = (GtkWidget*) NULL;
@ -1727,7 +1727,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
void wxWindow::PostCreation()
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
if (m_wxwindow)
{
@ -1797,7 +1797,7 @@ bool wxWindow::HasVMT()
bool wxWindow::Close( bool force )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
@ -1810,7 +1810,7 @@ bool wxWindow::Close( bool force )
bool wxWindow::Destroy()
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
m_hasVMT = FALSE;
delete this;
@ -1839,8 +1839,8 @@ void wxWindow::PrepareDC( wxDC &WXUNUSED(dc) )
void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
@ -1922,7 +1922,7 @@ void wxWindow::OnInternalIdle()
void wxWindow::GetSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (width) (*width) = m_width;
if (height) (*height) = m_height;
@ -1930,7 +1930,7 @@ void wxWindow::GetSize( int *width, int *height ) const
void wxWindow::DoSetClientSize( int width, int height )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_wxwindow)
{
@ -1995,7 +1995,7 @@ void wxWindow::DoSetClientSize( int width, int height )
void wxWindow::GetClientSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_wxwindow)
{
@ -2061,7 +2061,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
void wxWindow::GetPosition( int *x, int *y ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (x) (*x) = m_x;
if (y) (*y) = m_y;
@ -2069,7 +2069,7 @@ void wxWindow::GetPosition( int *x, int *y ) const
void wxWindow::ClientToScreen( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
@ -2096,7 +2096,7 @@ void wxWindow::ClientToScreen( int *x, int *y )
void wxWindow::ScreenToClient( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
@ -2123,7 +2123,7 @@ void wxWindow::ScreenToClient( int *x, int *y )
void wxWindow::Centre( int direction )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
int x = m_x;
int y = m_y;
@ -2147,7 +2147,7 @@ void wxWindow::Centre( int direction )
void wxWindow::Fit()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
int maxX = 0;
int maxY = 0;
@ -2169,7 +2169,7 @@ void wxWindow::Fit()
void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
m_minWidth = minW;
m_minHeight = minH;
@ -2184,7 +2184,7 @@ void wxWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
bool wxWindow::Show( bool show )
{
wxCHECK_MSG( (m_widget != NULL), FALSE, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
if (show == m_isShown) return TRUE;
@ -2200,7 +2200,7 @@ bool wxWindow::Show( bool show )
void wxWindow::Enable( bool enable )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
m_isEnabled = enable;
@ -2210,9 +2210,9 @@ void wxWindow::Enable( bool enable )
int wxWindow::GetCharHeight() const
{
wxCHECK_MSG( (m_widget != NULL), 12, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") );
wxCHECK_MSG( m_font.Ok(), 12, "invalid font" );
wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
@ -2221,9 +2221,9 @@ int wxWindow::GetCharHeight() const
int wxWindow::GetCharWidth() const
{
wxCHECK_MSG( (m_widget != NULL), 8, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") );
wxCHECK_MSG( m_font.Ok(), 8, "invalid font" );
wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
@ -2236,10 +2236,10 @@ void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
wxCHECK_RET( fontToUse.Ok(), "invalid font" );
wxCHECK_RET( fontToUse.Ok(), _T("invalid font") );
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string );
if (x) (*x) = gdk_string_width( font, string.mbc_str() );
if (y) (*y) = font->ascent + font->descent;
if (descent) (*descent) = font->descent;
if (externalLeading) (*externalLeading) = 0; // ??
@ -2275,7 +2275,7 @@ void wxWindow::OnKeyDown( wxKeyEvent &event )
void wxWindow::SetFocus()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
@ -2306,15 +2306,15 @@ bool wxWindow::AcceptsFocus() const
void wxWindow::AddChild( wxWindow *child )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (child != NULL), "invalid child" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
wxCHECK_RET( (child != NULL), _T("invalid child") );
m_children.Append( child );
}
wxWindow *wxWindow::ReParent( wxWindow *newParent )
{
wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, _T("invalid window") );
wxWindow *oldParent = GetParent();
@ -2349,14 +2349,14 @@ int wxWindow::GetReturnCode()
void wxWindow::Raise()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (m_widget) gdk_window_raise( m_widget->window );
}
void wxWindow::Lower()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (m_widget) gdk_window_lower( m_widget->window );
}
@ -2447,7 +2447,7 @@ wxWindowID wxWindow::GetId() const
void wxWindow::SetCursor( const wxCursor &cursor )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (cursor.Ok())
{
@ -2473,7 +2473,7 @@ void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
@ -2538,7 +2538,7 @@ bool wxWindow::IsExposed( const wxRect& rect ) const
void wxWindow::Clear()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_wxwindow && m_wxwindow->window)
{
@ -2576,9 +2576,9 @@ void wxWindow::SetToolTip( wxToolTip *tip )
m_toolTip->Apply( this );
}
void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConv_current->cWX2MB(tip), (gchar*) NULL );
}
#endif // wxUSE_TOOLTIPS
@ -2589,7 +2589,7 @@ wxColour wxWindow::GetBackgroundColour() const
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_backgroundColour == colour) return;
@ -2629,7 +2629,7 @@ wxColour wxWindow::GetForegroundColour() const
void wxWindow::SetForegroundColour( const wxColour &colour )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_foregroundColour == colour) return;
@ -2697,7 +2697,7 @@ void wxWindow::ApplyWidgetStyle()
bool wxWindow::Validate()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2714,7 +2714,7 @@ bool wxWindow::Validate()
bool wxWindow::TransferDataToWindow()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2733,7 +2733,7 @@ bool wxWindow::TransferDataToWindow()
bool wxWindow::TransferDataFromWindow()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2760,7 +2760,7 @@ void wxWindow::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) )
void wxWindow::InitDialog()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxInitDialogEvent event(GetId());
event.SetEventObject( this );
@ -2794,9 +2794,9 @@ static void pop_pos_callback( GtkMenu *menu, gint *x, gint *y, wxWindow *win )
bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxCHECK_MSG( menu != NULL, FALSE, "invalid popup-menu" );
wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") );
SetInvokingWindow( menu, this );
@ -2821,7 +2821,7 @@ bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
GtkWidget *dnd_widget = GetConnectWidget();
@ -2856,7 +2856,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
void wxWindow::SetFont( const wxFont &font )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_font == font) return;
@ -2892,9 +2892,9 @@ long wxWindow::GetWindowStyleFlag() const
void wxWindow::CaptureMouse()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( g_capturing == FALSE, "CaptureMouse called twice" );
wxCHECK_RET( g_capturing == FALSE, _T("CaptureMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
@ -2911,9 +2911,9 @@ void wxWindow::CaptureMouse()
void wxWindow::ReleaseMouse()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( g_capturing == TRUE, "ReleaseMouse called twice" );
wxCHECK_RET( g_capturing == TRUE, _T("ReleaseMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
@ -2986,9 +2986,9 @@ wxWindow *wxWindow::FindWindow( const wxString& name )
void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
m_hasScrolling = TRUE;
@ -3054,9 +3054,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
{
@ -3093,9 +3093,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
int wxWindow::GetScrollThumb( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->page_size+0.5);
@ -3105,9 +3105,9 @@ int wxWindow::GetScrollThumb( int orient ) const
int wxWindow::GetScrollPos( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->value+0.5);
@ -3117,9 +3117,9 @@ int wxWindow::GetScrollPos( int orient ) const
int wxWindow::GetScrollRange( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->upper+0.5);
@ -3129,9 +3129,9 @@ int wxWindow::GetScrollRange( int orient ) const
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
wxNode *node = m_children.First();
while (node)
@ -3482,21 +3482,21 @@ void wxWindow::SetConstraintSizes(bool recurse)
}
else if (constr)
{
char *windowClass = this->GetClassInfo()->GetClassName();
wxChar *windowClass = this->GetClassInfo()->GetClassName();
wxString winName;
if (GetName() == "")
winName = "unnamed";
if (GetName() == _T(""))
winName = _T("unnamed");
else
winName = GetName();
wxLogDebug( "Constraint(s) not satisfied for window of type %s, name %s:\n",
(const char *)windowClass,
(const char *)winName);
if (!constr->left.GetDone()) wxLogDebug( " unsatisfied 'left' constraint.\n" );
if (!constr->right.GetDone()) wxLogDebug( " unsatisfied 'right' constraint.\n" );
if (!constr->width.GetDone()) wxLogDebug( " unsatisfied 'width' constraint.\n" );
if (!constr->height.GetDone()) wxLogDebug( " unsatisfied 'height' constraint.\n" );
wxLogDebug( "Please check constraints: try adding AsIs() constraints.\n" );
wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"),
(const wxChar *)windowClass,
(const wxChar *)winName);
if (!constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") );
if (!constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") );
if (!constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") );
if (!constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") );
wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") );
}
if (recurse)

View File

@ -204,13 +204,13 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
m_hasToolAlready = TRUE;
wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL,
"invalid bitmap for wxToolBar icon" );
_T("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL,
"wxToolBar doesn't support GdkBitmap" );
_T("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL,
"wxToolBar::Add needs a wxBitmap" );
_T("wxToolBar::Add needs a wxBitmap") );
GtkWidget *tool_pixmap = (GtkWidget *)NULL;
@ -238,7 +238,7 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
ctype,
(GtkWidget *)NULL,
(const char *)NULL,
helpString1,
helpString1.mbc_str(),
"",
tool_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
@ -264,7 +264,7 @@ void wxToolBar::AddSeparator()
void wxToolBar::ClearTools()
{
wxFAIL_MSG( "wxToolBar::ClearTools not implemented" );
wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") );
}
bool wxToolBar::Realize()
@ -314,7 +314,7 @@ void wxToolBar::EnableTool(int toolIndex, bool enable)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
}
void wxToolBar::ToggleTool( int toolIndex, bool toggle )
@ -333,7 +333,7 @@ void wxToolBar::ToggleTool( int toolIndex, bool toggle )
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
}
wxObject *wxToolBar::GetToolClientData( int index ) const
@ -346,7 +346,7 @@ wxObject *wxToolBar::GetToolClientData( int index ) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return (wxObject*)NULL;
}
@ -361,7 +361,7 @@ bool wxToolBar::GetToolState(int toolIndex) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return FALSE;
}
@ -376,14 +376,14 @@ bool wxToolBar::GetToolEnabled(int toolIndex) const
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return FALSE;
}
void wxToolBar::SetMargins( int x, int y )
{
wxCHECK_RET( !m_hasToolAlready, "wxToolBar::SetMargins must be called before adding tool." );
wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") );
if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well
@ -393,7 +393,7 @@ void wxToolBar::SetMargins( int x, int y )
void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
wxFAIL_MSG( "wxToolBar::SetToolPacking not implemented" );
wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") );
}
void wxToolBar::SetToolSeparation( int separation )
@ -425,9 +425,9 @@ wxString wxToolBar::GetToolLongHelp(int toolIndex)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return "";
return _T("");
}
wxString wxToolBar::GetToolShortHelp(int toolIndex)
@ -443,9 +443,9 @@ wxString wxToolBar::GetToolShortHelp(int toolIndex)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return "";
return _T("");
}
void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
@ -462,7 +462,7 @@ void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return;
}
@ -481,7 +481,7 @@ void wxToolBar::SetToolShortHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
wxFAIL_MSG( "wrong toolbar index" );
wxFAIL_MSG( _T("wrong toolbar index") );
return;
}

View File

@ -195,7 +195,12 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
if (!value.IsEmpty())
{
gint tmp = 0;
#if wxUSE_UNICODE
wxWX2MBbuf val = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), val, strlen(val), &tmp );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
#endif
if (multi_line)
{
@ -276,14 +281,14 @@ void wxTextCtrl::CalculateScrollbar()
wxString wxTextCtrl::GetValue() const
{
wxCHECK_MSG( m_text != NULL, "", "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") );
wxString tmp;
if (m_windowStyle & wxTE_MULTILINE)
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), 0, len );
tmp = text;
tmp = wxString(text,*wxConv_current);
g_free( text );
}
else
@ -295,26 +300,31 @@ wxString wxTextCtrl::GetValue() const
void wxTextCtrl::SetValue( const wxString &value )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
wxString tmp = "";
wxString tmp = _T("");
if (!value.IsNull()) tmp = value;
if (m_windowStyle & wxTE_MULTILINE)
{
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
gtk_editable_delete_text( GTK_EDITABLE(m_text), 0, len );
len = 0;
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmp, tmp.Length(), &len );
#if wxUSE_UNICODE
wxWX2MBbuf tmpbuf = tmp.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmpbuf, strlen(tmpbuf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), tmp.mbc_str(), tmp.Length(), &len );
#endif
}
else
{
gtk_entry_set_text( GTK_ENTRY(m_text), tmp );
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
}
}
void wxTextCtrl::WriteText( const wxString &text )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (text.IsNull()) return;
@ -323,7 +333,12 @@ void wxTextCtrl::WriteText( const wxString &text )
/* this moves the cursor pos to behind the inserted text */
gint len = GTK_EDITABLE(m_text)->current_pos;
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos = gtk_text_get_point( GTK_TEXT(m_text) );
@ -332,7 +347,12 @@ void wxTextCtrl::WriteText( const wxString &text )
{
/* this moves the cursor pos to behind the inserted text */
gint len = GTK_EDITABLE(m_text)->current_pos;
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos += text.Len();
@ -344,26 +364,31 @@ void wxTextCtrl::WriteText( const wxString &text )
void wxTextCtrl::AppendText( const wxString &text )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
/* we'll insert at the last position */
gint len = gtk_text_get_length( GTK_TEXT(m_text) );
#if wxUSE_UNICODE
wxWX2MBbuf buf = text.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &len );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), text, text.Length(), &len );
#endif
/* bring editable's cursor uptodate. bug in GTK. */
GTK_EDITABLE(m_text)->current_pos = gtk_text_get_point( GTK_TEXT(m_text) );
}
else
{
gtk_entry_append_text( GTK_ENTRY(m_text), text );
gtk_entry_append_text( GTK_ENTRY(m_text), text.mbc_str() );
}
}
bool wxTextCtrl::LoadFile( const wxString &file )
{
wxCHECK_MSG( m_text != NULL, FALSE, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
if (!wxFileExists(file)) return FALSE;
@ -372,8 +397,8 @@ bool wxTextCtrl::LoadFile( const wxString &file )
FILE *fp = (FILE*) NULL;
struct stat statb;
if ((stat ((char*) (const char*) file, &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
!(fp = fopen ((char*) (const char*) file, "r")))
if ((stat (FNSTRINGCAST file.fn_str(), &statb) == -1) || (statb.st_mode & S_IFMT) != S_IFREG ||
!(fp = fopen (FNSTRINGCAST file.fn_str(), "r")))
{
return FALSE;
}
@ -412,13 +437,13 @@ bool wxTextCtrl::LoadFile( const wxString &file )
bool wxTextCtrl::SaveFile( const wxString &file )
{
wxCHECK_MSG( m_text != NULL, FALSE, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
if (file == "") return FALSE;
if (file == _T("")) return FALSE;
FILE *fp;
if (!(fp = fopen ((char*) (const char*) file, "w")))
if (!(fp = fopen (FNSTRINGCAST file.fn_str(), "w")))
{
return FALSE;
}
@ -466,7 +491,7 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const
if (text)
{
wxString buf("");
wxString buf(_T(""));
long i;
int currentLine = 0;
for (i = 0; currentLine != lineNo && text[i]; i++ )
@ -494,7 +519,7 @@ void wxTextCtrl::OnDropFiles( wxDropFilesEvent &WXUNUSED(event) )
{
/* If you implement this, don't forget to update the documentation!
* (file docs/latex/wx/text.tex) */
wxFAIL_MSG( "wxTextCtrl::OnDropFiles not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") );
}
long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
@ -510,10 +535,10 @@ long wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
*x=0; // First Col
*y=0; // First Line
const char* stop = text.c_str() + pos;
for ( const char *p = text.c_str(); p < stop; p++ )
const wxChar* stop = text.c_str() + pos;
for ( const wxChar *p = text.c_str(); p < stop; p++ )
{
if (*p == '\n')
if (*p == _T('\n'))
{
(*y)++;
*x=0;
@ -589,7 +614,7 @@ int wxTextCtrl::GetNumberOfLines() const
void wxTextCtrl::SetInsertionPoint( long pos )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
@ -626,7 +651,7 @@ void wxTextCtrl::SetInsertionPoint( long pos )
void wxTextCtrl::SetInsertionPointEnd()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text)));
@ -636,7 +661,7 @@ void wxTextCtrl::SetInsertionPointEnd()
void wxTextCtrl::SetEditable( bool editable )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
gtk_text_set_editable( GTK_TEXT(m_text), editable );
@ -646,26 +671,26 @@ void wxTextCtrl::SetEditable( bool editable )
void wxTextCtrl::SetSelection( long from, long to )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
{
wxFAIL_MSG( "wxTextCtrl::ShowPosition not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::ShowPosition not implemented") );
}
long wxTextCtrl::GetInsertionPoint() const
{
wxCHECK_MSG( m_text != NULL, 0, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
return (long) GTK_EDITABLE(m_text)->current_pos;
}
long wxTextCtrl::GetLastPosition() const
{
wxCHECK_MSG( m_text != NULL, 0, "invalid text ctrl" );
wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
@ -678,24 +703,29 @@ long wxTextCtrl::GetLastPosition() const
void wxTextCtrl::Remove( long from, long to )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
if (value.IsNull()) return;
gint pos = (gint)from;
#if wxUSE_UNICODE
wxWX2MBbuf buf = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), buf, strlen(buf), &pos );
#else
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &pos );
#endif
}
void wxTextCtrl::Cut()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
@ -706,7 +736,7 @@ void wxTextCtrl::Cut()
void wxTextCtrl::Copy()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
@ -717,7 +747,7 @@ void wxTextCtrl::Copy()
void wxTextCtrl::Paste()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
@ -751,26 +781,26 @@ bool wxTextCtrl::CanPaste() const
void wxTextCtrl::Undo()
{
// TODO
wxFAIL_MSG( "wxTextCtrl::Undo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") );
}
void wxTextCtrl::Redo()
{
// TODO
wxFAIL_MSG( "wxTextCtrl::Redo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") );
}
bool wxTextCtrl::CanUndo() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::CanUndo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") );
return FALSE;
}
bool wxTextCtrl::CanRedo() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::CanRedo not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") );
return FALSE;
}
@ -781,24 +811,24 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
// TODO
*from = 0;
*to = 0;
wxFAIL_MSG( "wxTextCtrl::GetSelection not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::GetSelection not implemented") );
}
bool wxTextCtrl::IsEditable() const
{
// TODO
wxFAIL_MSG( "wxTextCtrl::IsEditable not implemented" );
wxFAIL_MSG( _T("wxTextCtrl::IsEditable not implemented") );
return FALSE;
}
void wxTextCtrl::Clear()
{
SetValue( "" );
SetValue( _T("") );
}
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER))
{
@ -904,21 +934,21 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
// doesn't work
}
void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
// doesn't work
}
void wxTextCtrl::SetBackgroundColour( const wxColour &colour )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
wxControl::SetBackgroundColour( colour );

View File

@ -69,7 +69,7 @@ void wxToolTip::Apply( wxWindow *win )
m_window = win;
if (m_text.IsEmpty())
m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
m_window->ApplyToolTip( ss_tooltips, (wxChar*) NULL );
else
m_window->ApplyToolTip( ss_tooltips, m_text );
}

View File

@ -39,9 +39,9 @@
// Yuck this is really BOTH site and platform dependent
// so we should use some other strategy!
#ifdef __SUN__
#define DEFAULT_XRESOURCE_DIR "/usr/openwin/lib/app-defaults"
#define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults")
#else
#define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults"
#define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults")
#endif
//-----------------------------------------------------------------------------
@ -55,26 +55,26 @@ extern XrmDatabase wxResourceDatabase;
// utility functions for get/write resources
//-----------------------------------------------------------------------------
static char *GetResourcePath(char *buf, char *name, bool create)
static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create)
{
if (create && FileExists(name))
{
strcpy(buf, name);
wxStrcpy(buf, name);
return buf; // Exists so ...
}
if (*name == '/')
strcpy(buf, name);
if (*name == _T('/'))
wxStrcpy(buf, name);
else
{
// Put in standard place for resource files if not absolute
strcpy(buf, DEFAULT_XRESOURCE_DIR);
strcat(buf, "/");
strcat(buf, FileNameFromPath(name));
wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
wxStrcat(buf, _T("/"));
wxStrcat(buf, FileNameFromPath(name));
}
if (create)
{
// Touch the file to create it
FILE *fd = fopen(buf, "w");
FILE *fd = fopen(wxConv_file.cWX2MB(buf), "w");
if (fd) fclose(fd);
}
return buf;
@ -83,30 +83,30 @@ static char *GetResourcePath(char *buf, char *name, bool create)
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
static char *GetIniFile(char *dest, const char *filename)
static wxChar *GetIniFile(wxChar *dest, const wxChar *filename)
{
char *home = (char *) NULL;
wxChar *home = (wxChar *) NULL;
if (filename && wxIsAbsolutePath(filename))
{
strcpy(dest, filename);
wxStrcpy(dest, filename);
}
else
{
if ((home = wxGetUserHome(wxString())) != NULL)
{
strcpy(dest, home);
if (dest[strlen(dest) - 1] != '/') strcat(dest, "/");
wxStrcpy(dest, home);
if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/"));
if (filename == NULL)
{
if ((filename = getenv("XENVIRONMENT")) == NULL) filename = ".Xdefaults";
if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults");
}
else
if (*filename != '.') strcat(dest, ".");
strcat(dest, filename);
if (*filename != _T('.')) wxStrcat(dest, _T("."));
wxStrcat(dest, filename);
}
else
{
dest[0] = '\0';
dest[0] = _T('\0');
}
}
return dest;
@ -115,10 +115,10 @@ static char *GetIniFile(char *dest, const char *filename)
static void wxXMergeDatabases()
{
XrmDatabase homeDB, serverDB, applicationDB;
char filenamebuf[1024];
wxChar filenamebuf[1024];
char *filename = &filenamebuf[0];
char *environment;
wxChar *filename = &filenamebuf[0];
wxChar *environment;
char *classname = gdk_progclass; // Robert Roebling ??
char name[256];
(void)strcpy(name, "/usr/lib/X11/app-defaults/");
@ -138,8 +138,8 @@ static void wxXMergeDatabases()
}
else
{
(void)GetIniFile(filename, (char *) NULL);
serverDB = XrmGetFileDatabase(filename);
(void)GetIniFile(filename, (wxChar *) NULL);
serverDB = XrmGetFileDatabase(wxConv_file.cWX2MB(filename));
}
if (serverDB)
XrmMergeDatabases(serverDB, &wxResourceDatabase);
@ -147,18 +147,32 @@ static void wxXMergeDatabases()
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
if ((environment = getenv("XENVIRONMENT")) == NULL)
if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL)
{
size_t len;
environment = GetIniFile(filename, (const char *) NULL);
len = strlen(environment);
#if wxUSE_UNICODE
char hostbuf[1024];
#endif
environment = GetIniFile(filename, (const wxChar *) NULL);
len = wxStrlen(environment);
#if !defined(SVR4) || defined(__sgi)
#if wxUSE_UNICODE
(void)gethostname(hostbuf, 1024 - len);
#else
(void)gethostname(environment + len, 1024 - len);
#endif
#else
#if wxUSE_UNICODE
(void)sysinfo(SI_HOSTNAME, hostbuf, 1024 - len);
#else
(void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
#endif
#endif
#if wxUSE_UNICODE
wxStrcat(environment, wxConv_libc.cMB2WX(hostbuf));
#endif
}
if ((homeDB = XrmGetFileDatabase(environment)))
if ((homeDB = XrmGetFileDatabase(wxConv_file.cWX2MB(environment))))
XrmMergeDatabases(homeDB, &wxResourceDatabase);
}
@ -168,17 +182,17 @@ static void wxXMergeDatabases()
void wxFlushResources()
{
char nameBuffer[512];
wxChar nameBuffer[512];
wxNode *node = wxTheResourceCache->First();
while (node) {
wxString str = node->GetKeyString();
char *file = WXSTRINGCAST str;
wxChar *file = WXSTRINGCAST str;
// If file doesn't exist, create it first.
(void)GetResourcePath(nameBuffer, file, TRUE);
XrmDatabase database = (XrmDatabase)node->Data();
XrmPutFileDatabase(database, nameBuffer);
XrmPutFileDatabase(database, wxConv_file.cWX2MB(nameBuffer));
XrmDestroyDatabase(database);
wxNode *next = node->Next();
// delete node;
@ -186,10 +200,10 @@ void wxFlushResources()
}
}
void wxDeleteResources(const char *file)
void wxDeleteResources(const wxChar *file)
{
wxLogTrace(wxTraceResAlloc, "Delete: Number = %d", wxTheResourceCache->Number());
char buffer[500];
wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number());
wxChar buffer[500];
(void)GetIniFile(buffer, file);
wxNode *node = wxTheResourceCache->Find(buffer);
@ -206,7 +220,7 @@ void wxDeleteResources(const char *file)
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file )
{
char buffer[500];
wxChar buffer[500];
if (!entry) return FALSE;
@ -217,15 +231,15 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr
if (node)
database = (XrmDatabase)node->Data();
else {
database = XrmGetFileDatabase(buffer);
wxLogTrace(wxTraceResAlloc, "Write: Number = %d", wxTheResourceCache->Number());
database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
char resName[300];
strcpy(resName, !section.IsNull() ? WXSTRINGCAST section : "wxWindows");
strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows");
strcat(resName, ".");
strcat(resName, entry);
XrmPutStringResource(&database, resName, value);
strcat(resName, entry.mb_str());
XrmPutStringResource(&database, resName, value.mb_str());
return TRUE;
};
@ -258,7 +272,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
XrmDatabase database;
if (!file.IsEmpty())
{
char buffer[500];
wxChar buffer[500];
// Is this right? Trying to get it to look in the user's
// home directory instead of current directory -- JACS
(void)GetIniFile(buffer, file);
@ -271,8 +285,8 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
}
else
{
database = XrmGetFileDatabase(buffer);
wxLogTrace(wxTraceResAlloc, "Get: Number = %d", wxTheResourceCache->Number());
database = XrmGetFileDatabase(wxConv_file.cWX2MB(buffer));
wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
} else
@ -281,9 +295,9 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value,
XrmValue xvalue;
char *str_type[20];
char buf[150];
strcpy(buf, section);
strcpy(buf, section.mb_str());
strcat(buf, ".");
strcat(buf, entry);
strcat(buf, entry.mb_str());
bool success = XrmGetResource(database, buf, "*", str_type, &xvalue);
// Try different combinations of upper/lower case, just in case...

View File

@ -1434,7 +1434,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
wxASSERT_MSG( m_isWindow, "Init() must have been called before!" );
wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") );
PreCreation( parent, id, pos, size, style, name );
@ -1641,7 +1641,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
wxASSERT_MSG( (!m_needParent) || (parent), "Need complete parent." );
wxASSERT_MSG( (!m_needParent) || (parent), _T("Need complete parent.") );
m_widget = (GtkWidget*) NULL;
m_wxwindow = (GtkWidget*) NULL;
@ -1727,7 +1727,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
void wxWindow::PostCreation()
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
if (m_wxwindow)
{
@ -1797,7 +1797,7 @@ bool wxWindow::HasVMT()
bool wxWindow::Close( bool force )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
event.SetEventObject(this);
@ -1810,7 +1810,7 @@ bool wxWindow::Close( bool force )
bool wxWindow::Destroy()
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
m_hasVMT = FALSE;
delete this;
@ -1839,8 +1839,8 @@ void wxWindow::PrepareDC( wxDC &WXUNUSED(dc) )
void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" );
wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
@ -1922,7 +1922,7 @@ void wxWindow::OnInternalIdle()
void wxWindow::GetSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (width) (*width) = m_width;
if (height) (*height) = m_height;
@ -1930,7 +1930,7 @@ void wxWindow::GetSize( int *width, int *height ) const
void wxWindow::DoSetClientSize( int width, int height )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_wxwindow)
{
@ -1995,7 +1995,7 @@ void wxWindow::DoSetClientSize( int width, int height )
void wxWindow::GetClientSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (!m_wxwindow)
{
@ -2061,7 +2061,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
void wxWindow::GetPosition( int *x, int *y ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (x) (*x) = m_x;
if (y) (*y) = m_y;
@ -2069,7 +2069,7 @@ void wxWindow::GetPosition( int *x, int *y ) const
void wxWindow::ClientToScreen( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
@ -2096,7 +2096,7 @@ void wxWindow::ClientToScreen( int *x, int *y )
void wxWindow::ScreenToClient( int *x, int *y )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GdkWindow *source = (GdkWindow *) NULL;
if (m_wxwindow)
@ -2123,7 +2123,7 @@ void wxWindow::ScreenToClient( int *x, int *y )
void wxWindow::Centre( int direction )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
int x = m_x;
int y = m_y;
@ -2147,7 +2147,7 @@ void wxWindow::Centre( int direction )
void wxWindow::Fit()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
int maxX = 0;
int maxY = 0;
@ -2169,7 +2169,7 @@ void wxWindow::Fit()
void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
m_minWidth = minW;
m_minHeight = minH;
@ -2184,7 +2184,7 @@ void wxWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
bool wxWindow::Show( bool show )
{
wxCHECK_MSG( (m_widget != NULL), FALSE, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
if (show == m_isShown) return TRUE;
@ -2200,7 +2200,7 @@ bool wxWindow::Show( bool show )
void wxWindow::Enable( bool enable )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
m_isEnabled = enable;
@ -2210,9 +2210,9 @@ void wxWindow::Enable( bool enable )
int wxWindow::GetCharHeight() const
{
wxCHECK_MSG( (m_widget != NULL), 12, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") );
wxCHECK_MSG( m_font.Ok(), 12, "invalid font" );
wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
@ -2221,9 +2221,9 @@ int wxWindow::GetCharHeight() const
int wxWindow::GetCharWidth() const
{
wxCHECK_MSG( (m_widget != NULL), 8, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") );
wxCHECK_MSG( m_font.Ok(), 8, "invalid font" );
wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
@ -2236,10 +2236,10 @@ void wxWindow::GetTextExtent( const wxString& string, int *x, int *y,
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
wxCHECK_RET( fontToUse.Ok(), "invalid font" );
wxCHECK_RET( fontToUse.Ok(), _T("invalid font") );
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string );
if (x) (*x) = gdk_string_width( font, string.mbc_str() );
if (y) (*y) = font->ascent + font->descent;
if (descent) (*descent) = font->descent;
if (externalLeading) (*externalLeading) = 0; // ??
@ -2275,7 +2275,7 @@ void wxWindow::OnKeyDown( wxKeyEvent &event )
void wxWindow::SetFocus()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
@ -2306,15 +2306,15 @@ bool wxWindow::AcceptsFocus() const
void wxWindow::AddChild( wxWindow *child )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (child != NULL), "invalid child" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
wxCHECK_RET( (child != NULL), _T("invalid child") );
m_children.Append( child );
}
wxWindow *wxWindow::ReParent( wxWindow *newParent )
{
wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, "invalid window" );
wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, _T("invalid window") );
wxWindow *oldParent = GetParent();
@ -2349,14 +2349,14 @@ int wxWindow::GetReturnCode()
void wxWindow::Raise()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (m_widget) gdk_window_raise( m_widget->window );
}
void wxWindow::Lower()
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (m_widget) gdk_window_lower( m_widget->window );
}
@ -2447,7 +2447,7 @@ wxWindowID wxWindow::GetId() const
void wxWindow::SetCursor( const wxCursor &cursor )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (cursor.Ok())
{
@ -2473,7 +2473,7 @@ void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
if (eraseBackground && m_wxwindow && m_wxwindow->window)
{
@ -2538,7 +2538,7 @@ bool wxWindow::IsExposed( const wxRect& rect ) const
void wxWindow::Clear()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_wxwindow && m_wxwindow->window)
{
@ -2576,9 +2576,9 @@ void wxWindow::SetToolTip( wxToolTip *tip )
m_toolTip->Apply( this );
}
void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip )
{
gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConv_current->cWX2MB(tip), (gchar*) NULL );
}
#endif // wxUSE_TOOLTIPS
@ -2589,7 +2589,7 @@ wxColour wxWindow::GetBackgroundColour() const
void wxWindow::SetBackgroundColour( const wxColour &colour )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_backgroundColour == colour) return;
@ -2629,7 +2629,7 @@ wxColour wxWindow::GetForegroundColour() const
void wxWindow::SetForegroundColour( const wxColour &colour )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_foregroundColour == colour) return;
@ -2697,7 +2697,7 @@ void wxWindow::ApplyWidgetStyle()
bool wxWindow::Validate()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2714,7 +2714,7 @@ bool wxWindow::Validate()
bool wxWindow::TransferDataToWindow()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2733,7 +2733,7 @@ bool wxWindow::TransferDataToWindow()
bool wxWindow::TransferDataFromWindow()
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxNode *node = m_children.First();
while (node)
@ -2760,7 +2760,7 @@ void wxWindow::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) )
void wxWindow::InitDialog()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxInitDialogEvent event(GetId());
event.SetEventObject( this );
@ -2794,9 +2794,9 @@ static void pop_pos_callback( GtkMenu *menu, gint *x, gint *y, wxWindow *win )
bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
{
wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" );
wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
wxCHECK_MSG( menu != NULL, FALSE, "invalid popup-menu" );
wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") );
SetInvokingWindow( menu, this );
@ -2821,7 +2821,7 @@ bool wxWindow::PopupMenu( wxMenu *menu, int x, int y )
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
GtkWidget *dnd_widget = GetConnectWidget();
@ -2856,7 +2856,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
void wxWindow::SetFont( const wxFont &font )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
if (m_font == font) return;
@ -2892,9 +2892,9 @@ long wxWindow::GetWindowStyleFlag() const
void wxWindow::CaptureMouse()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( g_capturing == FALSE, "CaptureMouse called twice" );
wxCHECK_RET( g_capturing == FALSE, _T("CaptureMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
@ -2911,9 +2911,9 @@ void wxWindow::CaptureMouse()
void wxWindow::ReleaseMouse()
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( g_capturing == TRUE, "ReleaseMouse called twice" );
wxCHECK_RET( g_capturing == TRUE, _T("ReleaseMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
@ -2986,9 +2986,9 @@ wxWindow *wxWindow::FindWindow( const wxString& name )
void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
m_hasScrolling = TRUE;
@ -3054,9 +3054,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
{
@ -3093,9 +3093,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
int wxWindow::GetScrollThumb( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->page_size+0.5);
@ -3105,9 +3105,9 @@ int wxWindow::GetScrollThumb( int orient ) const
int wxWindow::GetScrollPos( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->value+0.5);
@ -3117,9 +3117,9 @@ int wxWindow::GetScrollPos( int orient ) const
int wxWindow::GetScrollRange( int orient ) const
{
wxCHECK_MSG( m_widget != NULL, 0, "invalid window" );
wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" );
wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->upper+0.5);
@ -3129,9 +3129,9 @@ int wxWindow::GetScrollRange( int orient ) const
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
wxCHECK_RET( m_widget != NULL, "invalid window" );
wxCHECK_RET( m_widget != NULL, _T("invalid window") );
wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" );
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
wxNode *node = m_children.First();
while (node)
@ -3482,21 +3482,21 @@ void wxWindow::SetConstraintSizes(bool recurse)
}
else if (constr)
{
char *windowClass = this->GetClassInfo()->GetClassName();
wxChar *windowClass = this->GetClassInfo()->GetClassName();
wxString winName;
if (GetName() == "")
winName = "unnamed";
if (GetName() == _T(""))
winName = _T("unnamed");
else
winName = GetName();
wxLogDebug( "Constraint(s) not satisfied for window of type %s, name %s:\n",
(const char *)windowClass,
(const char *)winName);
if (!constr->left.GetDone()) wxLogDebug( " unsatisfied 'left' constraint.\n" );
if (!constr->right.GetDone()) wxLogDebug( " unsatisfied 'right' constraint.\n" );
if (!constr->width.GetDone()) wxLogDebug( " unsatisfied 'width' constraint.\n" );
if (!constr->height.GetDone()) wxLogDebug( " unsatisfied 'height' constraint.\n" );
wxLogDebug( "Please check constraints: try adding AsIs() constraints.\n" );
wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"),
(const wxChar *)windowClass,
(const wxChar *)winName);
if (!constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") );
if (!constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") );
if (!constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") );
if (!constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") );
wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") );
}
if (recurse)