Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / several event handlers on mac os

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. several event handlers on mac os
#3831
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??

Sabine
Message2. Re: several event handlers on mac os
#3835
Posted by: upCASE 2004-04-15 15:29:54
Hi!
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.
upCASE
-----------------------------------
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
#3839
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 :-)

Sabine
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Tue 2024-12-10  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0