fieldeditor

Cocoa: Stopping the field editor from auto-completing on space key

北城余情 提交于 2019-12-22 08:12:38
问题 I have a custom view with several NSTextField controls for which I want to supply custom auto-completions and I have successfully implemented all that using the NSTextFieldDelegate Protocol. The auto-completions are full names or place names, depending on which text field is being edited. The issue is that the auto-completions almost always contain a space character and so if the user is typing something that matches a suggestion, but doesn't want to accept that suggestion, the field editor

NSTextField: exposing its Copy and Paste methods

北城以北 提交于 2019-12-17 20:55:52
问题 I am trying to access the copy, cut, and paste methods of a NSTextField instance in its window delegate so I can customize these methods. I find that unlike tableViews and textViews, the textfield's copy, paste and cut actions are not responsive in the delegate. My understanding is that all text controls share the window's field editor yet this does not seem to be the case. I thought perhaps the TextField's field editor was not being shared with the window delegate, however I did some testing

Cocoa: Stopping the field editor from auto-completing on space key

风格不统一 提交于 2019-12-05 14:19:59
I have a custom view with several NSTextField controls for which I want to supply custom auto-completions and I have successfully implemented all that using the NSTextFieldDelegate Protocol. The auto-completions are full names or place names, depending on which text field is being edited. The issue is that the auto-completions almost always contain a space character and so if the user is typing something that matches a suggestion, but doesn't want to accept that suggestion, the field editor will accept the suggestion when user presses the space key. I want the field editor to accept the

Custom field editor for NSTextFieldCell in an NSTableView

痞子三分冷 提交于 2019-12-03 13:54:19
问题 I have a custom NSTableView subclass filled with several custom NSTextFieldCell subclasses. I would like to be able to change the edited cell by using the arrow keys. I am able to accomplish this by creating a custom field editor (by subclassing NSTextView ) and returning it from the window delegate like so: - (id) windowWillReturnFieldEditor:(NSWindow *) aWindow toObject:(id) anObject { if ([anObject isEqual:myCustomTable]) { if (!myCustomFieldEditor) { myCustomFieldEditor = [

NSTextField: exposing its Copy and Paste methods

折月煮酒 提交于 2019-11-28 14:16:20
I am trying to access the copy, cut, and paste methods of a NSTextField instance in its window delegate so I can customize these methods. I find that unlike tableViews and textViews, the textfield's copy, paste and cut actions are not responsive in the delegate. My understanding is that all text controls share the window's field editor yet this does not seem to be the case. I thought perhaps the TextField's field editor was not being shared with the window delegate, however I did some testing I see that as I am typing in control, those field editors are identical--very strange. My current work