Author Topic: wxscintilla & unicode  (Read 8559 times)

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
wxscintilla & unicode
« on: August 22, 2005, 09:25:13 am »
I'm compiling VERSION_1_0 on windows using Makefile.wx2.6 (just appended u suffix to wx libs and msw dir).  It errors out when linking the new wxscintilla code.  Can't find an ansi (const char*) version of a wxStringBase method in the wx dll (since it is compiled to use unicode strings).  Not sure why this is happening, because wxscintilla seems to be able to handle unicode builds (going by the
#if wxUSE_UNICODE
#include "UniConversion.h"
in sdk/wxscintilla/src/PlatWX.cpp)

Screens:



Ideas?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: wxscintilla & unicode
« Reply #1 on: August 22, 2005, 09:29:22 am »
I haven't built the unicode system here (wx/codeblocks) yet, so I can't help much for now...
Maybe one of the other devs can?

Yiannis.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: wxscintilla & unicode
« Reply #2 on: August 22, 2005, 10:08:10 am »
Are you using the correct wx/setup.h (that is, one that #defines wxUSE_UNICODE to 1)?

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #3 on: August 22, 2005, 11:12:13 am »
Wow, that's horrible.  Thanks for the tip Urxae.  Looks like wxWidgets defines wxUSE_UNICODE to 0 by default even when built as a unicode dll (citing windows9x compatibility).  Recompiling now, but so far so good.

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #4 on: August 22, 2005, 12:40:20 pm »
Another problem now.  Looks like a unicode conversion issue.  startherepage.cpp has:

Code: [Select]
        wxString buf;
        ...
        wxInputStream* is = f->GetStream();
    char tmp[1024] = {};
    while (!is->Eof() && is->CanRead())
    {
    memset(tmp, 0, sizeof(tmp));
    is->Read(tmp, sizeof(tmp) - 1);
    buf << tmp;
    }

The error below.  I don't know the proper way to convert the (char*) tmp buffer to wxString.  Any unicode conversion devs know?  (Or is the code really ok as is -- some other compilation problem?)



Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: wxscintilla & unicode
« Reply #5 on: August 22, 2005, 12:54:58 pm »
Yeah, I did that. I 'm not fully aware of the new unicode conventions for the project (I was away) so another dev will correct this hopefully.
In the meantime you can comment this block of code out so that compilation goes on. You 'll only notice something strange in the "Start here" page :P

Yiannis.
Be patient!
This bug will be fixed soon...

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #6 on: August 22, 2005, 01:09:12 pm »
I did:
Code: [Select]
    buf << wxConvCurrent->cMB2WC(tmp);

Someone let me know if that's wrong (compiles ok).

Is the makefile working for the wxDockit compile:
Code: [Select]
Compiling resources...
mingw32-make: *** No rule to make target `..\wxDockit\lib\libwxdockit.a', needed
 by `devel/codeblocks.exe'.  Stop.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: wxscintilla & unicode
« Reply #7 on: August 22, 2005, 03:08:24 pm »
i also did a unicode build first, to see if everything works as expected,
and corrected it this way :

\src\src\startherepage.cpp:77
Code: [Select]
            buf << _U((const char*)tmp);
and updated in cvs last night nearly midnight UTC (to version 1.4.2.3)
so it should be available for all of you to update from cvs.

a diff can be found here:
http://cvs.sourceforge.net/viewcvs.py/codeblocks/codeblocks/src/src/startherepage.cpp?r1=1.4.2.2&r2=1.4.2.3

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #8 on: August 22, 2005, 03:28:23 pm »
Perfect thx.  You have no idea how many casts I tried :)

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #9 on: August 22, 2005, 03:59:01 pm »
It builds now.  Running it looks ok except maybe the resources are odd (compile, rebuild buttons):



Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: wxscintilla & unicode
« Reply #10 on: August 22, 2005, 04:26:14 pm »
in my build even the buttons are displayed correctly,
there must be some (?) difference  :lol: between our builds.

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #11 on: August 22, 2005, 04:34:06 pm »
nevermind.  it was a max path lengths problem.  don't run update.bat from the desktop...
I changed to c:\codeblocks and resources zip fine.

crashes on exit and hovering over debug toolbar (step into, step over, stop debug, etc).  maybe a tooltip bug.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: wxscintilla & unicode
« Reply #12 on: August 22, 2005, 05:14:45 pm »
...
crashes on exit and hovering over debug toolbar...
yeah, there are still a few bugs left  8)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: wxscintilla & unicode
« Reply #13 on: August 22, 2005, 05:57:44 pm »
nevermind.  it was a max path lengths problem.  don't run update.bat from the desktop...
I changed to c:\codeblocks and resources zip fine.

crashes on exit and hovering over debug toolbar (step into, step over, stop debug, etc).  maybe a tooltip bug.


This crash is a wx2.6 bug which is addressed by patching wxWidgets. Go to www.wxwidgets.org and download the patch for wxMSW-2.6.1...

Yiannis.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: wxscintilla & unicode
« Reply #14 on: August 22, 2005, 06:36:54 pm »
I wish the wxwidgets guys would release wxMSW2.6.1-1 or something... having to patch the distros is awfully annoying.

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: wxscintilla & unicode
« Reply #15 on: August 22, 2005, 09:30:41 pm »
Got a question: in the codeblocks.RPT stack trace I get:
0040138A  C:\codeblocks\src\devel\codeblocks.exe:0040138A  WinMain  C:/codeblocks/src/src/app.cpp:297

but there is no WinMain @ 297, it's in the middle of a function:
Code: [Select]
    if(m_ClearConf)
    {
        ClearConf();
        return false;
    }                                     // line 297
    ShowSplashScreen();

and the splash screen has already shown...

is this due to the BEGIN_EVENT_TABLE(CodeBlocksApp, wxApp) macros..  they throw line #s off?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: wxscintilla & unicode
« Reply #16 on: August 22, 2005, 09:35:34 pm »
is this due to the BEGIN_EVENT_TABLE(CodeBlocksApp, wxApp) macros..  they throw line #s off?

Welcome to macros hell...
That's one of the main reasons macros are evil. They bite and they bite hard  :?

Yiannis.
Be patient!
This bug will be fixed soon...