Search found 7 matches

by liebealt
Thu Aug 13, 2020 6:14 pm
Forum: wxWidgets Development (Chinese)
Topic: 请问如何获得含有中文的wxString的字符数量呢?
Replies: 6
Views: 4923

Re: 请问如何获得含有中文的wxString的字符数量呢?

When the string of increasing X dimension (obtained by GetTextExtent method) How exactly do you do that, for each character individually and then add them up? That doesn't work, the width of a single character can be smaller if it's inside a word (at least for western text, i don't know if Chinese ...
by liebealt
Thu Aug 13, 2020 4:57 pm
Forum: wxWidgets Development (Chinese)
Topic: 请问如何获得含有中文的wxString的字符数量呢?
Replies: 6
Views: 4923

Re: 请问如何获得含有中文的wxString的字符数量呢?

They are WIndows 10 and wxWidgets 3.1.0, Sir. To be frank, this issue is a link in my question chain. The origin is to implement an auto linefeed method, for wxString::Wrap doesn't work in my project (maybe others don't have this problem at all, so weird). Naturally, I have to obtain the character n...
by liebealt
Wed Aug 12, 2020 5:44 am
Forum: wxWidgets Development (Chinese)
Topic: 请问如何获得含有中文的wxString的字符数量呢?
Replies: 6
Views: 4923

请问如何获得含有中文的wxString的字符数量呢?

比如内容为"abc一二三"的wxString对象,我想得到的字符数量应该为6,而不是length之类的得到的9之类的字节数。

请大家帮忙指点一下,多谢了。
by liebealt
Sat Jun 20, 2020 5:25 pm
Forum: C++ Development
Topic: what's the event emitted when mouse clicked on a wxListCtrl header
Replies: 5
Views: 522

Re: what's the event emitted when mouse clicked on a wxListCtrl header

The event should work for that purpose. Which platform are you on? Try to build the "listctrl" sample that comes with wxWidgets and check if it works as expected. (when you click the left-most column header, there should be a message in the log and the column image should toggle). Found it! It is m...
by liebealt
Sat Jun 20, 2020 4:23 pm
Forum: C++ Development
Topic: what's the event emitted when mouse clicked on a wxListCtrl header
Replies: 5
Views: 522

Re: what's the event emitted when mouse clicked on a wxListCtrl header

The event should work for that purpose. Which platform are you on? Try to build the "listctrl" sample that comes with wxWidgets and check if it works as expected. (when you click the left-most column header, there should be a message in the log and the column image should toggle). Windows 10, Sir. ...
by liebealt
Sat Jun 20, 2020 4:07 pm
Forum: C++ Development
Topic: what's the event emitted when mouse clicked on a wxListCtrl header
Replies: 5
Views: 522

Re: what's the event emitted when mouse clicked on a wxListCtrl header

There aren't too many events in the wxListCtrl documentation. EVT_LIST_COL_CLICK(id, func): A column (m_col) has been left-clicked. Processes a wxEVT_LIST_COL_CLICK event type. EVT_LIST_COL_RIGHT_CLICK(id, func): A column (m_col) has been right-clicked. Processes a wxEVT_LIST_COL_RIGHT_CLICK event ...
by liebealt
Sat Jun 20, 2020 3:35 pm
Forum: C++ Development
Topic: what's the event emitted when mouse clicked on a wxListCtrl header
Replies: 5
Views: 522

what's the event emitted when mouse clicked on a wxListCtrl header

hi, all

I need to do something when a wxListCtrl header is clicked. However, I have no idea which event I should handle. I can't find a clue in the doc neither. Any of your help would be appreciated.