Page 1 of 1

wxTE_PROCESS_ENTER handled too many times (over 1)

Posted: Tue Dec 17, 2013 4:31 pm
by Tapsa
I am using 3.0.0 and I've noticed that whenever I press enter in a wxTextCtrl that does not have wxTE_PROCESS_ENTER property set, the event (enter press) gets handled in my own completely unrelated handler which has nothing to do with the correct event handler. The proper handler probably handles it, but due to 3.0.0 needing Event.Skip() in every wxFocusEvent handler, the event proceeds further. Who knows where it secretly goes before dying off. Sometimes the focus cursor gets trapped inside wxTextCtrl which has wxTE_PROCESS_ENTER.

What could possibly cause this?

Re: wxTE_PROCESS_ENTER handled too many times (over 1)

Posted: Tue Dec 17, 2013 7:32 pm
by doublemax
It sounds like a bug, but your description is a little confusing, so it's hard to say. We'll probably need a minimal sample that shows the problem.

Re: wxTE_PROCESS_ENTER handled too many times (over 1)

Posted: Wed Dec 18, 2013 1:55 pm
by Tapsa
Could it be that I am using enum when connecting event handlers to events?

Code: Select all

enum
{
	MenuOption_Prompt,
	MenuOption_IDFix,
	MenuOption_Buttons,
	MenuOption_Tips,
	MenuOption_About,
	ToolBar_Open,
	ToolBar_Save,
	ToolBar_Show,
	ToolBar_Help
};

Code: Select all

Connect(MenuOption_IDFix, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(AGE_Frame::OnMenuOption));

Code: Select all

void AGE_Frame::OnMenuOption(wxCommandEvent &Event)
{
	switch(Event.GetId())
	{
	...
Note that this code used to work in wxWidgets 2.8.12 but does not in 3.0.0.

Re: wxTE_PROCESS_ENTER handled too many times (over 1)

Posted: Wed Dec 18, 2013 3:13 pm
by doublemax
Could it be that I am using enum when connecting event handlers to events?
I don't know if this is the cause for your problem, but it's definitely a bad idea. Your own identifiers should be higher than wxID_HIGHEST.

Code: Select all

enum
{
   MenuOption_Prompt = wxID_HIGHEST+1,
   MenuOption_IDFix,
   MenuOption_Buttons,
...