Jucer - Code generation BUG


#1

Hi all!
I’m completely new to JUCE and quite new in C/C++ too, so please excuse my lack of knowledge of either of these.
I succeeded in compiling Juce, Jucer, and demo apps (to my surprise) without any problems. I just found few BUGs in Jucer that I’m not able (yet) to fix myself.
When I create new custom component and add “New text” with some native letters (ľščťžýžáíúäô) the Code Preview shows everything fine. But as I save it the code breaks. The last line of code shows:

....
g.setFont(Font(15.0000f, Font::Plain));
g.drawText("Some english text ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

and the code is unfinished. (no parenthesis or anything).

And one other BUG (but this might be my fault, but i’d rather report it):
When I create New Button (instead of component) and want to add (in the “normal” tab) new element like New Rectangle New Ellipse or anything, the Jucer crashes and when I say I want to debug the debugger takes me into juice_application.cpp

void JUCEApplication:unhandledException( ...)
{
   jassertfalse
}

(I wasn’t able to find definition of jassertfalse but i don’t think that is the problem anyways)

But apart from this the JUCE and JUCER look awesome! I was like stoned when I first saw it ! I can’t believe that one man was able to do this MOUNTAIN of work! Amazing job!

Yours,
Yanco.


#2

Hi there, welcome, and thanks for the bug hunting

I guess it needs to use escape codes to represent the extended characters in a string, as the files are saved as ascii rather than unicode (it used to use unicode but that caused problems with some compilers). Try fixing this bit of jucer_UtilityFunctions.cpp, line 69:

[code] default:
if (c < 128)
r << c;
else
r << T("\x") << String::toHexString ((int) c);

        break;

[/code]

…the other bug’s a really dumb mistake I made in the last version, but the fix is quite messy - I’ll post a new version soon, or you could use the jucer that’s in the previous version of juce in the meantime.


#3

Thanks a lot for the quick fix, it worked perfectly!
As for the second bug, I’m in no hurry for a fix since I am only learning the basics…
Thanks.
Y.


#4

I found one similiar bug (well it is more of a cosmetic stain rather then a bug). When I assign a text to a component in Jucer (say a TextButton) that is a Localised string it shows correctly. But when I copy this TextButon (copy -> paste) the localized charaters are not displayed correctly…
I guess it’ll be similar problem to the one I decribed before, and I suppose the solution as well…
Y.


#5