Search found 36 matches

by pkl
Mon Jun 18, 2018 7:22 pm
Forum: C++ Development
Topic: Enter key does not activate default button when pressed in a wxListCtrl.
Replies: 3
Views: 2009

Re: Enter key does not activate default button when pressed in a wxListCtrl.

The panel does not have the wxWANTS_CHARS style so that is not the problem. I also thought about monitoring EVT_LIST_ITEM_ACTIVATED. Now where you also suggest this, it is probably the best solution, so I will pursue that path. One thing I tried was to do was manually catch the ENTER key event and p...
by pkl
Sun Jun 17, 2018 9:02 pm
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

FYI, my post got through and has been responded to as well.
by pkl
Sun Jun 17, 2018 9:58 am
Forum: C++ Development
Topic: Enter key does not activate default button when pressed in a wxListCtrl.
Replies: 3
Views: 2009

Enter key does not activate default button when pressed in a wxListCtrl.

I believe this is about the last wxWidgets problem I have, but now is a good time with all those problems that have been solved for me. I would like a wxListCtrl to ignore the "ENTER" key, so that pressing ENTER activates the default button. I am aware of EVT_LIST_ITEM_ACTIVATED, but I won...
by pkl
Sun Jun 17, 2018 9:38 am
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

Okay - I got that. So developers do not visit these sites - this is a little sad.
By the way: I posted on the wx-users group almost two hours ago, but can not see my post. Is that a problem or am I waiting to get a approved by a moderator?

/Peter
by pkl
Sun Jun 17, 2018 8:02 am
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

I will do that. Thank you for the link. Is that group more "official" than this forum. I find it confusing having two groups.
I must say that I have had great help in this forum, but if it is not the "official" group, it is difficult to know where to post.

/Peter
by pkl
Sat Jun 16, 2018 11:05 am
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

So now I have had time to spend time on this problem, and it is quite easy to reproduce: I am sorry that it is not the most minimal example I post. I am using the same code as for the other problem ( https://forums.wxwidgets.org/viewtopic.php?f=1&t=44703 ) and have been to lazy removing the unne...
by pkl
Fri Jun 15, 2018 8:22 pm
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

Hi doublemax, Thank you for your assistance. Indeed your solution worked, also in my real project. I do not know how to solve this problem in wxWidgets since it appears to be a Windows bug. I guess You could work your way around it, but perhaps some documentation would be in order? Just weird I have...
by pkl
Fri Jun 15, 2018 7:12 pm
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

Here is code to reproduce my problem. I modified the code from PB. Thank you for the code, PB. ;-) * Press update items and insert e.g. 20 items. * Scroll down so you are near the end of the report. * Maximize window. Several empty lines and missing columns. And by the way: refreshing is awfully slo...
by pkl
Fri Jun 15, 2018 6:16 pm
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

Yes. I bind wxEVT_SIZE in my constructor for my controlling class (derived from wxListCtrl) and I do call event.Skip() in my handler. But why do I have to do that? I could imagine a handler that performs some action and then still wants the default action to take place (Imagine you would like the co...
by pkl
Fri Jun 15, 2018 4:48 pm
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

Hi all, I have now had time to look at this wxWidgets problem again, and I can confirm that I still believe this to be a bug in wxWidgets. What happens in my code is that when the size of a ListCtrls client-size changes I perform a column resize (the width of my columns may be dynamic depending on t...
by pkl
Wed Jun 06, 2018 9:52 am
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

I am not sure I follow? I call skip(false) if I do not want the system to process the event any further. In this case I handled the key combination, and I do not want a higher layer to process the key. Right now, I process the key but the Skip function is not honored so the system handles the key, f...
by pkl
Wed Jun 06, 2018 7:09 am
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

So far, I have been able to reproduce the problem with the sample code. Thus it is probably a problem with my code. I will investigate further and return here to provide an explanation or close the subject. Thank you for your support. As always it has been very good.
by pkl
Tue Jun 05, 2018 8:44 pm
Forum: C++ Development
Topic: wxListCtrl GetTopItem() returns negative number
Replies: 14
Views: 2638

Re: wxListCtrl GetTopItem() returns negative number

Thank you for your comments! tuk1: It is a small positive value = vec.size(), where vec is a std::vector holding the data. So that is not the problem. PB: You are using a "reduced" version of the ListCtrl demo, I guess? You are not replicating my behaviour as you are not deleting any entri...
by pkl
Tue Jun 05, 2018 7:46 pm
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Re: Keyboard event handled not always respected

The code is as follows: void ui_ctrl_info::on_key_down(wxKeyEvent& kd_info) { auto result = handle_keycode({kd_info.GetModifiers(),get_key_id(kd_info.GetKeyCode())}); kd_info.Skip(!result.processed); if (result.processed) { //--- } } ui_ctrl_info is basically a class extending a wxWidget (so my ...
by pkl
Tue Jun 05, 2018 8:47 am
Forum: C++ Development
Topic: Keyboard event handled not always respected
Replies: 12
Views: 2331

Keyboard event handled not always respected

Under wxWidgets 3.0 and Windows 10, I use Alt-I as a shortcut key. When I press the key-combination, my shortcut gets executed and I do remember to mark the event as handled. And yet, I hear an annoying "ping" from my OS, indicating that the system tries to handle the key-combination anywa...