Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Last standing unicode problem

(1/7) > >>

mandrav:
Bold title for a topic :)

Well, I 've updated my local wx installation to wx2.6.2/unicode and fixed all minor incompatibilities.
Except for one thing:


--- Code: ---int someint;
wxString astr;
wxString anotherstr;

astr << _T("aval"); // ok
astr << anotherstr; // ok
astr << someint; // *not* ok

--- End code ---

I can't stream numbers to wxString  :shock:
Anyone else has seen this? Knows a workaround?
The only workaround I found is using wxString::Format() instead of streams but this would mean scanning the entire source tree to find where integers are streamed to wxString and alter the code...

rickg22:
a little bit offtopic, but if you already moved to wx262, what happened to the splitpanel position problem? (the splitter position getting forgotten). Is that fixed already?

takeshimiya:
What happens if you change these defaults?:

// If enabled (1), compiles wxWidgets streams classes
#define wxUSE_STREAMS       1

// Use standard C++ streams if 1. If 0, use wxWin streams implementation only.
#define wxUSE_STD_IOSTREAM  0

// Enable conversion to standard C++ string if 1.
#define wxUSE_STD_STRING  0

The wxWidgets stream classes may have bugs.

mandrav:

--- Quote from: rickg22 on November 24, 2005, 06:36:08 pm ---a little bit offtopic, but if you already moved to wx262, what happened to the splitpanel position problem? (the splitter position getting forgotten). Is that fixed already?

--- End quote ---

I 've fixed it for the classbrowser since lastweek.
I 'll fix it for open files list too.


--- Quote from: Takeshi Miya on November 24, 2005, 06:52:57 pm ---What happens if you change these defaults?:

// If enabled (1), compiles wxWidgets streams classes
#define wxUSE_STREAMS 1

// Use standard C++ streams if 1. If 0, use wxWin streams implementation only.
#define wxUSE_STD_IOSTREAM 0

// Enable conversion to standard C++ string if 1.
#define wxUSE_STD_STRING 0

The wxWidgets stream classes may have bugs.

--- End quote ---

Thanks for the suggestion, but I would like not to tamper with wx settings.
First, because it 'd make the build process more difficult for new users.
Second, because most linux users will use the pre-built wx lib coming with their distro. We should not force them to build wx themselves, not to mention that C::B would never stand a chance to become a part of distros then...

Well, seems like I 'll have to dig through the code and replace those instances with wxString::Format()...

rickg22:
wxString::operator <<

wxString& operator <<(int i)
wxString& operator <<(float f)
wxString& operator <<(double d)

These functions work as C++ stream insertion operators: they insert the given value into the string. Precision or format cannot be set using them, you can use Printf for this.

--

Yiannis, mind explaining exactly why you can't use it? It throws a runtime error or what?

Navigation

[0] Message Index

[#] Next page

Go to full version