Simple Connect question
Simple Connect question
I have a frame that has 4 wxTextCtrl's in it. If a wxEVT_SET_FOCUS event happens on either of the first two controls, I want function foo to be called. If a wxEVT_SET_FOCUS happens on either of the second two controls, I want function bar to be called (but not foo). How do I set this up using Connect? I've tried a million different combinations but either nothing gets called at all or both foo and bar get called no matter what.
I've tried using different IDs or same IDs, but I still haven't been able to get the correct behavior. It's not clear to me what ID I'm passing to Connect. I assume it's not the window ID, since Connect is already a method on a window so the ID should be obvious. If it's the event ID, passing a unique ID to one group hasn't worked... although now explaining it I think I've been giving one group wxID_ANY and the other a unique ID. I bet that's the problem...
The ID of the menu item, and the id of the function bar (?) need to be different. Generally it is a good idea to always keep different ID's, although sometimes I cheat when I have an item on the menubar and an item on the toolbar which do the same thing.
Your passing the ID of the item you want an event activated on through Connect(). For example, if you want an event to occur on menu click, you would pass the menu item ID through Connect().
Your passing the ID of the item you want an event activated on through Connect(). For example, if you want an event to occur on menu click, you would pass the menu item ID through Connect().