Search found 210 matches

by purplex88
Wed May 01, 2019 10:39 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Re: Display unicode on button?

Thanks, I will do experiments with these now. I want to avoid this ANSI mess as much as possible though!
by purplex88
Wed May 01, 2019 9:17 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Re: Display unicode on button?

I see. Suppose the file I was loading was saved using ANSI Windows 1252:

Can I specify the second argument in:

Code: Select all

wxString::wxString(const char*, const wxMBConv&)
to handle that CP-1252 encoding to build wxString?

It seems wxMBConv accepts only unicode (UTF-8, UTF-16, UTF-32) parameters.
by purplex88
Wed May 01, 2019 9:05 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Re: Display unicode on button?

I see, you mean avoid

Code: Select all

wxString::wxString (const char * psz) 
and use

Code: Select all

wxString::wxString(const char*, const wxMBConv&)
so I can completely ignore locale and use wxString safely independent of locale.
by purplex88
Wed May 01, 2019 8:43 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Re: Display unicode on button?

@doublemax. That means I can just completely avoid using locale settings, if I don't care about commas or decimal points etc? and Unicode and displaying characters in different languages will still work.
by purplex88
Wed May 01, 2019 8:27 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Re: Display unicode on button?

Yes, right. I had to use different encoding for source file. Thanks, it worked correctly.

Any idea if I need to change locale? How will that be useful?

I am using Visual C++ 2015.
by purplex88
Wed May 01, 2019 7:59 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 166

Display unicode on button?

I am getting this result when I try to use unicode: 2019-05-01_13-24-40.png buttonLoad = new wxButton(this, 1650, L"Привет"); buttonLoad->Bind(wxEVT_BUTTON, &MyFrame::OnHello, this); Is it possible use this or do I need to recompile wxWidgets for russian / cyrillic ? Using wxWidgets 3.1 + Windows 8.1
by purplex88
Mon Apr 29, 2019 10:18 am
Forum: C++ Development
Topic: Checking current locale for wxString
Replies: 3
Views: 86

Re: Checking current locale for wxString

I see. Yes, doublemax I think its good to explicitly specify it. I guess I am trying to understand what this locale concept is all about. I thought locale was a codepage. E.g. use this codepage to convert data to another codepage. Is that how it is? I tried to get locale Info and I got: • Locale num...
by purplex88
Mon Apr 29, 2019 8:29 am
Forum: C++ Development
Topic: Checking current locale for wxString
Replies: 3
Views: 86

Checking current locale for wxString

From the documentation wxString::wxString (const char * psz) Constructs a string from the string literal psz using the current locale encoding to convert it to Unicode (wxConvLibc). So, if I using this constructor to construct my own wxString, it means the const char* is in current locale. How can I...
by purplex88
Sun Apr 28, 2019 3:20 pm
Forum: C++ Development
Topic: wxString :UTF-16 surrogate pairs not handled?
Replies: 2
Views: 75

Re: wxString :UTF-16 surrogate pairs not handled?

Okay, I see. If it knew about surrogate pairs then wxString.at(position_index) would be some code point, and std::wstring behaves the same way
by purplex88
Sun Apr 28, 2019 1:14 pm
Forum: C++ Development
Topic: What macros I need exactly to compile a console application?
Replies: 3
Views: 96

What macros I need exactly to compile a console application?

I am going to test out wxString into a Console Application using Visual C++ Compiler on Windows. What macros exactly do I need to define compile this? I included the header and library paths already. Just not sure if it works on console c++ application. #include <wx/string.h> #include <iostream> int...
by purplex88
Sun Apr 28, 2019 10:14 am
Forum: C++ Development
Topic: wxString :UTF-16 surrogate pairs not handled?
Replies: 2
Views: 75

wxString :UTF-16 surrogate pairs not handled?

I was reading about how unicode is handled with wxString. I came across this documentation page on wxString. wxString uses per code unit indexing instead of per code point indexing when using UTF-16, i.e. in the default wxUSE_UNICODE_WCHAR==1 build under Windows and doesn't know anything about surro...
by purplex88
Mon Apr 08, 2019 11:50 pm
Forum: C++ Development
Topic: wxString to const char*
Replies: 1
Views: 62

wxString to const char*

I want to pass a const char* to a function but I have wxString.

What should I do?

Code: Select all

void f(const char* c)
{
  ..
}

Code: Select all

wxString str; // my string with some data

f(str.data().AsChar()) // #1

OR

f(str.mbc_str()) // #2

OR

f(str.mb_str()) // #3

OR

f(str.c_str().AsChar()) // #4
by purplex88
Fri Feb 08, 2019 1:59 pm
Forum: C++ Development
Topic: Growable horizontal cell size in wxFlexGridSizer
Replies: 8
Views: 195

Re: Growable horizontal cell size in wxFlexGridSizer

Thanks, doublemax. I will try to shed some more light:
Growable Column Right Align Detailed.png
Growable Column Right Align Detailed.png (21.11 KiB) Viewed 151 times
I understand what you said about a non-growable column.

But here as you can see that it is a growable column. Why is "MyLabel" aligned to that much far to right?
by purplex88
Fri Feb 08, 2019 12:05 am
Forum: C++ Development
Topic: Growable horizontal cell size in wxFlexGridSizer
Replies: 8
Views: 195

Re: Growable horizontal cell size in wxFlexGridSizer

Then, how come the cell has a size? I know its not a window.
I am just trying to understand the behavior. Probably you don't know understand what I mean.
by purplex88
Thu Feb 07, 2019 10:01 pm
Forum: C++ Development
Topic: Growable horizontal cell size in wxFlexGridSizer
Replies: 8
Views: 195

Re: Growable horizontal cell size in wxFlexGridSizer

Hi,

I don't mean the sizer. I wrote the 'cell' inside wxFlexGridSizer sizer.