Opened 4 years ago

Closed 4 years ago

#11691 closed defect (fixed)

EVT_TEXT_ENTER on OSX fires twice

Reported by: klystron Owned by: vadz
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: 2.9.0
Keywords: text enter Cc:
Blocked By: Blocking:
Patch: no

Description

A simple window with a wxTextCtrl sees a EVT_TEXT_ENTER fired twice on OSX version 2.9. (built with MacPorts.) This does not occur when the code is compiled on the 2.8 provided by Apple.

Change History (4)

comment:1 Changed 4 years ago by VZ

(In [63379]) Test wxTE_PROCESS_ENTER style in the widgets sample.

Add a checkbox for toggling wxTE_PROCESS_ENTER to the text page and use this
style by default. This makes it easier to check that this style works as
intended, including that it generates the correct events.

See #11691.

comment:2 Changed 4 years ago by vadz

  • Status changed from new to confirmed

I can confirm it after modifying the widgets sample to allow testing controls with wxTE_PROCESS_ENTER style. Interestingly, a single event is sent for multi-line wxTextCtrl but 2 are sent for single-line one.

comment:3 Changed 4 years ago by vadz

  • Owner set to vadz
  • Status changed from confirmed to accepted

Stefan, the code for wxEVT_COMMAND_TEXT_ENTER generation in wxNSTextViewControl seems simply unnecessary, these events are generated from wxNSTextFieldControl::controlAction() already. So I just removed -[wxNSTextField control:textView:doCommandBySelector:] entirely, hopefully this is ok.

comment:4 Changed 4 years ago by VZ

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [66032]) Remove duplicate wxEVT_COMMAND_TEXT_ENTER generation from wxOSX/Cocoa.

The code in -[wxNSTextField control:textView:doCommandBySelector:] generated a
second copy of this event as it was also generated from
wxNSTextFieldControl::controlAction() for single line text controls.

Closes #11691.

Note: See TracTickets for help on using tickets.