Commit Graph
48 Commits
Author SHA1 Message Date
David Richardson b02e4c5308 Handle case when CPBox is used as a separator line having no title
If _titlePosition is correctly set to CPNoTitle value, class already handles removing title view from display.
Previously, _titlePosition was not correctly set, title view was left in place.
With no supplied value for title, outline of title view was rendered with visible artifacts.
2017-01-16 11:23:32 -07:00
Didier Korthoudt b3d8180541 FORMATTING: added comment to workaround 2016-01-21 00:10:38 +01:00
Didier Korthoudt 3411c340ab FIXED: incorrect view hierarchy update 2016-01-20 23:50:22 +01:00
Didier Korthoudt 4482089712 FIXED: corrected replaceSubview parameters order 2016-01-20 22:08:10 +01:00
Antoine Mercadal 00bdbcf857 FIXED: only set a content view of CPBox if it is not a separator 2016-01-19 16:10:31 -08:00
Antoine Mercadal bf8070c42d Revert "FIXED: Bug introduced by https://github.com/cappuccino/cappuccino/commit/9fba72cbab42145dc585c01efd82ce645373c04e#diff-227ef108401c2160357ae3fc65018c65R620"
This reverts commit ad48381744.
2016-01-19 16:08:59 -08:00
Antoine Mercadal ad48381744 FIXED: Bug introduced by https://github.com/cappuccino/cappuccino/commit/9fba72cbab42145dc585c01efd82ce645373c04e#diff-227ef108401c2160357ae3fc65018c65R620
The changes in CPBox were messing with the subviews encoding. This patch restores the previous behavior of CPBox.
The original bug might be reintroduced, but this was definitly not the good solution
2016-01-19 13:26:10 -08:00
Alexandre Wilhelm 9fba72cbab Fixed: nib2cib on a NSBox fails when having a CPTableView in it
Previously, when having a CPTableView in a CPBox, nib2cib failed due to a superview not defined yet. This was raised because in nib2cib we used the method setFrame on the CPBox to modify the frame of the CPBox (we need to modify this frame because the sizing difference between cappuccino and cocoa). We now directly modify the attribute _frame from the object and update the bounds in the same time.

This PR fixed another bug as well. Previously the contentView of the CPBox was not encoded, we now encode it. This allows us to get a full CPView object for the contentView, previously we got a weird (I have no idea how this object was created though...) object CPView with some missing attributes. This raised a crash because _trackingAreas or _themeState were not defined in this object.

Fixed #2400
2015-12-28 17:58:10 -08:00
Antoine Mercadal f9275a70af FIXED: New warnings reveleaded by ivar type checking
This patch fixes all new warnings
2014-11-06 10:17:05 -08: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
Aparajita Fishman ce0aadfcf7 Optimizations
No need to copy result of [self bounds], it's already a copy
2013-02-22 23:29:17 -05:00
Alexander Ljungberg 09b5eef617 Fixed: [CPBox setContentView:nil] crash.
This is allowed in Cocoa so should not crash Cappuccino either.
2013-02-22 14:42:36 +00:00
Aparajita Fishman abaa1e81f2 Support for multiple-value bindings
- CPView and subclasses support multiple-value hidden bindings.
- CPControl and subclasses support multiple-value enabled bindings.
- CPWindow and CPBox support multiple-value title with pattern bindings.
- CPButton supports multiple argument + target bindings.
- CPImageView and CPTextField support multiple-value editable bindings.
- CPMenuItem supports multiple-value enabled bindings.
- Fixed bugs in CPObjectController with simple collection operators.
- CPColorWell uses black as the placeholder color.
- Runtime object attributes from a cib are applied as they are read, not deferred.
- NSNumberFormatter now reads the number style from the xib.
- Normalized some parameter names.
- Formatting.
- Test app for all binding types.
2013-02-15 12:21:13 -05:00
Aparajita Fishman b6a520e350 Typos, formatting 2013-02-10 20:02:55 -05:00
Alexander Ljungberg 6b0565e9ab Fixed: CPBox with CPBezelBorder had unexpected inner shadow.
Without this fix, a CPBoxOldStyle box with a CPBezelBorder would draw with the correct border colour and fill, but with an additional inner shadow, unlike Cocoa.

This fix makes it so that only primary and secondary boxes draw with the special "well"-like shadow style.
2013-02-04 16:39:08 +00:00
Alexander Ljungberg 3d9b69a860 Fixed: broken corners on primary CPBox in Chrome.
In Chrome, a primary CPBox (showing the new recessed rounded corner look) had distorted and jagged edges in Chrome due to the clipping mask.

This fix places the clipping mask on integer coordinates which seems to resolve the problem.
2013-02-04 15:40:01 +00:00
Antoine Mercadal b23cadea59 Fix bugs in CPBox and improve the way we draw lines 2013-01-24 19:45:26 -08:00
Alexander Ljungberg d818615472 Missing import. 2013-01-20 16:35:48 +00:00
Alexander Ljungberg cb786a0166 Small CPBox optimisation.
No need to call `setNeedsDisplay:` after `setValue:forThemeAttribute:`.
2013-01-20 13:19:29 +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
Antoine Mercadal 82bb9a6008 Remove useless code in simple line CPBox 2013-01-16 13:42:46 -08:00
Alexandre Wilhelm 29d56b63f7 Fixed bug about border in CPBox lineBorder 2013-01-16 11:48:23 -08:00
Antoine Mercadal edc62449f6 Make CPBox themable 2013-01-04 18:45:05 -08:00
Alexander Ljungberg c3c61e1889 - CPBox titleView.
This method is the Cappuccino analog to `- NSBox titleCell`.
2012-10-24 15:32:45 +01:00
Alexander Ljungberg fd138cfae7 - CPBox setTitleFont support. 2012-10-15 01:10:08 +01:00
Antoine Mercadal eafbebcebb fix crash when setting title while to content view is set 2012-01-16 14:19:09 +01:00
Antoine Mercadal e8194d9c2e Fix some sizing problem with CPBox titles. close #1431 2012-01-14 12:31:12 +01:00
Antoine Mercadal f0e1b67197 Merge remote-tracking branch 'upstream/master' 2012-01-13 13:56:16 +01:00
Antoine Mercadal 5daa8cb289 Support for title in CPBox. close #1428 2012-01-13 13:51:50 +01:00
Aparajita Fishman 789d832808 Tab -> spaces 2012-01-12 18:44:19 +06:30
alexmipego e32515e5cc Make boxEnclosingView: copy the auto resizing settings of the view 2011-08-07 20:22:14 +01:00
Alexander Ljungberg 8ae94c2745 Put CPBox in the right documentation module and add some basic documentation. 2011-05-23 13:46:09 -04:00
Alexander Ljungberg ea8c29356d More typo and formatting fixes. 2011-01-24 13:17:48 -03:00
Stephen Ierodiaconou 6a942630e4 Fixing spelling mistakes 2011-01-24 11:05:48 +02:00
Brian DonovanandKlaas Pieter Annema 5a0129018a Fix spelling of "separator". 2010-11-09 10:33:49 +01:00
Klaas Pieter Annema 4817a87499 fix CPBox drawing the separator style between pixels 2010-11-05 13:05:43 +01:00
Mike Fellows 1c597eb0df Fix regression in CPBox's setBorder 2010-09-29 00:05:15 -07:00
Alexander Ljungberg 4dc102a3cf Applied coding standards. 2010-09-28 19:00:59 -04:00
Klaas Pieter Annema ffcbf87858 add basic support for drawing separators to CPBox 2010-09-28 14:50:20 +02:00
Aparajita FishmanandAlexander Ljungberg 6fbdf7b400 Support for NSBox in nib2cib and some fixes to CPDrawTiledRects/CPDrawColorTiledRects.
- The default box background color is now clear, that is what Cocoa does.

- Bezel drawing uses CPDrawTiledRects, obeys border width.

- CPDrawTiledRects/CPDrawColorTiledRects explicitly sets the line width and saves/restores the graphics state.

- Whitespace cleanup in CPBox.
2010-09-10 20:35:38 -04:00
cacaodevandRandall Luecke 23e9fd927c CPBox: Made CPBezelType the default type instead of none.
Slighly grayed stroke color for bezel type & fillColor for all types to better match cocoa
       Fix contentView autoresizingMask
2010-08-12 15:16:20 -05:00
saikatandRoss Boucher 489f2bcfa0 Reverting 1c9763eaa8 - autoresizing the contentview breaks sizetofit 2010-04-09 14:18:20 -07:00
Ross Boucher 1c9763eaa8 CPBox should autoresize its content view. 2010-03-26 16:41:23 -07:00
Nicholas SmallandRoss Boucher bc6f168afa Added some designated initializers to AppKit. 2009-10-09 00:03:52 -07:00
Ross Boucher 317f1d356c Add copyright info to CPBox 2009-09-22 17:23:54 -07:00
Ross Boucher 25f3d99732 Add support for CPBox. 2009-09-22 17:23:02 -07:00