Commit Graph
126 Commits
Author SHA1 Message Date
aparajita ceeaab70fc Merge pull request #1679 from mrcarlberg/scroll_before_focus_text_field
Make sure the text field is visible before focus
2013-02-19 06:14:42 -08:00
Alexander Ljungberg baa69ff3bc Fixed: "cannot read property '_tokenScrollView' of null."
This error could occur when interacting with token fields.
2013-02-08 00:34:25 +00:00
Alexander Ljungberg 03e4c49091 Improve token field disclosure arrow implementation.
- 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.
2013-02-04 11:53:18 +00:00
Alexander Ljungberg 0229e1938e Token field disclosure arrow for menu.
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]`.
2013-02-04 01:26:16 +00:00
Alexander Ljungberg 49c52a00be Fixed: disappearing token delete button.
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.
2013-02-03 18:40:06 +00:00
Alexander Ljungberg 18d77ca9f7 CPTokenField menu per token support.
This change implements support for the CPTokenField delegate method `tokenField:menuForRepresentedObject:` (and the associated `tokenField:hasMenuForRepresentedObject:`).
2013-02-02 01:28:31 +00:00
Aparajita Fishman 93fb849296 Import fixes 2013-01-24 19:18:39 +08:00
Aparajita Fishman 4f377bcebe Objj2 compiler fixes
Compiled all files individually:

- Added missing imports.
- Added @class/@global declarations to break circular dependencies.
- Misc. code cleanup.

Conflicts:
	AppKit/CPWindow/_CPWindow.j
	AppKit/Platform/DOM/CPPlatformWindow+DOM.j
2013-01-23 15:48:55 +07:00
Aparajita Fishman 7c831fa19d capp_lint flags deprecated CPPoint/Rect/Size types/functions
- Changed to corresponding CG types/functions in all files
- Fixed some demo app bugs
2013-01-19 16:51:56 +07:00
Martin Carlberg 458fa9d02e Fixed a lot of small bugs found by new warning message from compiler 2013-01-18 14:24:37 +01:00
Martin Carlberg 6210bd2e6d Merge branch 'master' of https://github.com/cappuccino/cappuccino into objj_compiler2
Conflicts:
	AppKit/CPWindow/CPWindow.j
2013-01-13 22:01:43 +01:00
Aparajita Fishman cdc88dbe18 Key view...
- 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.
2013-01-11 00:18:38 +07:00
Martin Carlberg c297e926f9 Compiler now works with jake and can compiler the whole Cappuccino framework. A lot of test cases still fail 2012-12-16 17:38:47 +01:00
Alexander Ljungberg 79894781b1 Merge pull request #1707 from slevenbits/slevenbits-tokenfield-value-fix
Fixed: if any token field was being edited, the object value of all other token fields contained the partial value.
2012-12-15 00:40:07 +00:00
Alexander Ljungberg eed37a0f81 Fixed: if any token field was being edited, the object value of all other token fields contained the partial value.
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.
2012-12-14 15:12:44 +00:00
Alexander Ljungberg bd1f64bfde Only show token delete button on hover, and only when token field is editable.
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.)
2012-12-11 17:27:13 +00:00
Alexander Ljungberg d27e333941 Fixed: tokens could be deleted in an non editable token field.
Prior to this fix, clicking the (X) button on a token would delete the token even if the field was not actually editable.
2012-12-11 17:19:02 +00:00
Alexander Ljungberg 9035439f61 Fixed: token field first responder flicker when clicking tokens.
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.
2012-12-11 16:43:06 +00:00
Martin Carlberg 82337b8baa Merge branch 'master' into scroll_before_focus_text_field
Conflicts:
	AppKit/CPTokenField.j
2012-11-30 14:43:46 +01:00
Alexander Ljungberg 9d4e8164b7 Fixed: token field autocomplete selection by mouse.
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.
2012-11-26 15:39:41 +00:00
Alexander Ljungberg 2236e7d2da Unused variable. 2012-11-26 13:48:45 +00:00
Alexander Ljungberg 9ebc78773d Put half a vertical spacing above the first row of tokens.
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.
2012-11-19 12:14:28 +00:00
Alexander Ljungberg 256d36320a Fixed: token fields lost first responder status when switching between windows.
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.
2012-11-19 00:40:26 +00:00
Martin Carlberg 7bf5f6f5a9 Added scrollRectToVisible when CPTokenField becomeFirstResponder 2012-10-27 15:13:57 +02:00
Alexander Ljungberg 1fb09dcfae Fix typo. 2012-08-02 00:53:30 +01:00
Alexander Ljungberg 9768ea4af9 Fixed: multiple rows of tokens in token fields wouldn't scroll right.
In recent versions, moving the cursor to a new row of tokens would place the scroll point somewhere halfway between the two rows of tokens.
2012-08-02 00:44:58 +01:00
Alexander Ljungberg 26c26914da Fixed: token field scrolling away from selected token.
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.
2012-08-02 00:38:21 +01:00
Aparajita Fishman 6b6f5d98e4 Overhaul of system font handling
- 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.
2012-07-09 15:29:56 -07:00
Aparajita Fishman 32737e0b72 CPComboBox and CPTextField enhancements
- 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.
2012-07-06 00:15:23 -07:00
Alexander Ljungberg d39849b297 Improve token field keyboard navigation when tokens are selected.
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.
2012-06-21 19:24:22 +01:00
Alexander Ljungberg 7764921c21 Select all support for CPTokenField.
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.
2012-06-21 19:17:34 +01:00
Alexander Ljungberg 2200e40001 Fixed: browser shortcuts wouldn't work when a token field was active.
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.
2012-06-16 12:31:50 +01:00
Alexander Ljungberg 44b609f604 Don't make space for editing in token field if tokens are selected.
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.
2012-06-16 12:31:50 +01:00
Alexander Ljungberg d5918157ff Overwrite selected tokens by typing support.
If tokens are selected in `CPTokenField` and new text is entered, the selected tokens are overwritten by the newly entered text.
2012-06-16 12:31:50 +01:00
Alexander Ljungberg 19b53746cf Fix nil representedObjectForEditingString: response handling.
If `tokenField: representedObjectForEditingString:` returns nil, act the same as if the delegate method didn't exist. This matches Cocoa.
2012-06-16 12:31:50 +01:00
Alexander Ljungberg d0769ec360 Oops. Fix object value fix. 2012-06-16 12:31:49 +01:00
Alexander Ljungberg 3c20bf8ad6 Allow token field insertText: to be somewhat overridden.
If `insertText:` is overridden to do nothing, nothing in inserted.
2012-06-16 12:31:49 +01:00
Alexander Ljungberg 3eab2a528f Make token field object value more like Cocoa.
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.
2012-06-16 12:31:49 +01:00
Alexander Ljungberg fb404a0671 Hide private token field API. Fix return type. 2012-06-16 12:31:49 +01:00
Alexander Ljungberg 6d6cf52180 Minor token field optimisation. 2012-06-16 12:31:49 +01:00
Alexander Ljungberg 55ca956f50 Remove nonstandard CPCopyRange. 2012-06-16 12:31:49 +01:00
Alexander Ljungberg f43c643d5a Allow token field subclasses to override defaultCompletionDelay.
Also fixed incorrect return type.
2012-06-16 12:31:49 +01:00
Alexander Ljungberg 69f5fc536c Key bindings support for token field.
Also improve compatibility with `CPTextField` superclass and subclassing support by properly using `interpretKeyEvents:` like `CPTextField`.
2012-06-16 12:31:49 +01:00
Alexander Ljungberg 132ac7c03f Token field 'keyUp:' support. 2012-06-16 12:31:49 +01:00
Alexander Ljungberg 5683af9bc8 Improve token field subclassing support.
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.
2012-06-16 12:31:48 +01:00
Alexander Ljungberg 429933f601 Fix token field keyDown: handling.
`CPTokenField` had custom key down handling making it function poorly with Cappuccino's event handling and subclasses.
2012-06-16 12:31:48 +01:00
Alexander Ljungberg 85cfb18906 Place token autocomplete underneath what's being completed.
This matches Cocoa.
2012-06-16 12:31:48 +01:00
Alexander Ljungberg 33fe1573ad Ensure autocomplete menu is on top.
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.
2012-06-16 12:31:48 +01:00
Alexander Ljungberg b166995327 Move autocomplete into reusable class. 2012-06-16 12:31:48 +01:00
Alexander Ljungberg feaf9c6f20 Improve CPTokenField autocomplete scrolling. 2012-06-16 12:31:48 +01:00