Guidance Forums / wxWidgets (wxWindows) in C++ / several event handlers on mac os

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. several event handlers on mac os
Posted by: 2004-04-14 21:56:12
Hi folks,

I'm developing a solution for Windows and Mac both (developing and debugging on windows, only compiling on mac).

My GUI shows a ScrollWindow, that holds "lines" of wxPanel-Controls, each of them itself hosts several custom controls derived from wxTextBox and some buttons to move the rows up and down and to delete them.

The derived wxTextBox controls own several event handlers:

1. onChar() for getting key press of arrows to navigate down and up
2. OnFocusKill() for validating the controls content

This works fine under Windows - if I press "Arrow down" in one of the inner wxTextBox controls I stop in both event handlers by debugging.

If I do the same on the mac - I get only the onChar-event. The focus-lost-eventhandler is not reached in the derived control :-(

What can I do? Any idea??

Message2. Re: several event handlers on mac os
Posted by: upCASE 2004-04-15 15:29:54
I guess you can do nothing about that :(
I had a similar problem here, where I wanted to catch the SetFocus() events for a button. On Windows it worked fine, on GTK and Mac it didn't. On the mailing list I read something that makes me think that the Mac doesn't generate such an event at all. My solution was programming my own focus changing event.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: several event handlers on mac os
Posted by: 2004-04-15 18:14:18
Sorry, I found it's just a COMPLETE DIFFERENT error *wonder*

When I set focus by mouse to a control of the above or below row AND left or right from the original one it worked as I saw this morning.

The textcontrols in my rows have identical IDs... So the Mac doesn't recognize that the control in the row above or below is another one :-(  Windows has no problem with that point.

So I had to append to all my dynamic controls a row number at the end of the original ID, which is quite nasty. Now the event works but I've got lots of other things to check and rewrite :-((

But nevertheless thanks for your answer :-)

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Thu 2024-6-20  Guidance Laboratory Inc. Hits:0