WRONG: XRCCTRL(*this, _T("lblLabel"), wxStaticText)->SetLabel(label);
RIGHT: XRCCTRL(*this, "lblLabel", wxStaticText)->SetLabel(label);
WRONG: wxXmlResource::Get()->LoadDialog(this, parent, _("dlgGenericMultiSelect"));dlgGenericMultiSelect is a reference to a resource. Therefore it must use _T instead.
RIGHT: wxXmlResource::Get()->LoadDialog(this, parent, _T("dlgGenericMultiSelect"));
'c'
char
... get Code::Blocks branch VERSION_1_0 to work with unicode
And don't forget to test for single characters, too!
char
wxChar
You should TAG the current VERSION_1_0 branch in cvs before committing any unicode updates.
Oh yes, I searched the source code ant it appears there are no "char" types defined in the project, all are wxChar's (that's a good thing :) ).
tmpkey.Printf(_T("%s/editor/keywords/%d"), key.c_str(), i);
Hi Code::Blocks developers!You are welcome to help of course, I think that Rick is updating the cvs constanly, so you can test it whenever you want ;) and submit patches by e-mail to Rick.
I'm using a Unicode build of wx 2.6.x on top of FreeBSD on my machine, and I'm looking forward to trying to get C::B running on it. When do you think I can expect the Unicode fixes discussed in this topic to hit CVS? I'm eager to check out and start testing C::B and maybe help out if there's lot of Unicode fixes left to be made. I've developed Unicode enabled wx applications before, and know about the issues involved. Just finished a non-programming project at work, and as a result I have some free summer time that I'd be glad to spend on getting a promising IDE running on my favourite OS. Any of the groups described by Rick still not assigned to anyone?
Best regards,
Aron Stansvik
Edit: Oh right. You don't happen to have an IRC channel somewhere?
This table was removed. Updated version a few posts below.
Table removed by Rick. See updated table a few posts below
I'm working on group 14. Who wants group 15?If you dont need it to be done like in 3 hours from now (Id probably be done for tomorrow), then Im in.
One question - if wxStrring is used as a param inside printf-like function should it be converted using c_str() or mb_str() ?
Example:Codetmpkey.Printf(_T("%s/editor/keywords/%d"), key.c_str(), i);
// indent code accordingly
wxString code = it->second;
code.Replace("\n", '\n' + lineIndent);
wxString::Replace
size_t Replace(const char* szOld, const char* szNew, bool replaceAll = true)
Replace first (or all) occurrences of substring with another one.
replaceAll: global replace (default), or only the first occurrence.
Returns the number of replacements made.
Stan: Take the sources from the CVS snapshot. There were 2 or 3 bugs fixed after RC1-1.
what to do here ?Code// indent code accordingly
wxString code = it->second;
code.Replace("\n", '\n' + lineIndent);
from the docs:QuotewxString::Replace
size_t Replace(const char* szOld, const char* szNew, bool replaceAll = true)
Replace first (or all) occurrences of substring with another one.
replaceAll: global replace (default), or only the first occurrence.
Returns the number of replacements made.
wxString::Replace() seems to be not fit for unicode ? or what ?
size_t Replace(const wxChar *szOld,
const wxChar *szNew,
bool bReplaceAll = true);
// indent code accordingly
wxString code = it->second;
code.Replace(_T("\n"), _T('\n') + lineIndent);
Uh oh... I just noticed from the docs.
wxString& operator <<(const wxString& str)
wxString& operator <<(const char* psz)
wxString& operator <<(char ch)
Apparently the << 's can be used with either normal strings or wxstrings, but not with wxChar's. UGH i have to change one or two sources back... :-/
// string += C string
wxString& operator<<(const wxChar *psz)
{ append(psz); return *this; }
// string += char
Uh oh... I just noticed from the docs.
wxString& operator <<(const wxString& str)
wxString& operator <<(const char* psz)
wxString& operator <<(char ch)
Apparently the << 's can be used with either normal strings or wxstrings, but not with wxChar's. UGH i have to change one or two sources back... :-/
// string += C string
wxString& operator<<(const wxChar *psz)
{ append(psz); return *this; }
// string += char
wxString& operator<<(wxChar ch) { append(1, ch); return *this; }
what to do here ?Code// indent code accordingly
wxString code = it->second;
code.Replace("\n", '\n' + lineIndent);
from the docs:QuotewxString::Replace
size_t Replace(const char* szOld, const char* szNew, bool replaceAll = true)
Replace first (or all) occurrences of substring with another one.
replaceAll: global replace (default), or only the first occurrence.
Returns the number of replacements made.
wxString::Replace() seems to be not fit for unicode ? or what ?
wxWidgets documentation about wxString class seems to be outdated - in header files there's such declaration:Codesize_t Replace(const wxChar *szOld,
const wxChar *szNew,
bool bReplaceAll = true);
I would change the code to:Code// indent code accordingly
wxString code = it->second;
code.Replace(_T("\n"), _T('\n') + lineIndent);
_("string 1" "string2" ... )
_T("string1") _T("string2") ...
btw
i really don't like the fact, that we can't rely on the wx.chm docs
that's a lot of additional work to study the header's all the time
somewhat boring ... but what can we do else ?
#ifdef wxUSE_UNICODE
formattedText << wxString(formatter.nextLine().c_str(), wxConvLocal);
#else
formattedText << formatter.nextLine().c_str();
#endif
thats what i've already done ... thanks byo ... i really got unsure for a moment ... :shock:
Code#ifdef wxUSE_UNICODE
formattedText << wxString(formatter.nextLine().c_str(), wxConvLocal);
#else
formattedText << formatter.nextLine().c_str();
#endif
#if wxUSE_UNICODE
// from multibyte string
wxString(const char *psz, wxMBConv& conv, size_t nLength = npos);
wxString(const wxChar *psz, wxMBConv& WXUNUSED(conv), size_t nLength = npos)
: wxStringBase(psz, nLength == npos ? wxStrlen(psz) : nLength) { }
~ code is tested Logically.
:? What is that supposed to mean?
...
Um... man i think tiwag's got the most difficult part!
(i detected one or two possible flaws)
But I have a doubt. Tiwag, have you tried importing MSVC projects and Dev-Cpp projects with the modified files?
just now my wife is worried about my spare-time schedule :shock: - i have to help her a few things now :DYes always listen to your wife :lol: (ehm. well I think, I don't have a wife, not even a girl friend. :( yet :lol:)
just now my wife is worried about my spare-time schedule :shock: - i have to help her a few things now :DYes always listen to your wife :lol: (ehm. well I think, I don't have a wife, not even a girl friend. :( yet :lol:)
////////////////////////////////////////
/// byo
group 15
o replacedlg.cpp
o replacedlg.h
o sanitycheck.h
o sdk_events.cpp
o sdk_events.h
o searchresultslog.cpp
o searchresultslog.h
o selecttargetdlg.cpp
o selecttargetdlg.h
o settings.h
o simplelistlog.cpp
o simplelistlog.h
o simpletextlog.cpp
o simpletextlog.h
I try to compile changed sources in both Unicode and NonUnicode versions of wxWidgets (and after that in wx2.4 and wx2.6 to make sure it will work everywhere). Unfortunately all project can't be compiled in Unicode but separate files can :)
what unicode library have you built ? which OS are you using ?
currently i work only in Windows,
i thought about to build a "wxMSW-2.4.2-monolithic-unicode-DLL-debug" library
for testing the CodeBlocks VERSION_1_0_UNICODE .
i would like to discuss with you how to setup the best debug-environment for our new "baby"
in the future i would like to test also in Linux,
just now i have set up an Ubunto Hoary in a VM-ware box
it runs but i'm far away from compiling and testing something...
so testing in Linuxs means "mid-term future" for me
maybe starting in October 05 ... we'll see
#ifdef wxUSE_UNICODE
#define _U(x) wxString((x),wxConvUTF8)
#define _UU(x,y) wxString((x),y)
#else
#define _U(x) (x)
#define _UU(x,y) (x)
#endif
const char* incompatible = "This is an incompatible string";
wxString compatible = _U(incompatible);
// wxString conftype = conf->Attribute("ConfigurationType"); // before
wxString conftype = _U(conf->Attribute("ConfigurationType")); // after :)
Code#ifdef wxUSE_UNICODE
#define _U(x) wxString((x),wxConvUTF8)
#define _UU(x,y) wxString((x),y)
#else
#define _U(x) (x)
#define _UU(x,y) (x)
#endif
it will be easily merged in the latest CVS-HEAD branch? Or all of this work will have to be rewritten??
I'm hoping that CVS-merge is smart :D
CVS is smart - at least when the same lines of code haven't already been changed in HEAD too - then it asks for user intervention to solve the conflict.
CVS is smart - at least when the same lines of code haven't already been changed in HEAD too - then it asks for user intervention to solve the conflict.
Yeah, like making you edit manually all the lines in question :lol:
My proposed solution is this:
Branch: HEAD
--------------------------------------------------------- HEAD
|
|
| Branch: VERSION_1_0
| ------ SNAPSHOT ------------------- UNICODE
I had added a SNAPSHOT_DDDDDD tag (and CVS better had not messed with it! :shock: ) for all the changes beforethe UNICODE conversion. All those files have a specific version.
The CVS HEAD branch hasn't seen much changes recently, anyway - so they probably have exactly the same version number than those branhced (with one or two exceptions maybe).
If they have the same version, copy the respective file from the latest VERSION_1_0 to HEAD.
Ta-da! :D
Or does CVS do this already? :?
... Today can be the day that Code::Blocks will see the (Unicode) light! :Dyou are a visionary !
Rick says:
i send you the zip
tiwag says:
its OK, thanks
Sie haben "H:\Dokumente und Einstellungen\Tiwag\Eigene Dateien\MSN_Messenger\Inbox\compilergcc_unicode.zip"
von Rick erfolgreich erhalten.
tiwag says:
now i'll try to compile
- just a few moments ...
tiwag says:
Project : CodeBlocks VERSION_1_0 unicode, wx242
Compiler : GNU GCC Compiler (called directly)
Directory : D:\cpp\_projects\Codeblocks\_VERSION_1_0_UNICODE_COMPILED\src\
--------------------------------------------------------------------------------
Switching to target: plugin_CompilerGCC
mingw32-g++.exe -Wall -g -ggdb -pipe -mthreads -fno-pcc-struct-
...-o devel\share\CodeBlocks\plugins\compilergcc.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -lcodeblocks -lstc -lwxxrc -lwxmsw242u
Process terminated with status 0 (0 minutes, 51 seconds)
0 errors, 1 warnings
well done my friend !!
Rick says:
Rick says:
oh no!
Rick says:
There's 1 warning!
Rick says:
Rick says:
(lol )
Rick says:
tiwag says:
nobody is perfect, not even YOU
Rick says:
hmmmm
Rick says:
"In soviet Russia, the system compiles YOU!"
Rick says:
nevermind
tiwag says:
tiwag sendet:
Die Übertragung von "first_text_from_CBu.txt" wurde ausgeführt.
Rick says:
d with CodeB
Rick says:
was it supposed to end in "CodeB" ?
Rick says:
hello rickg !
this text i've just now edited with CodeB
tiwag says:
congratulations - you found the first bug !
Rick says:
tiwag says:
hey
tiwag says:
thats a big step for mankind !!
Rick says:
oh well
Rick says:
anyway
Rick says:
i think i know *WHO* is at fault with this
tiwag says:
not even a crash when fired the first time !
Rick says:
cbeditor saves with non-unicode strings, right?
tiwag says:
thats really a good message iwould say, the rest will be also doable, i'm sure (not peanuts, but doable)
Rick says:
anyway
tiwag says:
NONONONONONO !!
Rick says:
try to load the file you've just saved
Rick says:
uh?
tiwag says:
it saved in UNICODE, the file i've sent you is in UNICODE and was saved by CBu (== CodeBlocksunicode)
Rick says:
oh - in UNICODE
Rick says:
I opened it in notepad
tiwag says:
look with a hexeditor - i did that, because i trust NOBODY
Rick says:
wait a minute
Rick says:
there should be an option to save files as UTF-8 or something, right?
Rick says:
anyway
Rick says:
if you also open it with codeblocks, does it display well?
tiwag says:
YES YES YES YES
tiwag says:
i cant believe it ! its OKOKOK
Rick says:
....h.e.l.l.o. .
r.i.c.k.g. .!...
......t.h.i.s. .
t.e.x.t. .i.'.v.
e. .j.u.s.t. .n.
o.w. .e.d.i.t.e.
d. .w.i.t.h. .C.
o.d.e.B.........
Rick says:
does the line end in "CodeB" ?
tiwag says:
that is bug no 0000000001
Rick says:
wait
Rick says:
i got it!
tiwag says:
what
Rick says:
If the file is unicode when opened, save as unicode
Rick says:
otherwise, save as normal
tiwag says:
ok agree
tiwag says:
but this are features !!! let them for CVS HEAD,
our job is to build a pure UNICODE version now
Rick says:
OH
Rick says:
ok i still have to modify the codecompletion
tiwag says:
i go to announce the message in the forums -
what's your opinion ?
tiwag says:
on
"CodeBlocks_VERSION_1_0_UNICODE has seen the light! "
Rick says:
no
Rick says:
not until we have codecompletion codecompleted
tiwag says:
codecompletion will not work anyway - believe me
Rick says:
yeah but...
Rick says:
it's better not having to have another stage of modifications
tiwag says:
i dont understand you - i only wanted to post in the forum, that we have compiled and run CBu without crash the first time !
thats all
Rick says:
ok ok...
Rick says:
Just say "I could compile code::blocks in Unicode!"
Almost CONGRATS! :o
(almost until codecompletion is finished)
About the File Unicode thing, C::B must save (by default) the files in ASCII mode (with options to save in UTF-8, UTF-16LE/BE as notepad haves).
Because most if not all compilers doesn't support unicode, only old plain ASCII.
And when saving text to a file in Unicode don't forget to put the BOM (Byte Order Mark) so all text editors know that is a file encoded in Unicode.
http://www.websina.com/bugzero/kb/unicode-bom.html
Of course when reading a file also take care of the BOM.
When reading any text file:
wxString file; // a file loaded entirely in a string
#ifdef UNICODE
if(file[0] == 0xEF && file[1] == 0xBB && file[2] == 0xBF)
// it's in UTF-8, wxMBConvert-it
else if(file[0] == 0xFE && file[1] == 0xFF)
// it's in UTF-16BE, wxMBConvert-it
else if(file[0] == 0xFF && file[1] == 0xFE)
// it's in UTF-16LE, wxMBConvert-it
else
// it's in ASCII, wxMBConvert-it
#else
if(file[0] == 0xEFBB)
// it's in UTF-8, wxMBConvert-it
else if(file[0] == 0xFEFF)
// it's in UTF-16BE, wxMBConvert-it
else if(file[0] == 0xFFFE)
// it's in UTF-16LE, wxMBConvert-it
else
// it's in ASCII, do nothing
#endif
...Any type of testing in linux is appreciated!
Of course! Only if any linux distro would work on this motherboard (on this chipset)...
...
My motherboard's chipset doesn't work in any distro.Why not trying some low-height distros in VMWare. I actually have a crappier system than yours, with only 256 Mb RAM, and Ive succesfully ran SuSe 8.0 and Redhat 9.0 inside it with no hassle.
So my only solutions are VMWare (too slow for me) or coLinux (I tried several times but failed to got it working ok).
byo: You're welcome to send patches! :)
? patch
? src/.deps
? src/.objs
Index: src/sdk/projectloader.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/projectloader.h,v
retrieving revision 1.5.2.2
diff -r1.5.2.2 projectloader.h
41c41
< bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = "option");
---
> bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = _T("option"));
45c45
< void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = "option", const wxString& extra = "");
---
> void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = _T("option"), const wxString& extra = _T(""));
i think that for const wxString& you have to use wxEmptyString instead...
Ah well. Nevermind, keep hunting those uninitialized variables!
(Should we recompile with -Wall and -pedantic or someting?)
? patch
? src/.deps
? src/.objs
Index: src/plugins/compilergcc/makefilegenerator.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/compilergcc/makefilegenerator.h,v
retrieving revision 1.12.2.3
diff -r1.12.2.3 makefilegenerator.h
39,41c39,41
< void DoAppendIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-I", bool useGlobalOptions = false);
< void DoAppendResourceIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-I", bool useGlobalOptions = false);
< void DoAppendLibDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-L", bool useGlobalOptions = false);
---
> void DoAppendIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-I"), bool useGlobalOptions = false);
> void DoAppendResourceIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-I"), bool useGlobalOptions = false);
> void DoAppendLibDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-L"), bool useGlobalOptions = false);
Index: src/plugins/pluginwizard/pluginwizarddlg.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/pluginwizard/pluginwizarddlg.h,v
retrieving revision 1.3
diff -r1.3 pluginwizarddlg.h
22c22
< void DoAddHeaderOption(wxString& buffer, bool has, const wxString& retVal = " -1");
---
> void DoAddHeaderOption(wxString& buffer, bool has, const wxString& retVal = _T(" -1"));
Index: src/sdk/projectloader.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/projectloader.h,v
retrieving revision 1.5.2.2
diff -r1.5.2.2 projectloader.h
41c41
< bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = "option");
---
> bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = _T("option"));
45c45
< void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = "option", const wxString& extra = "");
---
> void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = _T("option"), const wxString& extra = _T(""));
As a newbie in cvs :oops: I must ask:
cvs diff
does this produce usable patches ?
cvs diff -u
useCodefor your patches in unified formatcvs diff -u
cd <WXWIN>\build\msw
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb
cd ..\..\contrib\build\stc
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb
Index: src/Makefile.unix
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/Makefile.unix,v
retrieving revision 1.21.2.1
diff -u -r1.21.2.1 Makefile.unix
--- src/Makefile.unix 25 Jul 2005 19:05:21 -0000 1.21.2.1
+++ src/Makefile.unix 13 Aug 2005 19:13:38 -0000
@@ -7,8 +7,10 @@
# Compiler used: GNU GCC Compiler
### Variables used in this Makefile
-LIB_WXXRC=wx_gtk2_xrc-2.4
-LIB_WXSTC=wx_gtk2_stc-2.4
+#LIB_WXXRC=wx_gtk2_xrc-2.4
+#LIB_WXSTC=wx_gtk2_stc-2.4
+LIB_WXXRC=wx_gtk2u_xrc-2.4
+LIB_WXSTC=wx_gtk2u_stc-2.4
tinyXML_CC=gcc
tinyXML_CPP=g++
tinyXML_LD=g++
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/nativeparser.cpp,v
retrieving revision 1.20.2.6
diff -u -r1.20.2.6 nativeparser.cpp
--- src/plugins/codecompletion/nativeparser.cpp 7 Aug 2005 20:55:56 -0000 1.20.2.6
+++ src/plugins/codecompletion/nativeparser.cpp 13 Aug 2005 19:13:38 -0000
@@ -38,6 +38,8 @@
#include "parser/parser.h"
#include <compilerfactory.h>
+#include <cctype>
+
BEGIN_EVENT_TABLE(NativeParser, wxEvtHandler)
EVT_MENU(THREAD_START, NativeParser::OnThreadStart)
EVT_MENU(THREAD_END, NativeParser::OnThreadEnd)
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/parser/parserthread.cpp,v
retrieving revision 1.16.2.2
diff -u -r1.16.2.2 parserthread.cpp
--- src/plugins/codecompletion/parser/parserthread.cpp 7 Aug 2005 20:55:56 -0000 1.16.2.2
+++ src/plugins/codecompletion/parser/parserthread.cpp 13 Aug 2005 19:13:39 -0000
@@ -29,6 +29,8 @@
#include <wx/msgdlg.h>
#include <globals.h>
+#include <cctype>
+
int THREAD_START = wxNewId();
int THREAD_END = wxNewId();
int NEW_TOKEN = wxNewId();
Index: src/plugins/codecompletion/parser/tokenizer.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/parser/tokenizer.cpp,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 tokenizer.cpp
--- src/plugins/codecompletion/parser/tokenizer.cpp 7 Aug 2005 20:55:56 -0000 1.3.2.1
+++ src/plugins/codecompletion/parser/tokenizer.cpp 13 Aug 2005 19:13:39 -0000
@@ -28,6 +28,8 @@
#include <wx/file.h>
#include <wx/msgdlg.h>
+#include <cctype>
+
Tokenizer::Tokenizer(const wxString& filename)
: m_Filename(filename),
m_BufferLen(0),
Index: src/plugins/compilergcc/makefilegenerator.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/compilergcc/makefilegenerator.h,v
retrieving revision 1.12.2.3
diff -u -r1.12.2.3 makefilegenerator.h
--- src/plugins/compilergcc/makefilegenerator.h 22 Jul 2005 08:51:58 -0000 1.12.2.3
+++ src/plugins/compilergcc/makefilegenerator.h 13 Aug 2005 19:13:39 -0000
@@ -36,9 +36,9 @@
void DoAppendCompilerOptions(wxString& cmd, ProjectBuildTarget* target = 0L, bool useGlobalOptions = false);
void DoAppendLinkerOptions(wxString& cmd, ProjectBuildTarget* target = 0L, bool useGlobalOptions = false);
void DoAppendLinkerLibs(wxString& cmd, ProjectBuildTarget* target = 0L, bool useGlobalOptions = false);
- void DoAppendIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-I", bool useGlobalOptions = false);
- void DoAppendResourceIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-I", bool useGlobalOptions = false);
- void DoAppendLibDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = "-L", bool useGlobalOptions = false);
+ void DoAppendIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-I"), bool useGlobalOptions = false);
+ void DoAppendResourceIncludeDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-I"), bool useGlobalOptions = false);
+ void DoAppendLibDirs(wxString& cmd, ProjectBuildTarget* target = 0L, const wxString& prefix = _T("-L"), bool useGlobalOptions = false);
void DoAddVarsSet(wxString& buffer, CustomVars& vars);
void DoAddMakefileVars(wxString& buffer);
#ifdef __WXMSW__
Index: src/plugins/pluginwizard/pluginwizarddlg.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/pluginwizard/pluginwizarddlg.h,v
retrieving revision 1.3
diff -u -r1.3 pluginwizarddlg.h
--- src/plugins/pluginwizard/pluginwizarddlg.h 14 Mar 2005 09:47:04 -0000 1.3
+++ src/plugins/pluginwizard/pluginwizarddlg.h 13 Aug 2005 19:13:39 -0000
@@ -19,7 +19,7 @@
void OnOKClick(wxCommandEvent& event);
void OnNameChange(wxCommandEvent& event);
void DoGuardBlock();
- void DoAddHeaderOption(wxString& buffer, bool has, const wxString& retVal = " -1");
+ void DoAddHeaderOption(wxString& buffer, bool has, const wxString& retVal = _T(" -1"));
void DoAddHeaderTool(wxString& buffer);
void DoAddHeaderCompiler(wxString& buffer);
void DoAddHeaderDebugger(wxString& buffer);
Index: src/sdk/projectloader.h
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/projectloader.h,v
retrieving revision 1.5.2.2
diff -u -r1.5.2.2 projectloader.h
--- src/sdk/projectloader.h 6 Aug 2005 22:13:05 -0000 1.5.2.2
+++ src/sdk/projectloader.h 13 Aug 2005 19:13:39 -0000
@@ -38,11 +38,11 @@
void DoUnitOptions(TiXmlElement* parentNode, ProjectFile* file);
void BeginOptionSection(wxString& buffer, const wxString& sectionName, int nrOfTabs);
- bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = "option");
+ bool DoOptionSection(wxString& buffer, const wxArrayString& array, int nrOfTabs, const wxString& optionName = _("option"));
void EndOptionSection(wxString& buffer, const wxString& sectionName, int nrOfTabs);
// shortcut that calls BeginOptionSection(), DoOptionSection() and EndOptionSection()
- void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = "option", const wxString& extra = "");
+ void SaveOptions(wxString& buffer, const wxArrayString& array, const wxString& sectionName, int nrOfTabs, const wxString& optionName = _("option"), const wxString& extra = wxEmptyString);
private:
void SaveCompilerOptions(wxString& buffer, CompileOptionsBase* object, int nrOfTabs);
void SaveResourceCompilerOptions(wxString& buffer, CompileOptionsBase* object, int nrOfTabs);
I tried to compile VERSION_1_0 CVS in UNICODE, wx2.6 CVS, win32, MinGW, but I get lots of undefined references
Switching to target: sdk
Linking dynamic library: devel\codeblocks.dll
Creating library file: devel\libcodeblocks.a
.objs\2.6\sdk\autodetectcompilers.o(.text+0x10d): In function `ZN19AutoDetectCompilersC2EP8wxWindow':
D:/Develop/src/codeblocks-VERSION_1_0/codeblocks/src/sdk/autodetectcompilers.cpp:19: undefined reference to `_imp___ZN13wxXmlResource8GetXRCIDEPKc'
.objs\2.6\sdk\autodetectcompilers.o(.text+0x663):D:/Develop/src/codeblocks-VERSION_1_0/codeblocks/src/sdk/autodetectcompilers.cpp:49: undefined reference to `_imp___ZN13wxXmlResource8GetXRCIDEPKc'
.objs\2.6\sdk\autodetectcompilers.o(.text+0x7eb): In function `ZN19AutoDetectCompilersC1EP8wxWindow':
D:/Develop/src/codeblocks-VERSION_1_0/codeblocks/src/sdk/autodetectcompilers.cpp:19: undefined reference to `_imp___ZN13wxXmlResource8GetXRCIDEPKc'
.objs\2.6\sdk\autodetectcompilers.o(.text+0xd41):D:/Develop/src/codeblocks-VERSION_1_0/codeblocks/src/sdk/autodetectcompilers.cpp:49: undefined reference to `_imp___ZN13wxXmlResource8GetXRCIDEPKc'
...
Process terminated with status 1 (0 minutes, 22 seconds)
52 errors, 0 warnings
These errors are expected, or anyone compiled all ok with these settings?
VERSION_1_0 is wx2.6 compatible??
Index: src/sdk/cbeditor.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/sdk/cbeditor.cpp,v
retrieving revision 1.37.2.7
diff -u -r1.37.2.7 cbeditor.cpp
--- src/sdk/cbeditor.cpp 10 Aug 2005 16:56:47 -0000 1.37.2.7
+++ src/sdk/cbeditor.cpp 15 Aug 2005 05:21:13 -0000
@@ -41,6 +41,8 @@
#include "cbplugin.h"
#include "cbeditorprintout.h"
+#include <cstring> // std::strlen
+
/* This struct holds private data for the cbEditor class.
* It's a paradigm to avoid rebuilding the entire project (as cbEditor is a basic dependency)
* for just adding a private var or method.
@@ -600,13 +602,12 @@
if (!file.IsOpened())
return false;
- wxChar* buff = st.GetWriteBuf(file.Length());
+ void* buff = st.GetWriteBuf(file.Length());
file.Read(buff, file.Length());
file.Close();
- st.UngetWriteBuf();
-
- m_pControl->InsertText(0, st);
+ m_pControl->InsertText(0, _U( (char const *)buff ));
m_pControl->EmptyUndoBuffer();
+ st.UngetWriteBuf();
// mark the file read-only, if applicable
bool read_only = !wxFile::Access(m_Filename.c_str(), wxFile::write);
@@ -647,8 +648,9 @@
}
wxFile file(m_Filename, wxFile::write);
- if (file.Write(m_pControl->GetText().c_str(), m_pControl->GetTextLength()) == 0 &&
- m_pControl->GetTextLength() != 0)
+ wxWX2MBbuf utf_text = m_pControl->GetText().mb_str(wxConvUTF8);
+ size_t utf_text_length = std::strlen( utf_text );
+ if (file.Write( utf_text, utf_text_length ) == 0 && utf_text_length != 0)
{
return false; // failed; file is read-only?
}
if (line.StartsWith(_T("Project_Dep_Name"))) {
Help, unicode men have modified the parsing of MSVC :lol:
For example this line:Codeif (line.StartsWith(_T("Project_Dep_Name"))) {
Does _T means that we do nothing to the string (i.e. keep a char* representation, no unicode conversion)? I'm quite lost with _X() macros, can someone sum up them?
#if wxUSE_UNICODE
#define _UU(x,y) wxString((x),(y))
#define _CC(x,y) (x).mb_str((y))
#else
#define _UU(x,y) (x)
#define _CC(x,y) (x)
#endif
#define _U(x) _UU((x),wxConvUTF8)
#define _C(x) _CC((x),wxConvUTF8)
--------------------------------------------------------------------------------
wxT
wxChar wxT(char ch)
const wxChar * wxT(const char *s)
wxT() is a macro which can be used with character and string literals (in other words, 'x' or "foo") to automatically convert them to Unicode in Unicode build configuration. Please see the Unicode overview for more information.
This macro is simply returns the value passed to it without changes in ASCII build. In fact, its definition is:
#ifdef UNICODE
#define wxT(x) L ## x
#else // !Unicode
#define wxT(x) x
#endif
--------------------------------------------------------------------------------
_
const wxChar * _(const char *s)
This macro expands into a call to wxGetTranslation function, so it marks the message for the extraction by xgettext just as wxTRANSLATE does, but also returns the translation of the string for the current locale during execution.
Don't confuse this macro with _T()!
--------------------------------------------------------------------------------
wxPLURAL
const wxChar * wxPLURAL(const char *sing, const char *plur, size_tn)
This macro is identical to _() but for the plural variant of wxGetTranslation.
--------------------------------------------------------------------------------
_T
wxChar _T(char ch)
const wxChar * _T(const wxChar ch)
This macro is exactly the same as wxT and is defined in wxWidgets simply because it may be more intuitive for Windows programmers as the standard Win32 headers also define it (as well as yet another name for the same macro which is _TEXT()).
Don't confuse this macro with _()!
--------------------------------------------------------------------------------
_()
_T()
wxT()
_U()
_C()
..char typedefed as byte or wxByte would be good.
Index: src/plugins/codecompletion/ccoptionsdlg.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/codecompletion/ccoptionsdlg.cpp,v
retrieving revision 1.7
diff -u -r1.7 ccoptionsdlg.cpp
--- src/plugins/codecompletion/ccoptionsdlg.cpp 8 Sep 2005 12:54:46 -0000 1.7
+++ src/plugins/codecompletion/ccoptionsdlg.cpp 11 Sep 2005 09:49:49 -0000
@@ -91,7 +91,7 @@
XRCCTRL(*this, "chkLocals", wxCheckBox)->SetValue(m_Parser.Options().followLocalIncludes);
XRCCTRL(*this, "chkGlobals", wxCheckBox)->SetValue(m_Parser.Options().followGlobalIncludes);
XRCCTRL(*this, "chkPreprocessor", wxCheckBox)->SetValue(m_Parser.Options().wantPreprocessor);
- XRCCTRL(*this, "chkNoCC", wxCheckBox)->SetValue(ConfigManager::Get()->Read("/code_completion/use_code_completion", 1L) == 0);
+ XRCCTRL(*this, "chkNoCC", wxCheckBox)->SetValue(ConfigManager::Get()->Read(_T("/code_completion/use_code_completion"), 1L) == 0);
XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->SetValue(!m_Parser.Options().useSmartSense);
XRCCTRL(*this, "chkCaseSensitive", wxCheckBox)->SetValue(m_Parser.Options().caseSensitive);
XRCCTRL(*this, "chkInheritance", wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().showInheritance);
@@ -162,7 +162,7 @@
m_Parser.Options().followGlobalIncludes = XRCCTRL(*this, "chkGlobals", wxCheckBox)->GetValue();
m_Parser.Options().wantPreprocessor = XRCCTRL(*this, "chkPreprocessor", wxCheckBox)->GetValue();
m_Parser.Options().caseSensitive = XRCCTRL(*this, "chkCaseSensitive", wxCheckBox)->GetValue();
- ConfigManager::Get()->Write("/code_completion/use_code_completion", !XRCCTRL(*this, "chkNoCC", wxCheckBox)->GetValue());
+ ConfigManager::Get()->Write(_T("/code_completion/use_code_completion"), !XRCCTRL(*this, "chkNoCC", wxCheckBox)->GetValue());
m_Parser.Options().useSmartSense = !XRCCTRL(*this, "chkSimpleMode", wxCheckBox)->GetValue();
m_Parser.ClassBrowserOptions().showInheritance = XRCCTRL(*this, "chkInheritance", wxCheckBox)->GetValue();
m_Parser.ClassBrowserOptions().viewFlat = XRCCTRL(*this, "cmbCBView", wxComboBox)->GetSelection() == 0;
Index: src/plugins/compilergcc/compilerMINGW.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/plugins/compilergcc/compilerMINGW.cpp,v
retrieving revision 1.32
diff -u -r1.32 compilerMINGW.cpp
--- src/plugins/compilergcc/compilerMINGW.cpp 7 Sep 2005 09:55:50 -0000 1.32
+++ src/plugins/compilergcc/compilerMINGW.cpp 11 Sep 2005 09:49:49 -0000
@@ -80,11 +80,12 @@
_T("-O -O1 -O2 -O3 -Os"),
_("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
#ifdef __WXMSW__
- #define GPROF_LINK "-pg -lgmon"
+ #define GPROF_LINK _T("-pg -lgmon")
#else
- #define GPROF_LINK "-pg"
+ #define GPROF_LINK _T("-pg")
+
#endif
- m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), _T(GPROF_LINK));
+ m_Options.AddOption(_("Profile code when executed"), _T("-pg"), _("Profiling"), GPROF_LINK);
wxString category = _("Warnings");
Index: src/src/main.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/src/main.cpp,v
retrieving revision 1.94
diff -u -r1.94 main.cpp
--- src/src/main.cpp 8 Sep 2005 07:55:20 -0000 1.94
+++ src/src/main.cpp 11 Sep 2005 09:49:50 -0000
@@ -442,7 +442,7 @@
pDockWindow1 = new wxDockWindow( this, 0, _("Management"), wxPoint( 64, 64 ), wxSize( leftW, clientsize.GetHeight() ) );
pDockWindow1->SetClient( m_pNotebook );
- pDockWindow2 = new wxDockWindow( this, 0, _("Messages"), wxPoint( 96, 96 ), wxSize( clientsize.GetWidth(), bottomH ), "d1" );
+ pDockWindow2 = new wxDockWindow( this, 0, _("Messages"), wxPoint( 96, 96 ), wxSize( clientsize.GetWidth(), bottomH ), _("d1") );
pDockWindow2->SetClient( Manager::Get()->GetMessageManager() );
// setup dockmanager