wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
6.7k stars 1.83k forks source link

Initially focused wxDialog control doesn't get EVT_SET_FOCUS #20845

Closed wxtrac closed 12 years ago

wxtrac commented 21 years ago

Issue migrated from trac ticket # 1480

component: wxOSX | priority: normal | resolution: fixed | keywords: focus

2004-03-02 03:24:36: kasplat created the issue


Per Robin's request I'm submitting this as a bug...

Kevin said: It looks like we are back to auto-selecting the text of a TextEntryDialog when the dialog appears on Windows. This is fine with me, but the Mac version doesn't do this. I seem to remember us discussing this before, is the lack of text selection a Apple Human Interface Guideline (HIG) or is the Mac code just lagging behind? I dislike the lack of text selection for single line fields in text dialogs, so I'm curious :)

Hmm, I just tested on Windows and Mac to double-check behaviour of plain TextCtrls and it looks like on Windows as you tab between fields all the text is auto-selected for plain, password, and TE_RICH2 styles. On the Mac however, all the text is selected for the password field, but the cursor position is remembered for plain and rich text style variations, so the text isn't auto-selected. I love cross-platform issues ;-)

Robin said: TextCtrl auto selection is up to the specific wx port to implement or not. wxMSW does it because it is common behavior in other Windows apps. wxMac probably should do it too as I see it happening there too (System Prefrences for example,) although I don't know if the HIG has anythign to say about it or not. Please enter a bug report about this.

wxtrac commented 21 years ago

2004-07-21 21:26:27: kasplat commented


2.5.2.x ping. Either this should be closed or the behavior implemented on the Mac. As of 2.5.2.x the Mac remembers the selection and insertion point as you tab between fields on a panel.

The text is selected for single-line TextEntryDialog input, which was the main thing that seemed to be broken when I posted this bug report.

If this matches the Mac HIG then this should definitely be closed.

wxtrac commented 12 years ago

2012-09-01 04:20:34: @oneeyeman1 commented


Just tested the behavior on the dialogs sample with "Single Line Entry".

Starting the dialog the string is not selected and the caret is at the very first position. If pressing TAB 3 times, the focus comes back to the text control and the text becomes selected.

The testing was done on wxWidgets-2.9.4 configured to build as "--with-osx_cocoa --mac-version-min=10.6" on the Snow Leopard 10.6.7.

wxtrac commented 12 years ago

2012-10-27 07:11:13: @oneeyeman1 commented


Are we going to close this?

It looks like Mac conforms to the common behavior now...

wxtrac commented 12 years ago

2012-10-28 19:49:47: @vadz changed status from new to confirmed

2012-10-28 19:49:47: @vadz changed component from wxOSX-Carbon to wxOSX-Cocoa

2012-10-28 19:49:47: @vadz changed title from TextCtrl selections to Initially focused wxDialog control doesn't get EVT_SET_FOCUS

2012-10-28 19:49:47: @vadz commented

Your own comment:2 seems to indicate that the bug is still present because the string is not initially selected, so I really struggle to understand why do you think it should be closed.

It is probably related to the other focus bugs in wxOSX in modal dialogs as the text is initially selected if you have a wxTextCtrl in a frame but it doesn't work for the text entry dialog (Cmd-E in the dialogs sample).

wxtrac commented 12 years ago

2012-11-28 09:51:57: @csomor changed status from confirmed to closed

2012-11-28 09:51:57: @csomor changed resolution from * to fixed*

2012-11-28 09:51:57: @csomor commented

(In [73046]) supporting selection methods when not focused, closes #1480