important bug

Questions about wxWidgets running on MS.NET, mono or Portable.NET ? Ask it here !
Post Reply
xml
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Oct 22, 2004 1:21 pm

important bug

Post by xml » Fri Jan 07, 2005 12:05 am

if we put a char like

frrossk
Earned a small fee
Earned a small fee
Posts: 11
Joined: Mon Dec 20, 2004 8:48 am

Re: important bug

Post by frrossk » Fri Jan 07, 2005 7:57 am

[quote="xml"]if we put a char like

xml
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Oct 22, 2004 1:21 pm

Post by xml » Fri Jan 07, 2005 11:43 am

the bug only appears when we try to access the label property of the StaticText:

L2=new wx.StaticText(Panel1, ID_L2, "

nummish
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Jan 07, 2005 6:24 pm
Contact:

Post by nummish » Fri Jan 07, 2005 6:39 pm

That seems similar to the bug I experienced regarding high ascii in the TextCtrl classes.

I wrote a simple test for it, available here.
http://www.0x90.org/~nummish/wx/TestCrash.cs

I was fiddling with the source an I think I mitigated it by passing the length of the string into the wxString constructor. But I'd changed so much at that point and have yet to retry it with the atomic changes.

Try that code with StaticText instead of a TextCtrl.. might be the problem.

iirc, it's even more of a bug in wxGTK, that won't render any of the text at all when it encounters a bad character. (As opposed to a placeholder char)

xenomorph
Earned a small fee
Earned a small fee
Posts: 18
Joined: Thu Sep 02, 2004 7:33 am
Location: Germany

Post by xenomorph » Fri Jan 07, 2005 8:15 pm

nummish wrote: iirc, it's even more of a bug in wxGTK, that won't render any of the text at all when it encounters a bad character. (As opposed to a placeholder char)
I can't reproduce this behaviour on my Debian system (TestCrash works fine, no crash at all). Every "bad" character gets displayed...

Greetings
Xenomorph 8)

xenomorph
Earned a small fee
Earned a small fee
Posts: 18
Joined: Thu Sep 02, 2004 7:33 am
Location: Germany

Re: important bug

Post by xenomorph » Fri Jan 07, 2005 8:18 pm

[quote="xml"]if we put a char like

xenomorph
Earned a small fee
Earned a small fee
Posts: 18
Joined: Thu Sep 02, 2004 7:33 am
Location: Germany

Post by xenomorph » Fri Jan 07, 2005 10:43 pm

I've already found the error... (my fault)

In wx.NET/Src/wx.NET/wxString.cs change

Code: Select all

                public char this[long i]
		{
			get {return System.Convert.ToChar(wxString_CharAtInt(wxObject, (uint)i)); }
		}
to

Code: Select all

                 public char this[long i]
		{
#if __WXMSW__
			get { return wxString_CharAt(wxObject, (uint)i); }
#else
			get {return System.Convert.ToChar(wxString_CharAtInt(wxObject, (uint)i)); }
#endif			
		}
wx.NET under Windows doesn't get build in unicode mode...
wx.NET under Windows doesn't get build in unicode mode...
wx.NET under Windows doesn't get build in unicode mode...
wx.NET under Windows doesn't get build in unicode mode...
wx.NET under Windows doesn't get build in unicode mode...

:oops:

Greetings
Xenomorph 8)

Post Reply