- Tighten up hover state code.
- CPCoding support.
- Make sure to initialise button type to `CPTokenFieldDisclosureButtonType` rather than null.
- Don't try to lay out disclosure/delete button in the token token.
Disclosure arrow behaves like in Cocoa: it shows on hover and if clicked displays the token specific menu.
This change also removes the delete button by default. The delete button can be enabled with `[tokenField setButtonType: CPTokenFieldDeleteButtonType]`.
The token delete button becomes visible on mouse over of the token in the standard theme. It could be made to disappear even that the mouse was still over the token by mousing over the button itself and then out.
This fix delegates all hover management to the token alone.
This change implements support for the CPTokenField delegate method `tokenField:menuForRepresentedObject:` (and the associated `tokenField:hasMenuForRepresentedObject:`).
- Factored out blur handler from CPTokenField into CPTextField.
- CPTextField will no longer lose focus unnecessarily.
- Changed switch style in CPWindow -sendEvent.
- Added menu bar to KeyViewLoop test app.
Without this fix, token fields generally assumed that if there was anything in the shared editor buffer, it belonged to the current field, even if it wasn't the field that was being edited.
With this fix only the token field actually being edited considers the editor contents.
Before this change the close button showed at all times, even for token fields which weren't even editable.
This change brings us closer to Cocoa in that there's no token delete button most of the time, and just like in Cocoa there are more controls available on hover. (Although in Cocoa there's a disclosure arrow and we have a close button instead.)
Without this change, clicking a token in a first responder token field would cause it to momentarily lose first responder status and then immediately gain it back.
This fix makes it so that tokens never try to become the first responder, resulting in a more stable token field as tokens are selected and deselected.
After recent changes clicking on an autocomplete item in the pop up did nothing. Now this works and in conjunction with the new non-key-window-change update it's likely to work better than before.
This means there'll be 1 px of spacing both above and below tokens in multi-row configurations. It also places the token much better in the field both in single and multi-row configurations, at least for the Aristo theme.
E.g. in a two window application, if a token field was the first responder and another window was made active and then the original window made active again, the token field would no longer be the first responder.
Sometimes clicking a token would cause the token field to scroll to some other spot. This appears to have been caused by the inactive input element gaining focus.
We no longer need the input element for keyboard navigation so we can hide it entirely when it's not used to input a new token. Also, avoid focusing the input element needlessly.
- System fonts now track the currently configured system font at runtime.
- You can specify CPFontCurrentSystemSize as a system font size to track the currently configured system font size at runtime.
- Theme fonts and nib2cib now determine face and size at runtime, there is no need to recompile if the system font is changed in Info.plist.
- All hard-coded references to 12.0 as a system font size have been replaced by the current system font size.
- Full Cocoa-compliant implementation of CPComboBox and CPComboBoxDelegate.
- Better focus ring for CPTextField and all subclasses.
- CPTextField and its subclasses draw disabled contents differently, per Cocoa.
If one or more token is selected and the left arrow key is pressed, collapse the selection to the left of the first selected token.
Similarly, on right arrow key collapse to the right of the last token.
Note that shift-left and shift-right have no effect if the first or last token respectively in the field are already selected.
Cmd-A (Mac) or Ctrl-A (other) finishes any ongoing editing and selects all tokens in a token field.
This commit also adds support for the `selectText:` and `selectAll:` methods.
We now leave the default propagation policy of Cappuccino in place, which normally is NO for regular characters but YES for things which could be shortcuts.
If the editor is placed while there is a token selection it can cause the token view to become scrollable to a white area at the bottom even that there is no editing cursor. And even if the editor is not at the bottom, the empty space made for the editor makes no sense when no editing cursor is visible.
If a half typed token is in the field, Cocoa tries to convert it to a representedObject before responding to objectValue. Now CPTokenField does the same.
Token field now triggers autocompletion from textDidChange: which better meets the expectations of Cappuccino programmers, and is closer to how Cocoa does it.
Eliminated custom non-Cappuccino key press handler.
The menu should appear above other normal windows and controls like a regular CPMenu. To do this, put the pop up in its own window with the `CPPopUpMenuWindowLevel` window level.