Search found 235 matches

by purplex88
Wed May 01, 2019 7:59 am
Forum: C++ Development
Topic: Display unicode on button?
Replies: 11
Views: 755

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: 290

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: 290

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: 260

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: 330

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: 260

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: 240

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: 575

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 531 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: 575

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: 575

Re: Growable horizontal cell size in wxFlexGridSizer

Hi,

I don't mean the sizer. I wrote the 'cell' inside wxFlexGridSizer sizer.
by purplex88
Thu Feb 07, 2019 6:09 pm
Forum: C++ Development
Topic: Growable horizontal cell size in wxFlexGridSizer
Replies: 8
Views: 575

Growable horizontal cell size in wxFlexGridSizer

When I make a column growable in the wxFlexGridSizer, I can use wxALIGN_LEFT and wxALIGN_RIGHT to move the control inside the cell. I cannot do it if the column is not growable. Here's an example: When "MyLabel" static text control was wxALIGN_LEFT in wxFlexGridSizer: Growable Column Left Align.png ...
by purplex88
Sat Feb 02, 2019 8:00 pm
Forum: C++ Development
Topic: Can I copy text as HTML from wxTextCtrl?
Replies: 5
Views: 575

Re: Can I copy text as HTML from wxTextCtrl?

Libraries can have limitations. Is it best if I write the HTML output myself e.g. format the text with HTML because I saved the formatting information about (highlights, colors, etc.) into a data structure?
by purplex88
Sat Feb 02, 2019 1:21 pm
Forum: C++ Development
Topic: Can I copy text as HTML from wxTextCtrl?
Replies: 5
Views: 575

Re: Can I copy text as HTML from wxTextCtrl?

Would I need convert it from Rich Text to HTML under wxTextCtrl?
by purplex88
Sat Feb 02, 2019 7:02 am
Forum: C++ Development
Topic: Can I copy text as HTML from wxTextCtrl?
Replies: 5
Views: 575

Can I copy text as HTML from wxTextCtrl?

Hello, I have a wxTextCtrl with wxTE_RICH2 style enabled: m_textCtrl = new wxTextCtrl(m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_RICH2); It copies rich text with formatting and colors. Can I copy the text as HTML so I can paste it with formatting into ...
by purplex88
Wed Jan 09, 2019 10:13 pm
Forum: C++ Development
Topic: Adding a control (or sizer) between two other controls (or sizers).
Replies: 9
Views: 1055

Re: Adding a control (or sizer) between two other controls (or sizers).

Thanks. It is indeed very simple to do that with wxFlexGridSizer. On the top of that, no data structures like std::map were required. I combined the code with suggestions given by @doublemax as well and used a wxPanel. Yes, actually I admit that it is an overkill for such small dialog to add '+' but...