Commit Graph
66 Commits
Author SHA1 Message Date
David Richardson 1a9a42ff54 Replace #pragma mark with // MARK:
Replace objc directive with native Javascript version // MARK: to facilitate elimination of preproccsing pass.
2026-07-21 15:15:53 -06:00
eba1b2f999 Fixed: CPSearchField's bezel did not resize (#2987)
Co-authored-by: Didier Korthoudt <didier.korthoudt@icloud.com>
2021-07-29 11:39:42 +02:00
Didier KorthoudtandGitHub 5c4107835b New: Aristo3 improvements for CPSearchField (#2934)
New theme parameters
Animations
Modern Cocoa behavior
Aristo3 CSS theme ready
2020-10-23 09:05:33 +02:00
Didier KorthoudtandGitHub 2d9d354a05 Fixed: When a CPSearchField predicate was bound specifying a predicate format using more than one time the value of the search field ($value), only the first occurence was correctly set, others were set to null (#2777) 2020-04-06 13:03:57 +02:00
Martin CarlbergandGitHub 7dc77ed609 Fixed: Make sure we handle undefined when testing for nil values (#2862) 2020-01-31 13:43:58 +01:00
Didier KorthoudtandMartin Carlberg 1d01ed92d8 Fixed: CPSearchField, when no recent searches were done, the menu wasn’t showing, even if search categories were specified (#2846) 2019-06-13 16:30:53 +02:00
Didier KorthoudtandMartin Carlberg 4518dfc0ca FIXED: CPSearchField was positionning its menu with hard coded offset (#2691) 2018-08-20 13:12:22 +02:00
daboe01andMartin Carlberg ee695f9000 Fixed: CPSearchPanel did not support PredicateBindings (#2699) 2018-07-05 15:44:36 +02:00
Didier Korthoudtandcacaodev 7d20b06e52 FIXED: Before this PR, CPSearchField was handling cursor updates by direct DOM manipulation. This PR uses tracking areas. (#2684) 2018-05-28 20:46:28 +02:00
Didier Korthoudtandcacaodev 3650c38aa9 FIXED: In CPSearchField, the space between the magnifier and the textfield was hard coded (#2690) 2018-05-13 19:49:18 +02:00
Didier Korthoudtandcacaodev 5cd284cb36 FIXED: CPSearchField menu diverged from modern Cocoa (#2697) 2018-05-07 21:52:06 +02:00
Didier Korthoudtandcacaodev acfbda0d91 FIXED: CPSearchMenu _updateSearchMenu wasn't disabling autoenabling of menu items (#2693) 2018-05-07 19:57:35 +02:00
Didier Korthoudtandcacaodev 437e5a62f1 FIXED: CPSearchField -(void)resetSearchButton was using valueForThemeAttribute instead of currentValueForThemeAttribute (#2692) 2018-05-07 19:57:01 +02:00
daniel 6f72edc2d9 Formatting: removed redundant variable in CPSearchField.j
Variable `searches` is defined in the method selector, and then
redeclared with the `var` keyword two lines later. Removed the
redundant declaration, moving the variable assignment to its own line.
2018-04-04 14:45:13 -07:00
cacaodev a1248db3e7 CPSearchField: use CPMenuItem -setIndentationLevel: now that it's available. 2016-03-13 16:09:27 +01:00
Alexandre Wilhelm 34f724a4a4 Fixed: capp_lint fixes 2015-04-22 11:22:44 -07:00
Alexandre Wilhelm 4d7cb06481 Fixed: changed theme attributes image-search-left-margin image-cancel-right-margin by image-search-inset and image-cancel-inset in CPSearchField 2015-03-26 10:41:21 -07:00
Alexandre Wilhelm b1e89e7904 New: added themeAttributes image-search-left-margin and image-cancel-right-margin in CPSearchField 2015-03-23 10:45:43 -07:00
Christophe Serafin f48e2f3b18 Fixed alignement content-inset and images for control size small and mini. 2015-03-20 15:44:37 -07:00
Alexandre Wilhelm 1fcf13d149 Fixed: added optimization for releasing observers 2014-08-20 16:13:59 -07:00
Alexandre Wilhelm abdf1156d4 Fixed: memory leaks with CPNotifications
Previously, when removing a view, Cappuccino didn't clean the notification center. The notification center kept in reference old views.

This PR fix this issue. When a CPView is added to a view, the methods _removeObservers and _addObservers are called. In these both methods we remove and add the observer to the notification center if needed. _removeObservers and _addObservers are called for the view and its subviews. These both methods are called through the method viewWillMoveToSuperview.

When a CPView is removed, we only call the method _removeObservers.
When a CPWindow is closed, we call the method _removeObservers on its contentView.
When a CPWindow is about to be opened, we call the method _removeObservers and _addObservers on its contentView.

Refs #1880
Refs #2024

Test app in Tests/Manual/AttachedSheet2/SheetWindowController.j
2014-08-19 17:45:01 -07:00
Martin Carlberg bb58a206a8 Fixed: Removed all warnings of conflicting return and parameter types caused by the new compiler 2013-08-12 16:46:14 +02:00
Aparajita Fishman afd5925499 Fixed: _CG and _CP macros were confusing and could degrade performance
Previously, Cappuccino was using preprocessor macros internally for the CGPoint/Size/Rect/Inset/Affine functions, as well as for CPRange. These macros had the same name as the corresponding function, but began with _. The functions were actually defined using the macros.

The motivation behind using macros was to increase performance by reducing function calls. However, there were a number of problems with this approach:

- There was an artificial dichotomy between _CG macros and the corresponding CG functions. We never completely replaced CG function calls with _CG macros. In fact, they were often mixed up in the same file. There was an extra burden on the programmer to remember to use the macro instead of the function.
- If a method call was passed as an argument to a macro, performance could actually be significantly *worse* than a function call. For example, _CGGetRectMakeCopy([view frame]) would expand to `{ origin:{ x:[view frame].origin.x, y:[view frame].origin.y }, size:{ width:[view frame].size.width, height:[view frame].size.height } }`. So instead of a single objj_msgSend and a single simple function call, we ended up with 4 objj_msgSend calls, which are way more expensive than simple function calls.
- Because of this expansion problem, to use macros efficiently required us to remember to use variables for all macro parameters. This didn't happen, and shouldn't have to happen.
- Finally, with modern Javascript engines, function call overhead is so small that it really isn't worth using the macros.

This commit eliminates the _CGGeometry, CGAffineTransformation and CPRange macros and replaces them with function calls.

BREAKING CHANGE:
The macros are no longer available. They could only be used with compiled code, but if there is any user code that used them, they will have to be replaced with the corresponding functions.
2013-03-13 12:22:10 -04:00
Alexander Ljungberg 5b05dc92a1 More dictionary literals. 2013-02-25 18:27:44 +00:00
Alexandre Wilhelm 0f0b315f3b Fixed bug about the cancel button in CPSearchField (changed the type of the button to CPMomentaryChangeButton) 2013-01-24 15:22:45 -08:00
Aparajita Fishman 866e1f00f7 Objj2 compiler fixes
- Each file compiles individually with no errors or warnings.
- Added missing imports.
- Fixed imports to remove circularity.
- Removed unnecessary imports.
- Added missing headers.
- Added missing action_button.png.
- Replace CPMakeRect with CGRectMake.
2013-01-23 15:48:56 +07: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
Alexander Ljungberg 9dbfa99284 Lint. 2013-01-20 17:14:44 +00: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
Antoine Mercadal 2da0142387 Make find/search/cancel buttons themable 2013-01-09 18:24:41 -08:00
Antoine Mercadal 1edcc511d6 Allow custom action for search button
If there is no menu, and search button has a target/action, then
send the action.
2012-10-05 17:58:54 -07:00
Aparajita Fishman cae5486ec6 Added missing class checks in +initialize, regularized checking code 2012-06-28 12:05:18 -07:00
Aparajita Fishman aeb2671fc0 CPImageView enhancements
- Changed from deprecated image scaling constants to new ones.
- Added support for CPImageScaleProportionallyUpOrDown (thanks BlairDuncan).
- Cleaned up image layout code.
2012-04-12 14:55:46 -04:00
Randall Luecke e8210f7dde Proper fix for mem leakage. 2011-03-17 03:03:51 -04:00
Randall Luecke 32fc629c33 Prevent memory leak my only adding the observer when the searchfield is added to a superview, that way we can also remove the observer later. 2011-03-17 01:31:25 -04:00
cacaodevandRandall Luecke d5b2ccbc30 CPSearchField: register for textDidChange notifications instead of hijacking the delegate. Post the notification in -canCelOperation: (triggered by escape key OR cancel button). Fixes issue #1160 2011-03-17 01:18:25 -04:00
Alexander Ljungberg 651d6a7ed8 Linting AppKit. 2011-02-28 23:48:34 -03:00
Klaas Pieter Annema 4e1ecbef72 Merge branch 'CPTextField-InterpretKeyEvents' of https://github.com/luuse/cappuccino into luuse-CPTextField-InterpretKeyEvents
Conflicts:
	AppKit/CPSearchField.j
	AppKit/CPTextField.j
2011-01-18 10:07:16 +01:00
cacaodevandKlaas Pieter Annema 43f8b50ef7 revert _searchMenuTemplate -> searchMenuTemplate 2010-12-01 10:35:25 +01:00
cacaodevandKlaas Pieter Annema 7c098753cf CPSearchField:
- Fix recentAutosaveName decoding (setter was needed)
- Fix a bug where 2 search fields in the same app would receive the same recentSearches update when recentAutosaveName set.
- Update recentAutosaveName to use the new CPUserDefaults class instead of CPCookie.
- searchMenuTemplate nib2cib decoding. searchMenutemplate is just an outlet, it's automatically connected.
- Removed CPSearchFieldSeparatorItemTag
- Updated Test app with a nib2cibed search field. Ability to set some options for the regular search field.
- Style and white space.
2010-12-01 10:35:25 +01:00
Andreas bb9e1a830d Add cancelOperation action to clear text when pressing ESC 2010-11-13 15:21:37 +01:00
Francisco Ryan Tolmasky I 52f7844aee Made it so .h files are automatically included in AppKit (avoiding needing to manually include Platform.h, etc.).
Also changed a bunch of <AppKit/*> imports to "*" imports.

Reviewed by me.
2010-11-01 11:10:01 -07:00
Klaas Pieter Annema 6e9f82212b rename CPView +themeClass to +defaultThemeClass 2010-10-25 14:15:22 +02:00
Klaas Pieter Annema 991e213d02 give CPSearchField it's own theme class
Before this change it was not possible to theme CPSearchField separately from a CPTextField. Aristo still just uses the rounded theme style.
2010-10-19 14:21:00 +02:00
Paul Baumgart 01852d8075 Fix a bunch of missing @imports.
All classes (excluding the ones prefixed with underscores) in Foundation
and AppKit can now be loaded individually except CPOpenPanel and
CPSavePanel. These two classes have some sort of dependency cycle
that seems impossible to resolve without forward declarations (which
we don't have).
2010-10-05 15:54:25 -07:00
Aparajita FishmanandAlexander Ljungberg 088a5c7166 Remove extra call to _init in -initWithCoder: 2010-08-11 12:23:47 -04:00
Ross Boucher a7ca917abf Better method of expressing this condition. 2010-07-29 11:26:13 -07:00
Aparajita FishmanandRoss Boucher 48a89fd828 frame parameter is not being used in _initWithFrame, might as well leave it out, fixed typo in comment 2010-07-29 09:56:55 -07:00
Aparajita FishmanandRoss Boucher eb99b7d7ca CPSearchField fixes/enhancements to commit 5b763928fe:
- Added more documentation for -defaultSearchTemplate.

- Capitalized the text of the menu items in the default template.

- Adding a separator before no recents menu item if there are items before it.

- Updated the test app to use the default template and then modify it.

- Updated the test app to maintain the state of the custom items.
2010-07-28 15:16:04 -07:00