Commit Graph
5908 Commits
Author SHA1 Message Date
Didier KorthoudtandGitHub 60a686d75c Fixed: _CPMenuItemStandardView didn't take in account the left-margin theme attribute (#2689) 2020-04-06 09:18:31 +02:00
Didier KorthoudtandGitHub 89b70843c7 Fixed: Nib2cib was using hard coded frame adjustment for CPBox (#2761) 2020-04-06 09:17:05 +02:00
Didier KorthoudtandGitHub 617987f4a5 Fixed: CPTextField forced height to 29 instead of using theme value min-size (#2688) 2020-03-17 09:14:25 +01:00
daboe01andGitHub 5bb338d6ec New: CPTextField now supports the CPEditorRegistrationProtocol (#2169) 2020-03-11 10:30:00 +01:00
Didier KorthoudtandGitHub 8003d91c4a Fixed: [CPControl setTextColor:] was missing theme state attribute (#2828) 2020-03-11 10:20:04 +01:00
Didier KorthoudtandGitHub a4ef18ddab FIXED: Before this PR, only CPControl could use nib2cib-adjustment-frame. (#2831) 2020-03-11 10:17:14 +01:00
daboe01andGitHub 82e55b4761 Fixed: _glyphsFrames and _glyphsOffsets could be used uninitialized in CPTextView (#2886) 2020-03-03 17:04:52 +01:00
Didier KorthoudtandGitHub 3a51c386ca Fixed: Before this PR, a click in a not first key responder CPTextField would misplace the caret if text alignment was not CPLeftTextAlignment #2887
Adapts the calculation of where in the textfield text the mouse is clicked to take in account the text alignment
2020-03-03 17:02:42 +01:00
Didier KorthoudtandGitHub 9868519cc0 Fix: Before this PR, the method attributeBySettingValue ignored existing values #2888 2020-03-03 16:43:29 +01:00
Didier KorthoudtandGitHub 038c007915 FIXED: Before this PR, CPButton never declares that its label should be single line (#2889) 2020-03-03 13:44:07 +01:00
Didier KorthoudtandGitHub ba6350e24d NEW: CPSplitView modern Cocoa behavior implementation (#2876) 2020-02-21 14:32:53 +01:00
Martin CarlbergandGitHub 1c866931f3 New: The compiler will now create warnings for variables that are never read (#2871)
This new warning adds a lot of warnings in the Cappuccino frameworks. I have turned off
the warning in the Jakefiles when compiling most of the Cappuccino frameworks. But it is
on as default for any user projects.

So there is also a new feature to turn off/on warnings as a compiler flag.

These flags are (all flags are on as default):
-Wunused-but-set-variable                    Warning when a local variable is never read.
-Wshadow-ivar                                Warning when a local variable is shadowing an instance variable for the class.
-Wcreate-global-inside-function-or-method    Warning when creating a global variable inside a function or method.
-Wunknown-class-or-global                    Warning when a class or global variable is not known.
-Wunknown-ivar-type                          Warning when the type for an instance variable is not known.

To turn off a flag add a 'no-' prefix. Example: -Wno-unused-but-set-variable

For an example how to use it in a Jakefile please look at the Jakefiles in this commit.
2020-02-21 14:29:48 +01:00
cacaodevandGitHub b7aff28b5e Merge pull request #2884 from daboe01/documentation-for-attributedStringWithAttachment
fixed: documentation for attributedStringWithAttachment: was missing
2020-02-04 13:14:45 +01:00
Martin CarlbergandGitHub 7dc77ed609 Fixed: Make sure we handle undefined when testing for nil values (#2862) 2020-01-31 13:43:58 +01:00
daboe01 d1bfe62a65 removed: obsolete fixme comment 2020-01-12 17:08:23 +01:00
daboe01 f7c8f24bff removed dead code 2020-01-11 15:13:30 +01:00
daboe01 055d63eeb5 formatting 2020-01-11 15:13:04 +01:00
daboe01 ef7f92ed15 fixed: documentation for attributedStringWithAttachment: was missing 2020-01-11 15:09:41 +01:00
daboe01andMartin Carlberg 8daa53dd3e Fixed: CPTextView keyboard issue in recent Firefox versions (#2874)
Wrong characters were sometimes emitted in keyboard events on Firefox
2020-01-07 12:34:39 +01:00
Martin CarlbergandGitHub 109003ae12 Fixed: Performance improvement on visibleRect when updating tracking areas (#2881)
Calculations of the visible rect can be a heavy operation as it depends of the superviews
visible rect. They have to be transformed and intersected together to create the result.
This calculation is a recursive operation that travels up the view hierarchy all the way
to the top.

Updating the tracking areas is also a recursive operation. But it travels down the view hierarchy
instead. It will calculate the new tracking area using the visible rect for the current view. For
each view it updates it will get the visible rect that has to travel all the way up the view
hierarchy to calculate it by transform and intersect them together. This results in that the visible
rect will be calculated for each view multible times. This makes it a very slow operation, specially
for deeper view hierarchies.

This fix will send along the visible rect for the superview when traveling down the
view hierarchy. This means that the visible rect does not need to travel up the view hierarchy
to be calculated. It will just need transform and intersect the provided rect for its superview
with the one from itself.
2020-01-06 12:48:40 +01:00
Martin CarlbergandGitHub 36f1abdbe6 Fixed: CPAppearance has much better performance now when views needs layout. (#2880)
This makes updating views much faster when they need layout. This will make resizing browser window and changing split views sizes much smoother.

The effectiveAppearance is inherited from the superview. The superviews appearance is passed along as it is recomputed down the view hierarchy.
Also the current appearance is saved on each view to make it possible to only change the theme states when the appearance is changed.
2020-01-06 12:35:38 +01:00
Martin CarlbergandGitHub 50519776e0 Fixed: Update Tracking areas only once when doing setFrame: (#2879)
This speed improvement is very notable when resizing a browser window of altering the size of split views.
The fix uses a variable on the window to control when to update the tracking areas.
If the view is not connected to a window the tracking areas will not be updated as they will
be when added to a window.
2020-01-06 12:32:35 +01:00
daboe01andMartin Carlberg 9e289574ff Fixed: attachment support was missing in CPTextView (#2872) 2019-12-19 09:08:33 +01:00
cacaodevandGitHub 2d96b06d4c Merge pull request #2878 from didierkorthoudt/CPButton-continous-bug
FIXED: Before this PR, disabled buttons that were continuous responded to mouse clicks
2019-12-17 13:27:06 +01:00
Didier Korthoudt 3f9e1c6c47 Continuous fix 2019-12-15 10:48:21 +01:00
jasperdebandMartin Carlberg 58c08cebd7 Fixed: Added underline support in CPTextView (#2875) 2019-12-06 09:12:31 +01:00
Martin CarlbergandGitHub aaed1a934e Fixed: When in modal mode make sure a focus event will make the modal window the key window (#2867)
The default was to make the first window in the most background layer the key window if nothing else was used.
This does not work well if there is a modal window that should have all the attention.

This solution will first choose the modal window if in modal mode. If not the old variant is used.
2019-11-27 19:16:03 +01:00
Martin CarlbergandGitHub 11639af26e Fixed: Let the text field handle key commands when it is selectable. (#2868)
There was a problem introduced by pull request #2600 when trying to select and copy text in a selectable text field.
The problem only occurs when the text field is in a modal window.

It was caused by the modal run loop that is present as an eventListener on the CPApplication when in modal mode. It will
force a bail out from the sendEvent: method in CPApplication when trying to handle the event. As the check for key
equivalent is moved down by the #2600 pull request it will never be allowed to handle a copy command from the browser
menu or key equivalent.

The solution is to allow the text field to handle the event if it is selectable. This will also allow the text selection
to be altered from the keyboard with keys like shift-left/right/up/down arrow. Combinations like shift-option arrow also
work for whole word selection.
2019-11-26 09:20:47 +01:00
cacaodevandMartin Carlberg 623ad2b1dc Fixed: Previoulsly, clearsFilterPredicateOnInsertion was applied (removes filter predicate) when setting content or on content binding. (#2860)
With Tests: Foundation unit test.
Solves #2791
2019-11-12 14:02:35 +01:00
daboe01andMartin Carlberg ce4fa3c027 Fixed: Pressing capslock inserted whitespaces under certain conditions (#2857)
This was present in a CPTextView.

A press on caps lock should also result in a flagsChanged event.
An event should have the corresponding flag for caps lock in modifierFlags.
2019-09-10 08:34:07 +02:00
cacaodevandGitHub 78cbc3871e Merge pull request #2852 from mrcarlberg/msg_send_return_undefined_when_receiver_is_undefined
New: msgSend will return undefined instead of nil when the receiver is undefined.
2019-08-31 11:28:17 +02:00
Martin Carlberg f666367b5d Fixed: Optimization for bindings with longer key paths in table views.
This prevents a buildup of large arrays with a lot of values and then choose one row and throw away the rest. This is great for speed and a must for lazy loading.

Previous there was a optimization for this but it was only effective for short combined key path like 'a.b'. This pull request makes it effective for any kind of length of a combined key path like 'a.b.c.d...'.

This is done by returning the object at a row in the first found CPArray in the key path
that is divided in a first and second part.
The first part is never a combined key path. The second part can be a combined key path.
If this optimization is not done we will create an array with the valueForKeyPath value on each row and then pick
the wanted value for the row and throw away all the other rows. It is much more effective to first
pick the row and then do the valueForKeyPath on the rest of the key path.
2019-06-26 09:37:40 +02:00
Martin Carlberg 81c02f24c6 New: msgSend will return undefined instead of nil when the receiver is undefined.
The msgSend function has always returned nil if the receiver has been nil or undefined.
Example:

var a = undefined;
var b = [a someSelector]; // b = nil

The variable b is now nil.

This pull request adds the ability for the msgSend function to return undefined if the receiver is undefined. If the receiver is nil it still return nil.
The above example again:

var a = undefined;
var b = [a someSelector]; // b = undefined

The variable b is now undefined.

Background.
The use of nil in Objective-C corresponds to the use of null in C and C++ and stands for "no value". A fundamental function in Objective-C is when you send a message to a receiver that is nil the result is again a nil value. This can be very convenient as you don't need the check if a receiver is nil before sending a message to it.

Objective-J adds the ability the use class structures and message send functionality for Javascript in the same way as Objective-C adds this to C and C++. Javascript also has the value null and is handled in the same way for Objective-J. Javascript also has the value undefined that stands for "not yet defined". This can sometimes be confusing and many try to handle null and undefined as the same thing. This is almost what Objective-J and the Cappuccino frameworks always has been doing. They try to always check for both null and ``undefined and always return nil but never undefined. We can say that Objective-J understands undefined but will try to translate it to nil.

Why do we need this change.
Javascript has both null and undefined and Objective-J is a superset of Javascript. It is now very hard to use undefined in Objective-J code as it will always try to translate it to nil. There are some Javascript libraries that use both null and undefined values and they are very hard to use from Objective-J programs today.  Same if you decide to use nil and undefined as a value in your own Objective-J code. This small change will make undefined a full member of the Objective-J language. It should be as it is a superset of Javascript. The Cappuccino frameworks will still handle undefined but only return nil.

How will it impact.
Today most methods will never return undefined so this is a very limited problem. If any does this the main concern is if some code will only check for nil and not undefined.
Example:

var a = [someObject someSelector];
If (a === nil) a = 42;
...

If the variable someObject contains undefined the variable a will now be set to undefined instead of nil.  But the variable a will then never be set to 42.
The correct way is to check for both nil and undefined like this:

var a = [someObject someSelector];
If (a == nil) a = 42;
...
2019-06-24 17:36:15 +02: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
daboe01andMartin Carlberg 1a7ced34a7 Fixed: smart copy/paste cycle was leaving an additional whitespace on the LHS (#2776) 2019-06-13 16:17:52 +02:00
Didier KorthoudtandMartin Carlberg eeba5087b1 Fixed: Before this, under certain circumstances, CPControl didn't declare its tracking areas soon enough (#2827) 2019-06-13 16:12:52 +02:00
daboe01andMartin Carlberg 129ca185e4 Fixed: backspace triggered page back in FireFox (#2849) 2019-06-13 15:59:35 +02:00
daboe01andMartin Carlberg eb55e4def6 Fixed: keyboard issues from FF66 alignmets to the other major browsers (#2847) 2019-05-24 12:57:57 +02:00
Alexandre WilhelmandGitHub acda834ad9 Merge pull request #2819 from daboe01/CPFontManager-duplicate-methods-removal
fixed: removed outdated duplicate method definitions in CPFontManager.j
2019-04-14 20:02:22 -07:00
Alexandre WilhelmandGitHub aba3e30d9c Merge pull request #2824 from daboe01/cpdocumentcontroller-return-type-fix
fixed: return type of openUntitledDocumentOfType:display:
2019-04-14 20:01:36 -07:00
daboe01 26cbe17218 fixed: wrong return type of textField method in 2019-04-08 14:39:02 +02:00
daboe01 fc8f1dca4e fixed: return type of openUntitledDocumentOfType:display: 2019-04-08 14:32:06 +02:00
Alexandre WilhelmandGitHub 6b20a4f8f7 Merge pull request #2786 from didierkorthoudt/CPStepper-enabled-from-IB
FIXED: CPStepper was not receiving the enabled status from IB
2019-04-03 15:15:22 -07:00
Alexandre WilhelmandGitHub 1180789c0c Merge pull request #2823 from daboe01/CPBrowserDelegateMethodFix
fixed: CPBrowserDelegate_browser_imageValueForItem_ was defined twice
2019-04-03 14:37:33 -07:00
Alexandre WilhelmandGitHub ac056d4a06 Merge pull request #2822 from daboe01/cpcursor-fix
fixed: accidental creation of a global variable in CPCursor.j
2019-04-03 14:36:44 -07:00
daboe01 c612b13529 fixed: CPBrowserDelegate_browser_imageValueForItem_ was defined twice 2019-03-31 19:42:54 +02:00
daboe01 5f4c79f6c4 fixed: accidental creation of a global variable 2019-03-31 17:44:07 +02:00
daboe01 302cbf641e fixed: typo in initWithGraphicsPort: declaration 2019-03-31 17:37:44 +02:00
daboe01 4bc2e9ad44 fixed: removed outdated duplicate method definitions in CPFontManager.j 2019-03-31 17:24:03 +02:00
Alexandre WilhelmandGitHub 6853c4c212 Merge pull request #2779 from daboe01/textview-contextmenu
New: support contextmenus for CPTextView
2019-03-29 15:06:39 -07:00