280north / cappuccino
- Source
- Commits
- Network (138)
- Issues (139)
- Downloads (14)
- Wiki (36)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
3 comments Created 9 months ago by 280northfrom-lighthousexMissing functionality: plist read/writeFeaturexEverything is in title. ;)
Add initWithContentsOfURL:, initWithContentsOfFile:, writeToFile:atomically: and writeToURL:atomically: in CPArray and CPDictionary would be very useful.
This ticket has 1 attachment(s).
Comments
-
16 comments Created 9 months ago by 280north#acknowledgedxappkitxTabView add item - labels/tabs not displayedfrom-lighthousexcant get addTabViewItem:item to function, throws Uncaught TypeError: Cannot read property ’_superview’ of null
This ticket has 0 attachment(s).
Comments
TabView add item
Could you show me the code snippet?
by Francisco Tolmasky
TabView add item
var tabset=[[CPTabView alloc] initWithFrame:CPRectMake(10,10,300,300)];
var item1=[[CPTabViewItem alloc] initWithIdentifier:@"0"]; [item1 setLabel:@"test"]; [tabset addTabViewItem:item1]; var item2=[[CPTabViewItem alloc] initWithIdentifier:@"1"]; [item2 setLabel:@"test2"]; [tabset addTabViewItem:item2];[label setStringValue:[[tabset numberOfTabViewItems] stringValue]];
[contentView addSubview:tabset]; [contentView addSubview:label];by TG
TabView add item
var tabset=[[CPTabView alloc]
initWithFrame:CPRectMake(10,10,300,300)];
var item1=[[CPTabViewItem alloc] initWithIdentifier:@"0"]; [item1 setLabel:@"test"]; [tabset addTabViewItem:item1]; var item2=[[CPTabViewItem alloc] initWithIdentifier:@"1"]; [item2 setLabel:@"test2"]; [tabset addTabViewItem:item2];[label setStringValue:[[tabset numberOfTabViewItems] stringValue]];
[contentView addSubview:tabset]; [contentView addSubview:label];-----Original Message----- From: Lighthouse [mailto:support@lighthouseapp.com]
Sent: Thursday, September 04, 2008 11:41 PM
To: Tom Giannulli
Subject: [Cappuccino #10] TabView add itemby TG
TabView add item
Ah yes it’s because the tab view item doesn’t have an associated view ([item setView:myView]). I will check whether the expected behavior should be to raise an internsalinconsistencyexception or to just show nothing in the tabview.
For right now though, if you just do [item setView:[[CPView alloc] initWithFrame:CGRectMakeZero()]]] it should work though.
by Francisco Tolmasky
TabView add item
The error is solved but the tabs/labels are not displayed
by TG
TabView add item - labels/tabs not displayed
var tabset=[[CPTabView alloc] initWithFrame:CPRectMake(10,10,300,300)];
var x=@"tab1"; var y=@"tab2"; var item1=[[CPTabViewItem alloc] initWithIdentifier:x]; [item1 setLabel:@"test1"]; [item1 setView:[[CPView alloc] initWithFrame:CPRectMake(0,0,0,0)]]; [tabset addTabViewItem:item1]; var item2=[[CPTabViewItem alloc] initWithIdentifier:y]; [item2 setLabel:@"test2"]; [item2 setView:[[CPView alloc] initWithFrame:CPRectMake(0,0,200,200)]]; [tabset addTabViewItem:item2]; [tabset setTabViewType:CPTopTabsBezelBorder]; [label setStringValue:[[tabset numberOfTabViewItems] stringValue]]; [contentView addSubview:tabset];by TG
TabView add item - labels/tabs not displayed
I confirm this as well. To be on the safe side I checked on Safari and FireFox, and neither display anything. I looked through the source a bit, and couldn’t find any trickery to force it to display the labels.
by Will Larson
TabView add item - labels/tabs not displayed
Could you try setting the tabViewType earlier, like right after you create the tab view itself. Not that this wouldn’t be a bug, just trying to identify where the problem is.
by Francisco Tolmasky
TabView add item - labels/tabs not displayed
Tried your suggestion, but isn’t working for me. Here is my source:
@@@ javascript
-(void)setupTabView: (CPView)contentView { var bounds = [contentView bounds]; var frame = CGRectMake(CGRectGetMinX(bounds)+75,
CGRectGetMinY(bounds)+100, CGRectGetWidth(bounds)-150, CGRectGetHeight(bounds)-200);tabView = [[CPTabView alloc] initWithFrame:frame]; [tabView setTabViewType:CPTopTabsBezelBorder]; [tabView layoutSubviews]; [tabView setAutoresizingMask: CPViewHeightSizable | CPViewWidthSizable];
webSearchTabItem = [[CPTabViewItem alloc] initWithIdentifier:@"web"]; imageSearchTabItem = [[CPTabViewItem alloc] initWithIdentifier:@"image"]; newsSearchTabItem = [[CPTabViewItem alloc] initWithIdentifier:@"news"];
webView = [[CPView alloc] initWithFrame:CPRectMakeZero()]; imageView = [[CPView alloc] initWithFrame:CPRectMakeZero()]; newsView = [[CPView alloc] initWithFrame:CPRectMakeZero()];
[webSearchTabItem setLabel:@"Web"]; [imageSearchTabItem setLabel:@"Image"]; [newsSearchTabItem setLabel:@"News"];
[webSearchTabItem setView:webView]; [imageSearchTabItem setView:imageView]; [newsSearchTabItem setView:newsView];
[tabView addTabViewItem:webSearchTabItem]; [tabView addTabViewItem:imageSearchTabItem]; [tabView addTabViewItem:newsSearchTabItem];
//[tabView _createBezelBorder]; [contentView addSubview:tabView]; }
@@@
by Will Larson
TabView add item - labels/tabs not displayed
Sorry for formatting: http://dpaste.com/77487/ is formatted paste.
by Will Larson
TabView add item - labels/tabs not displayed
I’ve been able to narrow down the issue (and find a work around): if you add the tabView to its parent view before adding the tab items, then it works correctly (creates labels and displays the tabViewItem’s view when the tab is selected).
However, if you add the tabViewItems before adding the tabView to the parentView, then it neither creates the labels nor displays the tabViewItem’s view as appropriate.
by Will Larson
TabView add item - labels/tabs not displayed
Great reduction WIll, I think I should have a fix for this soon.
by Francisco Tolmasky
TabView add item - labels/tabs not displayed
by Francisco Tolmasky
TabView add item - labels/tabs not displayed
The issue here is that we delay creating the tab view borders and items as long as possible, so that we prevent unnecessarily loading images that we may not need.
As a side effect, there’s a view we haven’t created yet, and we’re just sending messages to nil. This is why it’s not working. There’s also a related bug with trying to change a view out from under it later.
Essentially, the way this all works needs to be redesigned to work more like the menu system. Since it isn’t a trivial change, I’m moving it off 0.5.2. I’m also not planning on committing a stop gap measure, since the workaround is noted above. Just add items after adding the tab view to your content view.
by Ross Boucher
TabView add item - labels/tabs not displayed
I’ve been able to reproduce this in 0.7b.
Here is the sample code :
http://gist.github.com/83994by Thomas Balthazar
Please log in to comment.Didn't I already fix this?
http://github.com/nciagra/cappuccino/commit/f4aa7032f10107858a75971b6a83560bb1d09cd9
-
10 comments Created 9 months ago by 280northfoundationx@boucherx-hash is broken on CPArrayfrom-lighthousexIt breaks the contract that two arrays which are -isEqual: also need to report the same -hash value.
Patch and tests included
It’s also the same way that GnuStep and Cocotron implement this - I was quite surprised how simple they implemented it.
:)
This ticket has 1 attachment(s).
Comments
-hash is broken on CPArray
Why do both array’s need to return the same hash value? That doesn’t seem to be documented anywhere in the Cocoa docs.
This code seems incredibly dangerous to me. You’re essentially saying that all kinds of arrays that have nothing to do with each other could be considered equal. This will break anything that uses hash as a unique identifier (for example, KVO/Bindings, and I’m sure other code in Cappuccino).
by Ross Boucher
-hash is broken on CPArray
I spoke before I understood what I was talking about.
From the documentation for hash:
@"If two objects are equal (as determined by the isEqual: method), they must have the same hash value. This last point is particularly important if you define hash in a subclass and intend to put instances of that subclass into a collection."
Our implementation of hash does not behave this way. Perhaps we should consider changing our hash to become address, and re-implementing hash the Cocoa way?
by Ross Boucher
-hash is broken on CPArray
I’m not sure I understand you correctly, -[CPObject hash] does return __adress, I haven’t checked all the other objects, but all objects who redefine -isEqual: need their own implementation that matches the contract.
The one which I provided for CPArray - and I checked it against the two other Cocoa implementations I know, which do it the same way. (Also it makes sense: The Implementation needs to be FAST, and it needs to be the same when two objects are -isEqual:
I also checked against some examples on Cocoa and it behaves the same way.
by Martin Häcker
-hash is broken on CPArray
My point was that -hash works differently in Cappuccino than in Cocoa (something I previously had not realized).
We need access to __address as a method, which is what hash has been doing for us. To make -hash actually correct, we’ll need to add -address and update all of the cappuccino code that relies on hashes being globally unique.
by Ross Boucher
-hash is broken on CPArray
Too late to finish sentences...
The one which I provided does fit the contract and also behaves the same way that the others do.
by Martin Häcker
-hash is broken on CPArray
Yes, but it breaks parts of Cappuccino that expect the current behavior. For example, KeyValueObserving and CPWindow both rely on the value of -hash as a unique index into various data structures.
by Ross Boucher
-hash is broken on CPArray
Oh damn.
I just had a look around in the source and lots of objects like CPDictionary, CPData, CPDate and CPNull don’t overide -hash but should. (And most should probably also overide isEqual:)
Uh oh....
Yes, this is going to take some work.
by Martin Häcker
-hash is broken on CPArray
Can’t resist...
As a good person once said: In God we trust - for everything else we have UnitTests.
:)
by Martin Häcker
Please log in to comment.I've taken the first steps to remedy this by replacing all current instances of -hash with the new -UID method, so that when we change hash in the future, it won't break anything.
-
4 comments Created 9 months ago by 280northCertain regular expressions break the parserfrom-lighthousexHi there,
I am trying to use Douglas Crockfords javascript json implementation at http://www.JSON.org/json2.js
(I am trying to reproduce another bug in the json component of cappuccino)
The problem is, that when @import this file with @import "json2.js" my unittests fail with this error message
json2.js
Expected ’]’ - Unterminated message send or array. OBJJ EXCEPTION: Expected ’]’ - Unterminated message send or array.
Name: OBJJParseException Message: undefined File: undefined Line: undefinedI haven’t yet reduced this to why it fails - but I suspect some of the more complex Regexes in there might be the source of the problem.
Please fix it!
Regards,
MartinThis ticket has 0 attachment(s).
Comments
@import "json2.js" breaks
I’d like to add that just copying the source in a obj-j file also breaks the interpreter - it seems the parser somehow gets confused on the correct javascript code in that file.
by Martin Häcker
tlrobinson
Mon May 04 18:03:53 -0700 2009
| link
There are known problems with certain regexes confusing the Objective-J parser.
A workaround is to use the "new RegExp()" form of creating regular expressions (properly escaping \ " ' etc). Alternatively you could include json2.js using a
Please log in to comment.
tlrobinson
Sat Jun 06 14:16:11 -0700 2009
| link
We now include json2.js in Objective-J so I'm changing this title to the reflect the more general problem with regexes breaking the Objective-J parser.
-
9 comments Created 9 months ago by 280north#need-answerx@tolmaskyxPartial, working CPScanner and CPCharacterSet.from-lighthousexCPScanner and CPCharacterSet are useful in many situations, but are missing. Attached is a skeleton implementation of both of them that, while not implementing all methods of the corresponding Cocoa classes, is already useful.
See the comments in the code for more details.
This ticket has 1 attachment(s).
Comments
Partial, working CPScanner and CPCharacterSet.
Sorry I haven’t gotten around to reviewing/checking this in yet, I’ll try to do so tomorrow (today).
by Francisco Tolmasky
Partial, working CPScanner and CPCharacterSet.
by Francisco Tolmasky
Partial, working CPScanner and CPCharacterSet.
Hey millenomi, could you do a pass over this and make it so it conforms to our new style guidelines ( http://cappuccino.org/contribute/coding-style.php ). If not I could do so, but I figure you’d prefer to do it yourself. Also, before we get this in we’ll need you to sign a contributor agreement, which we should hopefully have by the end of today or tomorrow.
by Francisco Tolmasky
Partial, working CPScanner and CPCharacterSet.
Any update on this?
by Ross Boucher
Partial, working CPScanner and CPCharacterSet.
This patch would be very useful with some trivial fixes in the following methods of CPScanner.
1/
-(BOOL)_performScanWithSelector:withObject:into: (see comments in the code about how to handle references)2/
- (CPString) scanUpToString:(CPString)s should be rather - (BOOL) scanUpToString:(CPString)s intoString:(CPString)value and set the captured string into value (value is a reference).millenomi, we need you, please come back to finish this important contribution.
by cacaodev
CPCharacterSet and CPScanner are in this repository : http://github.com/cacaodev/cappuccino/tree/master
It's mainly working. Missing methods are included in the file in case you want to finish the job.
I know this sounds obnoxious, but one of the things needed here is some style improvements. In particular, spacing is pretty inconsistent, as are brackets, same line returns with single if statements, some more minor stuff. Accessing window explicitly is generally not a great idea (window._CPCharacterSetTrimAtBeginning = ...).
Francisco can probably comment better on more technical concerns.
I fixed the same line return (or anything) with single line statement. Can you explain to me what is the problem with spacing and brackets because i don't see. I'm following the rule "one bracket = one line" except maybe for one while loop. Also accessing global from window seems to be a workaround done by the original author (millenomi). He says that globals are not exposed to other files. Maybe because globals have to be at the beginning of the file ?
Please log in to comment.Well, for example, many lines use 2 spaces for a tab, while others use 3, and still others use 4. Some lines are not properly indented at all. Cappuccino prefers that all code be properly intended, using 4 spaces in place of a tab.
Global variables are accessible outside of the scope of the file, var'd variables are not. Putting a var indicates file level scope, while leaving the var out will make it global.
I'm also not sure what those two variables are for. They have an underscore, indicating that they aren't meant to be "public", and yet they also need to be global? I don't see a corresponding NS* in the Cocoa docs, but maybe I just missed it.
-
1 comment Created 9 months ago by 280northappkitxsetAllowsMultipleSelection: and setSelectable: do not allow multiple selections in CPCollectionViewfrom-lighthousexComments
Please log in to comment.setAllowsMultipleSelection: and setSelectable: do not allow multiple selections in CPCollectionView
toggleIndexInSelection:
http://github.com/camwest/cappuccino/commit/04abd8bad1f3ab870e7d01287de04c7434aebb6e
selectRangeFromIndex:toIndex:
http://github.com/camwest/cappuccino/commit/8a471cc838c029fd0c90e1b13012214a720930e9
Minor Code Tweaks:
http://github.com/camwest/cappuccino/commit/e674dbd99629504502f7c3ddf974ce7a944cdb5e
http://github.com/camwest/cappuccino/commit/7bc879b20d1e4627a1cc178cc4c221c94377bf7bby Cameron Westland
-
0 comments Created 9 months ago by 280northappkitxfrom-lighthousexImplement CPPopUpButton's -sizeToFitFeaturexComments
Please log in to comment. -
5 comments Created 9 months ago by 280north#to-acknowledgexappkitx@boucherxCPTextField focus doesn't work through different windowsfrom-lighthousexThe new focus rings are great. But, if you have a text field in one window (for example, the menu bar), and another text field in another window, there is an issue. Focus the first text field in the menu bar. Then, while it is still focused, focus the second text field in the other window. Both of them will now be "focused", with focus rings, and neither (sometimes one) will allow input.
This ticket has 1 attachment(s).
Comments
CPTextField focus doesn’t work through different windows
Attached test case.
by nciagra
CPTextField focus doesn’t work through different windows
Temporary fix committed.
by Ross Boucher
CPTextField focus doesn’t work through different windows
by Ross Boucher
Please log in to comment.Commited to http://github.com/stevegeek/CappuccinoBugs , however the behaviour seems to now have been corrected. Unless this is only the temporary fix mentioned above.
-
1 comment Created 9 months ago by 280north#to-reviewxappkitxCPControl : implement setTootTip:from-lighthousexCould be something like this:
@@@ javascript
-(void)setToolTip:(CPString)aToolTip {
if (_toolTip == aToolTip) return; _toolTip = aToolTip;if PLATFORM(DOM)
_DOMElement.title = aToolTip;endif
}
@@@
Maybe we need test cases for critical situations like when a view with a toolTip displayed is removed from the superview ...
This ticket has 0 attachment(s).
Comments
-
6 comments Created 9 months ago by 280north#to-reviewxfoundationx@boucherxCPPredicate suitefrom-lighthousexAlmost complete except:
- predicateWithFormat: > relies on CPScanner - Some new 10.5 methods - Some functions in CPExpression_function.j - MATCHES[d] (regex match diacritic insensitive) - expressions constants are not castedNeeds a lot of testing. A basic test case will follow.
This ticket has 5 attachment(s).
Comments
CPPredicate suite
Very basic Test case for CPPredicate.
Creates various CPExpression (constant, keypath, function, aggregate)
Creates a CPCompoundPredicate from 2 CPComparisonPredicate
Filters an array with the predicate.by cacaodev
CPPredicate suite
Improved version.
- fixed bugs in CPComparisonPredicate evaluation for strings - Support for CPMacthPredicateOperatorType (javascript regex) - Partial support for CPDiacriticInsensitive option. Not covering all diacritics. - cleaned code in evaluation of compound predicates. - Added aggregate expressionComing next: unionset, minusset, subquery expressions. (10.5 new methods in NSPredicate).
Feel free to implement predicateWithFormat: . We need a parser for that so it could be CPScanner or another way to parse (lex ?).
I will post a ojunit test later if needed.
by cacaodev
CPPredicate suite
This is the last version with a lot of code style cleaning.
Also supports for unionset, intersectset, minusset.
predicateWithFormat: still missing.These are raw files are in a zip. I can also give you a patch against Foundation but anyway you will have to add import directives in Foundation.j yourself because I’m not sure what’s the right way.
Included: CPPredicateTest.j importing CPPredicate from Foundation.
If you have any comments, even code style, I prefer that you post it bellow.
by cacaodev
CPPredicate suite
An updated version of CPPredicate & al with a test case have been pushed into my fork.
http://github.com/cacaodev/cappuccino/tree/master
by cacaodev
CPPredicate suite
Please forget the previous comment.
Here is the commit url in my fork:
http://github.com/cacaodev/cappuccino/commit/6ecc557abb06a21f044778bc3a114d1f2ad8c1c4And attached is a new patch matching this commit:
by cacaodev
Please log in to comment.Added documentation for CPPredicate, CPComparisonPredicate, CPCompoundPredicate and CPExpression.
http://github.com/cacaodev/cappuccino/commit/95550024e9a592feba92099d861187bc53313cd9
-
0 comments Created 9 months ago by 280north#to-acknowledgexCPEvent's buttonNumber is not fully implementedfrom-lighthousexThe buttonNumber message returns the value of _buttonNumber, which doesn’t exist in the CPEvent class.
Looking at mouseEventWithType, I notice that it probably lacks a buttonNumber param.
This ticket has 0 attachment(s).
Comments
Please log in to comment. -
Having a semi-transparent CPToolbar, CPPopUpButton button and such to go along with the HUD windows will be great.
This ticket has 0 attachment(s).
Comments
Please log in to comment. -
0 comments Created 9 months ago by 280north@tolmaskyxfrom-lighthousexfunction args should come before ivars in the scope chainFeaturex -
3 comments Created 9 months ago by 280northfrom-lighthousexNeed for a CPOpenPanelFeaturexIt would be useful to have an implementation of NSOpenPanel in Cappuccino. I can see two scenarios where they would be useful.
One is to let the user select a file on their local file system. The app could upload the file to a server and then make it available to the user.
Or the panel could be used to select a file on a remote server. If the user has a remote library of files, like 280 Slides does, this would be a way to select one of these files for opening.
This ticket has 0 attachment(s).
Comments
Need for a CPOpenPanel
This is a challenging task. The first goal is essentially impossible, at least, sort of.
Web apps can’t talk to the native file system, and that isn’t likely to change in the near future. The only exception is using the "File Upload" mechanism (input type="file").
We do need to build support for this into Cappuccino (we have it in 280 Slides, and have the sample code in our gist pastebin). However, beyond that, there’s essentially nothing we can do with respect to local file system files.
As for a generic open panel for remote server files, this is a worthwhile goal, but it isn’t obvious how it would work. The interaction is very server component specific. How do I get a list of available files? Do I support folders? Are there previews for these files available? Metadata?
It may be that we’ll make a set of default assumptions, built a somewhat generic looking open panel, and then see where it takes us, but right now I think the project is better served by focusing on slightly more generic tasks (specifically ones that don’t require us to worry about server interaction).
All that being said, if someone wants to volunteer to work on this, then that’s great. I’m happy to think things through with someone.
We can also consider releasing the 280 Slides open panel as sample code. It would not be directly reusable (its fairly specifically oriented towards slides), but it would be a reasonable starting point for anyone.
by Ross Boucher
Need for a CPOpenPanel
The Import Button on the 280slides.com does not seem to work for Opera.
by Thrinz
Please log in to comment.Need for a CPOpenPanel
It also doesn’t work in some versions of IE, but I haven’t been able to determine which versions....
It’s not part of Cappuccino though, and for several reasons.
by Ross Boucher
-
5 comments Created 9 months ago by 280north#acknowledgedxappkitxfrom-lighthousexCPSplitView doesn't honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window@tolmaskyxIf I have the following method in a CPSplitView delegate:
@@@ - (int)splitView:(CPSplitView)splitView constrainMinCoordinate:(int)minCoord ofSubviewAt:(int)index {
if (index == 0) { return 200; } else { return minCoord; }} @@@
it correctly keeps the subview at index 0 from ever being less than 200 pixels wide when moving the splitter around.
But if I resize the window and make the window smaller, the subview does get resized with a width less than 200 pixels...
I added a log message to the above method to check whether it ever gets called. When resizing the window, the method never gets called. It gets called plenty when moving the splitter.
This ticket has 1 attachment(s).
Comments
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
The docs on Apple’s page say the following:
This method is invoked before the NSSplitView begins tracking the cursor to position a divider. You may further constrain the limits that have been already set, but you cannot extend the divider limits. proposedMin is specified in the NSSplitView’s flipped coordinate system. If the split bars are horizontal (views are one on top of the other), proposedMin is the top limit. If the split bars are vertical (views are side by side), proposedMin is the left limit. The initial value of proposedMin is the top (or left side) of the subview before the divider. offset specifies the divider the user is moving, with the first divider being 0 and going up from top to bottom (or left to right).
So it sounds like it should only be called during repositioning of the divider. Could you possibly do a test against Cocoa to see whether this is actually the case?
by Francisco Tolmasky
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
Ok, I wrote a little cocoa app and this method does get called when the window is resized as well as when the divider is repositioned.
I attached the project if you care to see for yourself...
by Patrick Crosby
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
Cool, I’ll try to fix this tomorrow then
by Francisco Tolmasky
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
This hasn’t been fixed in 0.7b yet.
Here is a test case :
http://gist.github.com/83999by Thomas Balthazar
Please log in to comment.http://github.com/stevegeek/CappuccinoBugs/tree/master/i0041/ I have commited the test here, and I do not see the problem anymore
-
1 comment Created 9 months ago by 280northfrom-lighthousexImplement revertFromSaved:FeaturexThis ticket has 0 attachment(s).
Comments
-
1 comment Created 9 months ago by 280north#acknowledgedx@tolmaskyxAdd references to Objective-J @reference?from-lighthousexIt would look something like this:
- (void)myMethod:(ref CPString)aString
{
aString("new value")
}
[Object myMethod:@reference(myString)];
@dereference would allow you to talk to it:
[@dereference(stringReference) length]
Essentially, @reference(X) is a macro that becomes
function (value) { this.set = function(x) { X = x; } this.get() { return x; } }
@dereference(X) is a macro that becomes
X.get()
More or less.
This ticket has 0 attachment(s).
Comments
- (void)myMethod:(ref CPString)aString
{
aString("new value")
-
2 comments Created 9 months ago by 280north#acknowledgedxImprove the parser to detect syntax errorsfrom-lighthousexI can throw a lot of invalid syntax into a .j file and it will run without even a warning. Surely syntax errors should be of the highest possible severity?
It’s quite scary to think that a well meaning parser can discard things I write in my source code without even mentioning it.
It also makes me wonder if the parsing could be a lot more efficient.
Would you guys like some input in this area? I’m not an expert but I know a little bit about LALR(1) grammars and lexical analysis (another area of the source that looks like it could use some improving - long piped regexes are generally slower than checking several smaller regexes and switching states).
Clearly it’s a hugely complex area but it’s certainly something that needs to be as close to 100% spot-on as possible :)
This ticket has 0 attachment(s).
Comments
Improve the parser to detect syntax errors
By all means take a stab at it.
by Francisco Tolmasky
Please log in to comment.Improve the parser to detect syntax errors
Ok, no promises but I’ll give it a shot and see if I can provide a patch.
by Chris Corbyn
-
3 comments Created 9 months ago by 280north#need-answerxObjective-J preprocessor chokes on certain RegExp literalsfrom-lighthousexThis ticket has 0 attachment(s).
Comments
Objective-J preprocessor chokes on certain RegExp literals
(from [abbbc6e]) Replaced regex literals with RegExp objects, due to bug [#117] http://github.com/280north/cappuccino/commit/abbbc6e8f09b9bee14f7b794c83712492ee1cffd
by admin (at 280north)
Objective-J preprocessor chokes on certain RegExp literals
Yes it does
by Francisco Tolmasky
Please log in to comment.Is this still valid? which expressions cause it to choke?
-
3 comments Created 9 months ago by 280north#need-answerxappkitxCPWindow setMinSize does not set overflow properlyfrom-lighthousexCPWindow includes utilities to setMinSize and setMaxSize. While these seem to work correctly, when the user resizes the window to less than it’s minimum size, the overflow of the window/contentView should be changes to add browser scroll bars into the window.
This ticket has 0 attachment(s).
Comments
CPWindow setMinSize does not set overflow properly
CPWindow can not (or at least should not be able to) be resized smaller than its minimum size, or larger than its maximum size. I’m not sure what you’re proposing.
by Ross Boucher
CPWindow setMinSize does not set overflow properly
Sorry, I meant to specify this is relating only to the bridge window. By default, you remove the browsers scroll bars. However, I feel that the bridge window’s setMinSize should implement special behavior to add the browser’s scroll bars back if the user resizes their browser to less than the minimum size (which is not prevented by setMinSize).
by nciagra
Please log in to comment.CPWindow setMinSize does not set overflow properly
We should just prevent this from happening, that can be done right?
by Francisco Tolmasky
-
2 comments Created 9 months ago by 280north#need-answerxMultiple non Javascript-native instance variable declarations per-line don't workfrom-lighthousexCappuccino appears to have a problem with having instance variables declared in a class where the type is non Javascriopt-native and you specify multiple variable declarations per line. For example:
@@@ @implementation NavigationBar : CPView {
int _type, _fieldPadding; id _backButton, _forwardButton;} . . . @@@
will result in a ’backButton not defined’ error the first time backButton is referenced at runtime. There are no problems accessing either type or fieldPadding, which are int’s. It also doesn’t appear to matter whether the offending variables are declared as ’id’s or some other non Javascript-native type.
Changing this to:
@@@ @implementation NavigationBar : CPView {
int _type, _fieldPadding; id _backButton; id _forwardButton;} . . . @@@
alleviates the problem.
This ticket has 0 attachment(s).
Comments
Multiple non Javascript-native instance variable declarations per-line don’t work
This is actually due to us not supporting the comma notation for multiple declarations of the same time. It’s surprising that any of them worked.
by Francisco Tolmasky
Please log in to comment.I'm guessing the int one didn't actually work, and the failure case just wasn't detected.
-
0 comments Created 9 months ago by dwt\R as key equivalent on CPButton doesn't get through nib2cibFeaturexHi there,
I've set a button in a form as the default button for that window by setting it's key-equivalent to \R in IB. However, after converting the xib with nib2cib, the button is not the default button anymore.
Regards,
MartinComments
Please log in to comment. -
When scrolling a CPWebView that is inside a CPScrollView brief artifacts will appear if there are any views that are out of the scrolling area and the webview should be clipped by when scrolling. This issue has only been noticed in FF for Windows and Linux and does not have any problems in FF for OS X.
Here is a video of the bug: http://www.youtube.com/watch?v=08VN3-S2kgI
The video shows a brief glimpse of the problem, but due to the frame rate does not show how prevalent the artifacts really are.
This was all using 0.6 code. I will let you know if the problem still persists when I move to 0.7b.
Testing code: http://gist.github.com/110148
Comments
I played around with this a bit today (not explicitly WebViews and iFrames, though). It appears that an overflow property being set to anything other than hidden within the iFrame causes this problem.
Also, the issue is still relevant in 0.7.
Please log in to comment.I feel like this is a bug in Firefox that we won't be able to work around, or were you able to in your experiments find some way to actually solve the problem that keeps webviews working?
-
2 comments Created 8 months ago by j4johnfoxpress does not work when using cibs@tlrobinsonxusing press --flatten, I find a few problems:
1) cib file loading doesn't work:
- [CPBundle loadCibNamed:owner:loadDelegate:] unrecognized selector sent to class 0x000026
2) All .j files (e.g. individual .j files in my project) are copied, as well as the original .j files from AppKit and Foundation frameworks (e.g. ~/browser.platform).
Aside from the cib file problem, the app does run.
Comments
tlrobinson
Sat Jun 13 16:46:16 -0700 2009
| link
The problem is that press is not aware of the classes used in cibs, so they may be stripped.
Workarounds:
use the "--nostrip" option if you only care about flattening, not reducing file size
explicitly import all classes used in the cibs, possibly at the top of AppController.j (don't just import "AppKit/AppKit.j" since it is ignored)
Please log in to comment.I got things working with the --nostrip option, which is great. I'll also try the the explicit import to see if I can get that working. Many thanks.
-
Fix well-formed issues - Browser detection
0 comments Created 8 months ago by timperrettCorrect the frequent errors with "not well-formed" appearing in browser consoles by adding some type of client checking code that means these errors do not occur.
Comments
Please log in to comment. -
Currently CPCollectionView arranges its items by starting at the top-left, filling each (fixed width) row left-to-right and adjusting its height as necessary to fit in the required number of rows.
As far as I can gather Cocoa doesn't have this either but it would be useful to have an alternative mode which would render items top-to-bottom, filling fixed-height columns and adjusting the width to fit.
This would then allow it to be used for rendering lists of items which scroll horizontally.
The only required change to the interface would be an additional accessor to set/get the "grow" direction.
I'll have a go at this myself if I get the time.
Comments
Please log in to comment.I've commited a patch for this at: http://github.com/maport/cappuccino/commit/93cc5700c8e39e84fded1a4b4ba3d69f03a12dd8
This adds a new orientation property which can be set to
CPCollectionViewHorizontalOrientationto "orient" the view horizontally rather than the standard vertical arrangement:- (void)setOrientation:(CPCollectionViewOrientation)anOrientationIn this orientation the view has fixed height, items are arranged in columns starting on the left and the width is varied.
It is particularly useful if you want to render a one row list that scrolls horizontally.
The patched CPCollectionView should be completely backward compatible and users who don't use
setOrientationshouldn't encounter any differences. However I have deprecatedsetVerticalMarginin favour of a newsetDivisionMarginmethod since the "vertical margin" is the margin between rows in the standard vertical orientation but becomes the margin between columns in the the horizontal orientation.Any better suggestions than
setDivisionMarginwelcome; a "division" is the general term I am using to represent a row or column.
-
Vertical splitter behavior when using Firefox 3.0.10 (on Win XP)
1 comment Created 8 months ago by cwsIf I open following website created with cappuccino:
http://www.nice-panorama.com/Programmation/cappuccino/Browse-Cappuccino-Tutorials.htmlThe vertical splitter can be moved to the right only, if the mouse is only hitting the splitter control. If I move above the right subview, it stops resizing. I can only escape, if I click the mouse button or if I move the mouse back above the splitter control.
Comments
-
Working on a CPSound class to match the NSSound from Cocoa. Tell me if it's not needed!
Comments
What is the status of CPSound? I would say this is a crucial part of some application. I took a look at your branch and looked through CPSound.j but it's hard to tell what's missing in it (if anything).
Please log in to comment.I just uploaded the latest changes to my own branch. I have implemented most of the useful stuff. I currently use quicktime, and the audio tag if QT is not supported. However, more addons should be added. Also the pause/stop behaviour seems to be different depending on what tag is used. Also I do not know what browsers this works in, would help if somebody checked.
-
Vertical Line in InterfaceBuilder doesn't work in nib2cib
0 comments Created 8 months ago by [deleted user]nib2cib can't convert a Vertical Line from IB.
workaround: I use a Image with 1x1 pixel, and bring it to the line I need.
Comments
Please log in to comment. -
Buttons lose their height, after nib2cib
0 comments Created 8 months ago by [deleted user]I have a made a Button in InterfaceBuilder,
deactivate the borders and make in heighter.Works in IB and Obj-C, but convert with nib2cib,
it looks in Safari straingh: the height isn't bigger,
and the button-tittle is on the basement.Comments
Please log in to comment. -
CPWebView should contain a property to resize only Horizontally, Vertically, or both. Currently, both a vertical and horizontal resize happens when the scroll mode is CPWebViewScrollAppKit.
Secondly, The scroll mode should not necessarily be the delimiting factor on whether a CPWebView resizes itself. The WebView should be able to resize itself without containing a scroll area.
Think of this scenario: Someone wants to load multiple web views in a list like format and does not want each web view to contain a scroll area based on the WebView's initial size. Rather they want the full WebView (resized and all after the load) to be present without scroll bars and scrolling will be managed at a higher containing view.
Please let me know if you think I am entirely off with this behavior. I have no problem working on a patch for this.
Comments
-
Title is pretty self-explanatory. BlendKit is not being linked when using 'capp -f -l'.
Comments
Please log in to comment. -
Add signatureForMethod implementation (stated as "// FIXME: We need to implement method signatures" in CPObject).
It seems required for interoperability with languages that are less abstract (more restrictive) than ObjJ : for example Java reflection requires to know exactly a method's parameters types (classes) to retrieve a Method definition object. With ObjJ/ObjC we can just invoke a method with performSelector, then we just need to know the selector name (not its IMPL and parameters types).Java method parameters types can be determined from passed arguments objects, however if they are null we have no way. Having the ObjJ method signature, we could pass some null constants (carying the class information) for null parameters.
Comments
Please log in to comment.Objective-J runtime Method js object holds the selector (name), IMP (js function) and types of the parameters (not managed for now).
So the runtime does the job : when sending a message on a receiver object, it searchs in its methods for a method with same selector/name, and types (not done for now) and returns the function. It is the same in ObjC.In Java the programmer has to do that, either by static/compiled call to the function (passing parameters objects values), or by using reflection APIs (pass the parameters types in a Class array).
-
If I have view A with subview B, if subview B does not override mouseEntered or mouseExited, moving the mouse on to subview B (from a point that is already on view A) will call mouseEntered on view A since the default implementation of mouseEntered just goes down the responder chain. I don't know how Cocoa handles this case.
Comments
I am working on this - proposed fix at http://github.com/saikat/cappuccino/commit/8a2788f7ad4d9a2423a004f8b991bf42e3588efe
Some additional discussion: http://github.com/280north/cappuccino/issues/#issue/447
Please log in to comment.My proposed fix link is broken, but the proposed fix was to just get rid of the nextResponder propagation in CPResponder for mouseEntered and mouseExited. Discussed here - http://groups.google.com/group/objectivej-dev/browse_thread/thread/b37e35412c4104/b09f7db0347698cf?lnk=gst&q=mouseEntered#b09f7db0347698cf . This would follow the Cocoa implementation but not docs (which I think is more intuitive).
- #acknowledged▾
- #external-webkit▾
- #need-answer▾
- #need-reduction▾
- #need-test▾
- #to-acknowledge▾
- #to-review▾
- 0.8▾
- 1.0▾
- @boucher▾
- @nciagra▾
- @tlrobinson▾
- @tolmasky▾
- Bug▾
- Feature▾
- Objective-J▾
- Regression▾
- Task▾
- appkit▾
- foundation▾
- from-lighthouse▾
- tools▾
- Apply to Selection
-
Change Color…
Previewpreview
- Rename…
- Delete




Missing functionality: plist read/write
initWithContentsOfURL implemented for CPDictionary in the attached patch. I suppose there’s no use for initWithContentsOfFile in cappuccino, tell me if I’m wrong.
by Farcaller
Missing functionality: plist read/write
We could just alias initWithContentsOfFile to initWithContentsOfURL. Is there a reason for puting the logic in the class method rather than the init?
It would be great to see this finished up for CPArray, and with the writeTo methods (which should just send a PUT request to the URL with the contents of the plist as the body.
It would also be interesting to see asynchronous versions of these, since synchronous requests are, generally, a terrible idea in the browser.
by Ross Boucher
NSDictionary commited at farcaller/cappuccino@8ea10ab
Any ideas how to make async version and keep it cocoa way?