280north / cappuccino
- Source
- Commits
- Network (130)
- Issues (145)
- Downloads (13)
- Wiki (34)
- Graphs
-
Branch:
master
-
When the user clicks on a disabled item in the menu the action is still sent.
Fixed with this commit:
http://github.com/Me1000/cappuccino/commit/d8408da5e8e4b72ad86aa08688bae220a80cb67dComments
-
CPTableView: data view doesn't respect text alignement
2 comments Created 17 days ago by p3consulting[[column dataView] setAlignment:CPRightTextAlignment];is not respected, text remains left aligned.
(CPTableView from nib2cib or not…)
DOM generated: (see the text-align: left in the inner div)
15I have investigate if there was not a side effect somewhere else resetting the text alignment, but CPLog.trace("dataView alignement %d", [[column dataView] alignment]) ;
shows up the alignment is 1 == CPRightTextAlignment everywhere.Comments
This code doesn't work because it doesn't use dataView correctly. It's also a duplicate of this ticket: http://github.com/280north/cappuccino/issuesearch?state=open&q=dataview#issue/315
Closing.
p3consulting
Sat Dec 26 12:23:55 -0800 2009
| link
Adding
- (void)resetDataView {_dataViewData[[_dataView UID]] = [CPKeyedArchiver archivedDataWithRootObject:_dataView];} to CPTableColumn.j
and calling it after setting the desired parameters of the column's dataView solved the problem.
-
Test case added in http://github.com/280north/cappuccino/commit/403277ed0641b98dfdddea45c2f2cda26e9140c8 .
Comments
-
-
Clicking on the swatches (especially clicking rapidly) on both the color wheel mode and slider mode of a CPColorPanel produces the following error after the application hangs for several seconds (in Safari, not sure about other browsers at the moment, if it would even matter):
- [CPColor string] unrecognized selector sent to instance 0x0001de
I am invoking the CPColorPanel from a CPColorWell control which is added to a standard CPView, nothing fancy. Using a couple days old build of the jake branch.
- R
Comments
This is probably related: if you drag a swatch from the top it hangs Safari (and I would assume all webkit browsers).
suitmymind
Thu Dec 17 07:45:39 -0800 2009
| link
I guess this one should be closed : http://github.com/280north/cappuccino/commit/6aadd1345083422213e8bc7fbe7b5673ffbb813c
ryanjafari
Thu Dec 17 08:05:32 -0800 2009
| link
It certainly seems that way. I'll have to get the latest jake and try it out!
I think only commits to master close tickets. Will close.
ryanjafari
Tue Dec 22 12:40:43 -0800 2009
| link
I'm still having this issue upon updating my jake today. Instead now I get "CPInvalidArgument" exception.
can you get a stack trace and show me what you are seeing?
ryanjafari
Wed Dec 23 06:25:34 -0800 2009
| link
Best I could do at the current moment: http://i.imgur.com/mpSbg.png
Again this happens when clicking between swatches. Hope this helps somewhat. Let me know what else I can provide. -
So is decodeHTMLComponent. I don't have a test case because I don't even use Objective-J. I was just browsing the code and saw that it would totally not work.
http://github.com/280north/cappuccino/blob/master/Objective-J/plist.js#L417-425
In JS, passing a string to replace() will only replace the first occurrence. Also, the ampersand (&) is replaced at the end, which would wipe out the ampersand from HTML Entities created by the previous calls to replace().
Comments
Hmm. I pushed this fix to jake and it appears to still be open. Closing.
I don't know how in which cases this is used, but it seems pretty inefficient to make multiple calls on replace, which run through the whole string each time. If the string is small, then no big deal.
This would be my suggestion (doesn't fit your code completely) if performance was a concern: http://gist.github.com/258897
-
I have spend quite a long time to realize where the problem is (because I was working on something else, related to extending the Response with access to headers).
The CPURLConnection initWithRequest does not set the _isLocalFileConnection correctly. This is against AB-8 (working with Atlas!).
Adding some debug statements makes the problem visible:
CPLog.debug("CPURLConnection::URL=" + URL);
CPLog.debug("URL::scheme=" + scheme); // Browsers use "file:", Titanium uses "app:" _isLocalFileConnection = scheme === "file" || ((scheme !== "http" || scheme !== "https:") && window.location && (window.location.protocol === "file:" || window.location.protocol === "app:")); CPLog.debug("CPURLConnection::isLocalFileConnection=" + _isLocalFileConnection);produces:
2009-11-07 18:31:08.271 Cappuccino [debug]: CPURLConnection::URL=http://192.168.251.5/~wimpi/test/test.xml 2009-11-07 18:31:08.272 Cappuccino [debug]: URL::scheme=http 2009-11-07 18:31:08.273 Cappuccino [debug]: CPURLConnection::isLocalFileConnection=trueConsequently the CPURLConnection _readyStateDidChange will not call the delegate with the right type (will be CPURLResponse instead of CPHTTPURLResponse).
Comments
dwimberger
Mon Dec 07 17:06:53 -0800 2009
| link
I am not exactly clear about what the conditional is trying to achieve, but maybe it could be replaced with:
// Browsers use "file:", Titanium uses "app:", if no scheme is given in the URL, use // window.location.protocol if(!scheme) { scheme = window.location.protocol.substring(0,window.location.protocol.indexOf(':')) } CPLog.debug("URL::scheme=" + scheme); _isLocalFileConnection = (scheme === "file" || scheme === "app"); -
Text shadow color is being reset after setting text to ""
1 comment Created 24 days ago by stewaAfter setting texts to "" the DOM elements for the text and text shadows are removed. When setting the text to a non empty string later the DOM elements are created but the shadow color isn't being set.
This patch seems to fix the problem
diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/ _CPImageAndTextView.j index d27d009..246f67d 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -377,6 +377,8 @@ var HORIZONTAL_MARGIN = 3.0, shadowStyle.position = "absolute"; shadowStyle.whiteSpace = textStyle.whiteSpace; + shadowStyle.color = [_textShadowColor cssString]; + shadowStyle.zIndex = 150; shadowStyle.textOverflow = textStyle.textOverflow;Comments
-
Wrong type of selectedRowIndexes in CPTableView.j
1 comment Created 24 days ago by p3consulting -
CPTextField doesn't recognize characters that requires the alt button
1 comment Created 26 days ago by luddepCharacters such as @ (alt + 2) aren't recognized anymore, I believe since the refactored key handling commits.
(Jake branch, up to date at the time of writing.)
Example App:
http://luddep.se/static/TextfieldAltBug/Comments
-
I have the following CPPopUpButton in a CPView:
var sizeSelector = [[CPPopUpButton alloc] initWithFrame:CGRectMake(160,4,50,18) pullsDown:NO];
[sizeSelector addItemsWithTitles:["1","2","3","4","5","6","7"]]; [self addSubview:sizeSelector];If I click the CPPopUpButton and then hover my mouse over an area outside of the CPMenu area that pops up I get an error:
index (-1) out of bounds (0 - 7)
I started seeing this when the index out of bounds exception was added a couple of days ago. Thanks.
- Ryan
Comments
-
Using NSTabView with nib2cib sometimes causes an exception
3 comments Created 27 days ago by p3consultingRandom bug:
NSTabView in IB .xib file converted into a .cib with nib2cib
the execution generates
TypeError: Result of expression 'aSubview' [null] is not an object.The stack crawl show up that
- (void)insertTabViewItem:atIndex: was walled with a null view and a index of -1Sometimes just changing the selected tab item in InterfaceBuilder, then save and re-run nib2cib clears the problem…
Comments
p3consulting
Sat Dec 05 11:08:45 -0800 2009
| link
the problem seems to occur when the Default Tab is on "Current" and the current one is the first one of the NSTabView.
-
CPViewController should cache the cib
4 comments Created about 1 month ago by suitmymindSteps to reproduce :
1. create a collection view
2. set its item prototype using with _ initWithCibName_ :
[[CPCollectionViewItem alloc] initWithCibName:@"TheCibName" bundle:nil]
If there are 100 items in the collection view, the cib will be loaded 100 times using XHR.
(You'll see something like this in the Webkit console : "100 XHR finished loading: TheCibName.cib")The cib should be loaded only once and cached.
Comments
suitmymind
Tue Dec 01 05:37:39 -0800 2009
| link
I'm working on a fix.
suitmymind
Tue Dec 01 06:09:17 -0800 2009
| link
You can download an example application before the patch :
http://dl.dropbox.com/u/40466/tmp/cappuccino/issue-348/CibCachingBefore.zipYou'll see, in the Webkit inspector that the 2 cibs are loaded 20 times.
20 XHR finished loading: "file:///Users/tba/Desktop/tests-ticket-348/CibCachingBefore/Resources/SMMView.cib". 20 XHR finished loading: "file:///Users/tba/Desktop/tests-ticket-348/CibCachingBefore/Resources/SMMView2.cib".
suitmymind
Tue Dec 01 06:13:49 -0800 2009
| link
Here is the proposed fix :
http://github.com/suitmymind/cappuccino/commit/d61d5db84a116cb505c257e4724fb3a32da76513You can download the same application than in previous comment, but with the patch applied :
http://dl.dropbox.com/u/40466/tmp/cappuccino/issue-348/CibCachingAfter.zipYou'll see, in the Webkit inspector that the 2 cibs are loaded just once.
XHR finished loading: "file:///Users/tba/Desktop/tests-ticket-348/CibCachingAfter/Resources/SMMView.cib". XHR finished loading: "file:///Users/tba/Desktop/tests-ticket-348/CibCachingAfter/Resources/SMMView2.cib".
-
CPWebView doesn't take size of scrollers into account
1 comment Created about 1 month ago by ichverstehe -
commonPrefixWithString method missing in CPString @new-features @working-on
2 comments Created about 1 month ago by abhinavCPString is missing NSString's commonPrefixWithString method that finds the common prefix between two strings.
Comments
-
CPGeometry CPRectContainsRect calls invalid function
2 comments Created about 1 month ago by klaaspieterCPGeometry CPRectContainsRect calls CPUnionRect in stead of CPRectUnion.
Possible fix: 974524f
It's probably easier to change the call yourself though :)Comments
klaaspieter
Tue Nov 24 02:25:01 -0800 2009
| link
I also think the CPRectContainsRect arguments are in the wrong order. The Cocoa docs specify he first rect to be the containment and the second as the containing rect.
CPRectContainsRect works the other way around.
Possible fix: 73ff8df
-
Status message "Canceled opening the page"
1 comment Created about 1 month ago by eliasklughammerI saw this the first time at almost.at. The page was still loading while the status in Safari tells the user "Canceled opening the page" which is simply wrong because the page is still loading.

So first I thought "Ok maybe theres some error in the app, let's load it again". All in all the status message indicates the user that there is an error which is simply not a good thing.
I think this could simply be overwritten by adding a
window.status = "Some positive message";Comments
-
If you set the window style to a CPAlert to HUD the buttons will be added with the Aristo theme instead.
to fix add
if(_windowStyle === CPHUDBackgroundWindowMask) [button setTheme:[CPTheme themeNamed: "Aristo-HUD"]];inside of addButtonWithTitle:
(I'd commit it, but I'm on the jake branch and I don't have my jake branch on github)
Comments
-
Theres a bug in ie7 and ie8 when using 1x1 pixel transparent images for backgrounds. This is happening with the HUD window style. All that needs to be done is change the 1x1 pixel file to be a 5x5 pixel file.
Comments
I am unable to see any problem in IE8. Can you post screenshots and specific version numbers?
Can you see if its fixed in this commit #2120e9cf2a89c9a2ef89732a4ee79d012fde2b8f
-
Test case:
var zero = [CPNumber numberWithInt:0]; var set = [CPSet setWithObject:zero]; CPLog.trace(@"containsObject: %d", [set containsObject:zero]);Oops :-(
if (_contents[[anObject UID]] && [_contents[[anObject UID]] isEqual:anObject])should be replaced with
if ([anObject UID] in _contents && [_contents[[anObject UID]] isEqual:anObject])Comments
-
In jake branch, bootstrap.sh doesn't add correct variables to $PATH in some cases
1 comment Created about 1 month ago by saikatfrom IRC:
saikatc: tlrobinson: btw, i just realized that after running bootstrap.sh, restarting the shell won't work as expected if the user has a .bash_profile or .bash_login. it should probably add the export path to the correct profile based on the unix priority order - http://hayne.net/MacDev/Notes/unixFAQ.html under "Bash startup files"
Comments
tlrobinson
Wed Dec 02 18:14:48 -0800 2009
| link
Fixed by SHA: 90dc1f6
-
In jake branch, copy and paste within CPTextField doesn't work
1 comment Created about 1 month ago by saikatI believe this only occurs when the Cappuccino application has menu items with key equivalents for copy and paste. With the new way CPTextField works, these key equivalents get caught in CPApplication, I believe, and never hit the CPTextField. Not sure what the proper solution is.
Comments
-
CPTableView - Scrollbars on wrong position when turning of headers
3 comments Created about 1 month ago by eliasklughammerI placed a tableView in a scrollView and set the documentView.
When you turn of the header in a CPTableView with[tableView setHeaderView:nil];
the table data itself is on the right position but the scrollbars are on the same position like there were headers. Take a look at the screenshot: http://i33.tinypic.com/kdl3rs.png
Comments
-
A default CPButton does not send action when pressing the enter key
5 comments Created about 1 month ago by 0xced[button setDefaultButton:YES] seems to only change the appearance of the button. Pressing the enter key does not send the action, even if the button is the only element in the window.
Comments
Calling setDefaultButton on the window will wok. However i'll look at rhe cocoa documentation. If you call this on the button it might automatically call it on the window itself.
It looks like setDefaultButton doesn't even exist in Cocoa (as a method of NSButton) we may consider changing the method to _setDefaultButton: in CPButton to avoid the confusion that both you and I made.
but anyway, to get the behavior you're looking for capp [aWindow setDefaultButton:aButton];
Thanks, that was what I was looking for. And indeed, renaming setDefaultButton: to _setDefaultButton: is a good idea!
Also setDefaultButtonCell: does not really make sense in capp since there is no cell. I would not mind if it was renamed setDefaultButton: on CPWindow.
it is setDefaultButton: on CPWindow. both exist for compatibility.
-
Exception in thread "main" java.lang.NullPointerException during rake install
1 comment Created about 1 month ago by earlieszombieHi, here is my config on Snow Leopard 10.6.2:
$gcc -v Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5646.1~2/src/configure --disable-checking --enable-
werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --
program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-
apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-
darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5646) (dot 1)$java -v java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-237-10M3013)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-100, mixed mode)$git --version git --version
git version 1.6.4.2$rake --version rake, version 0.8.7
$echo $CAPP_BUILD /Library/Frameworks/cappuccino.framework
I clone cappuccino from github, I do a rake install and I get:
(in /Users/fred/dev/src/cappuccino.src) (in /Users/fred/dev/src/cappuccino.src) (in /Users/fred/dev/src/cappuccino.src/External) Submodule 'External/browserjs' (git://github.com/tlrobinson/browserjs.git) registered for path
'External/browserjs' Submodule 'External/jack' (git://github.com/tlrobinson/jack.git) registered for path
'External/jack' Submodule 'External/narwhal' (git://github.com/tlrobinson/narwhal.git) registered for path
'External/narwhal' Submodule 'External/ojunit' (git://github.com/280north/ojunit.git) registered for path
'External/ojunit' Initialized empty Git repository in /Users/fred/dev/src/cappuccino.src/External/browserjs/.git/
remote: Counting objects: 120, done.
remote: Compressing objects: 100% (103/103), done.
remote: Total 120 (delta 38), reused 0 (delta 0)
Receiving objects: 100% (120/120), 22.55 KiB, done.
Resolving deltas: 100% (38/38), done.
Submodule path 'External/browserjs': checked out
'98a71a4122bde9cacebe5b437e66c4b17208a195' Initialized empty Git repository in /Users/fred/dev/src/cappuccino.src/External/jack/.git/
remote: Counting objects: 2614, done.
remote: Compressing objects: 100% (1357/1357), done.
remote: Total 2614 (delta 1478), reused 2089 (delta 1179)
Receiving objects: 100% (2614/2614), 866.16 KiB | 226 KiB/s, done.
Resolving deltas: 100% (1478/1478), done.
Submodule path 'External/jack': checked out '3ee7b56812c97770318891a0fd21287cae9ccfc2'
Initialized empty Git repository in /Users/fred/dev/src/cappuccino.src/External/narwhal/.git/
remote: Counting objects: 7149, done.
remote: Compressing objects: 100% (2287/2287), done.
remote: Total 7149 (delta 4600), reused 7149 (delta 4600)
Receiving objects: 100% (7149/7149), 4.21 MiB | 229 KiB/s, done.
Resolving deltas: 100% (4600/4600), done.
Submodule path 'External/narwhal': checked out 'cd6e4b02ab7f039e2f106ef6f8edb3efbfab5b8a'
Initialized empty Git repository in /Users/fred/dev/src/cappuccino.src/External/ojunit/.git/
remote: Counting objects: 80, done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 80 (delta 38), reused 0 (delta 0)
Receiving objects: 100% (80/80), 12.50 KiB, done.
Resolving deltas: 100% (38/38), done.
Submodule path 'External/ojunit': checked out
'352b7e8c618729a48d130098368ae0a774ce5f0d' mkdir -p /Library/Frameworks/cappuccino.framework/Debug
mkdir -p /Library/Frameworks/cappuccino.framework/Debug/env
rm -rf /Library/Frameworks/cappuccino.framework/Debug/env
(in /Users/fred/dev/src/cappuccino.src/Objective-J) mkdir -p /Library/Frameworks/cappuccino.framework/Debug/Objective-J
:576:26: warning: missing terminating " character
:840:26: warning: missing terminating " character
:841:22: warning: missing terminating " character
mkdir -p /Library/Frameworks/cappuccino.framework/Debug/Objective-J/rhino.platform
:576:26: warning: missing terminating " character
:840:26: warning: missing terminating " character
:841:22: warning: missing terminating " character
cp /Users/fred/dev/src/cappuccino.src/Tools/Rake/lib/licenses/LGPL-v2.1
/Library/Frameworks/cappuccino.framework/Debug/Objective-J/LICENSE (in /Users/fred/dev/src/cappuccino.src/Objective-J/Tools) rm -rf /Library/Frameworks/cappuccino.framework/Debug/env/packages/objj
cp -r objj /Library/Frameworks/cappuccino.framework/Debug/env/packages/objj
mkdir -p
/Library/Frameworks/cappuccino.framework/Debug/env/packages/objj/lib/Frameworks rm -rf
/Library/Frameworks/cappuccino.framework/Debug/env/packages/objj/lib/Frameworks/Objecti ve-J
cp -r /Library/Frameworks/cappuccino.framework/Debug/Objective-J
/Library/Frameworks/cappuccino.framework/Debug/env/packages/objj/lib/Frameworks/Objecti ve-J
(in /Users/fred/dev/src/cappuccino.src/Foundation) mkdir -p /Library/Frameworks/cappuccino.framework/Debug/Foundation/Resources
cp -r Resources/log.css
/Library/Frameworks/cappuccino.framework/Debug/Foundation/Resources/log.css Exception in thread "main" java.lang.NullPointerException
at org.mozilla.javascript.ScriptableObject.getTopLevelScope(ScriptableObject.java:1514) at org.mozilla.javascript.ScriptRuntime.setObjectProtoAndParent(ScriptRuntime.java:3291) at org.mozilla.javascript.NativeJavaPackage.getPkgProperty(NativeJavaPackage.java:166) at org.mozilla.javascript.NativeJavaPackage.get(NativeJavaPackage.java:105) at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1575) at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1397) at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1383) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3054) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at org.mozilla.javascript.NativeArray.iterativeMethod(NativeArray.java:1565) at org.mozilla.javascript.NativeArray.execIdCall(NativeArray.java:313) at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:127) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97) at org.mozilla.javascript.gen.c1._c1(Unknown Source) at org.mozilla.javascript.gen.c1.call(Unknown Source) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76) at org.mozilla.javascript.gen.c1._c0(Unknown Source) at org.mozilla.javascript.gen.c1.call(Unknown Source) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) at org.mozilla.javascript.gen.c1.call(Unknown Source) at org.mozilla.javascript.gen.c1.exec(Unknown Source) at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:526) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:448) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:414) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:405) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:179) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:100) at org.mozilla.javascript.Context.call(Context.java:499) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:162) at org.mozilla.javascript.tools.shell.Main.main(Main.java:140)Can anyone point me in the right direction?
Cheers, Fred.Comments
rake has been deprecated in favor of our new build system, Jake, which is on the Jake branch at the moment. We're working on merging those changes into master. You should try that out and file any problems against that branch until the merge is complete.
-
CPTextField sends action to often in Firefox
3 comments Created about 1 month ago by klaaspieterFirefox (and Opera) sent the keypress event to often which causes the textfield to sent it's action more than once when the enter key is pressed.
Comments
-
Scrollview doesn't support "fast scrolling"
4 comments Created about 1 month ago by nickwAs an example, compare scrolling the sidebar in iTunes with a large number of playlists with scrolling the widgets library in Mockingbird (http://gomockingbird.com/mockingbird/). iTunes will speed up the scrolling when you perform small, quick scrolling motions, or longer, slower scrolling motions.
Comments
I am not able to understand this issue. I don't see any special behavior in iTunes. Could you make a video?
Sure, here's a quick video: http://exygeninteractive.com/ScrollView.mov
It's difficult to explain, but it seems that native scroll bars in OS X have some logic that cause them to scroll greater distances bases on the length, speed and repetition of the scrolling gesture.
I'm using the two finger scrolling gesture on a MacBook Pro trackpad. I haven't compared it using a mouse scroll wheel.
This is an OS/browser level thing, so there's nothing we can do about this. I'm closing it as work as expected.
-
There is situation when hasSuffix returns wrong result:
var string = @"Test";
var suffix = @"Wrong";
var result = [string hasSuffix:suffix];
Returned result is equal to YES ...
Problem appears always when [string length] == [suffix length]-1
Comments
jmacmullin
Wed Nov 04 21:46:09 -0800 2009
| link
A potential fix is here:
http://github.com/jmacmullin/cappuccino/commit/b6a42d3aac3d44985103d3cfb84f2fb3e610175f -
Command+Key gets sent as Command+UPPERCASE Key sometimes
1 comment Created 2 months ago by tolmasky -
This is a regression. This happens in both firefox and safari and on both release and debug frameworks. To test, create a secure text field and setStringValue to "test". Open the file and you will see only three bullets instead of four in the secure text field. Test gist - http://gist.github.com/223321
Comments
-
In Firefox, hitting return on a CPTextField makes that return event fire twice
3 comments Created 2 months ago by saikatI believe this a regression. But, for example, if I set an action as the target of a text field, pressing enter on that text field will fire that action twice. Or, in another case, in the action of a text field I was setting another view as a first responder. Hitting enter in the text field was causing the action to fire, but then was also sending a keyDown with CPReturnKeyCode to the view that I was setting as first responder. This does not happen in Safari 4, but happens in Firefox 3 and Firefox 3.5.
Comments
-
looks like http://github.com/280north/cappuccino/blob/master/AppKit/CPTableView.j#L239 is a copy-paste typo from line 236
Comments
fixed with this commit in my fork.
http://github.com/Me1000/cappuccino/commit/4c7a5059cb2c8dc536dc386691fff671fb5719a2 -
Calling [self window] from CPWindowController windowDidLoad loops
2 comments Created 2 months ago by klaaspieter- Create a new application
- Make a custom CPWindowController subclass with a cib file
- Override windowDidLoad and call [self window] from it
- Load the window controller subclass from the cib in the applications delegate's applicationDidFinishLaunching
- Call showWindow on the window controller
- Load the application
The above steps will caused the windowDidLoad method to loop because there is no window outlet set up in the cib file. I think this behavior should be more like the iPhone where an exception is thrown if the view could not be loaded.
Comments
klaaspieter
Fri Oct 30 06:08:40 -0700 2009
| link
Possible fix: 58b727f
- Create a new application
-
Cappuccino is throwing security exceptions in Adobe AIR
2 comments Created 2 months ago by chicu123I've tried the starter application in Adobe AIR and I've got the following exception:
Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (Function constructor)
objj_exception_report at app:/Frameworks/Objective-J/Objective-J.js : 1556
fragment_evaluate_code at app:/Frameworks/Objective-J/Objective-J.js : 2243
at app:/Frameworks/Objective-J/Objective-J.js : 2211 at app:/Frameworks/Objective-J/Objective-J.js : 2225It looks like the "new Function()" is called after onLoad is trigger. In AIR all the evals should happen before onLoad.
Comments
This is not a bug. It's by design. If you want to use AIR, you have to use the "press" tool to concatenate and pre-process all the javascript ahead of time.
Oh, didn't know about it. I've created a workaround that loads the scripts synchronously. I just post it here maybe it helps somebody.
-
Command-C invokes copy twice in the default menubar
1 comment Created 2 months ago by saikatTry the code here - http://gist.github.com/220843. Copy prints twice on each command-c.
Comments
-
CPMenu does not properly autoresize with browser window
1 comment Created 2 months ago by saikatDiscussed with solution here - http://groups.google.com/group/objectivej-dev/browse_thread/thread/9f9a8764e4bade31
Comments
-
CGContextDrawLinearGradient() draws nothing in IE7
2 comments Created 2 months ago by cacaodevHere is a simple app showing the problem:
http://github.com/cacaodev/cappuccino/commit/4b1c27dde22284c870377d06142ce5b06b888059Either there is a path in the context current path(*) or not, nothing appears on the view.
IE console outputs an error "Object does not support that property". The log included in this function is: "<cg_vml_:fill type="gradient" colors="0% rgb(0, 0, 0),100% rgb(255, 255, 255)" />"(*) this is currently required for canvas browsers.
Comments
Boucher, can you have a look at this CGGradient test app:
http://perso.orange.fr/cocoadev/CGGradient.zipI still see a gradient in WebKit and nothing in IE7/8 (using parallels).
Maybe there's a problem with my code, maybe related to the current path. I'd really like to understand why it doesn't work here. -
The bottom of the button is not displed properly
2 comments Created 2 months ago by olituksIn linux (ubuntu 9.04) with firefox 3.5.2, operra 9.64 or midori 0.1.2 (webkit) the bottom of the button is not displed properly if you use a value miner of 24.0 in your button declaration for the height value. It's the same if I need a button with 50px * 50 px the displaying is very bad.
var button = [[CPButton alloc] initWithFrame: CGRectMake( CGRectGetWidth([contentView bounds])/2.0 - 40.0, CGRectGetMaxY([label frame]) + 10.0, 80.0, 18.0 )] ;Comments
Apparently the sise of the button is fixed because eache buttons is composed by parts of image with a fixed size. So this is not a bug, but a normal comportment from capputccino API.
-
Menubar does not auto-open menus when selected
1 comment Created 2 months ago by jasoncmartinThe menubar implementation does not support opening a dropdown menu, then hovering over another menu label to open that dropdown. An example of a proper implementation would be the menubar in Mac OS X.
Comments
-
Column headerViews don't get reloaded with CPTableView's reloadData.
4 comments Created 2 months ago by sethtrainThe workaround is to put:
[tableView.headerView setNeedsDisplay:YES]; [tableView.headerView setNeedsLayout];
before:
[tableView reloadData];
Comments
I can't reproduce this bug. I'm not really sure what it's referring too, and the things I tried all worked.
Can you provide a test case? Preferably in a fork of the CappuccinoBugs repo.
I am closing this issue. I rewrote the view in code instead of using IB and trying to add headers.
-
Hi!
My port of NSOperation might be a good addition to the core: http://github.com/jfahrenkrug/CPOperation
Maybe, maybe not.- Johannes
Comments
dont know if this has been posted to the Flow, but it should be! :) The extensions people are creating need to be all together somewhere.
We've discussed the Block term a bit. I think Function is simply a better name in the JavaScript world. Opinion?
jfahrenkrug
Wed Dec 09 23:34:01 -0800 2009
| link
Yes, I think you are right. My first objective was to copy the cocoa api as accurately as possible, hence "block". But "function" makes more sense.
What is your opinion about having both, "block" and "function" method names, where one just calls the other? Ugly? Or acceptable for the sake of cocoa-api compatibility?Johannes
How about having the cocoa block parts as an imported category for use when needed? The category doesn't even have to reside in the cappuccino repo...
EDIT: One thing talking against keeping it around at all is that the obj-c syntax for blocks wouldn't work anyway and would need to be rewritten and as such the block method names might confuse.
Andreas
I think that since the API is so new to cocoa the block ones aren't needed. If someone wants them, it is a matter of generating one single .j file full of categories, which we could easily keep on a gist somewhere on the wiki.
jfahrenkrug
Wed Dec 23 06:11:06 -0800 2009
| link
Hi Ross,
while that is true, I do think that the block methods are extremely convenient, because you don't have to subclass NSOperation. You can very very easily add a simple JS function to an operation queue. I can imagine lots of scenarios where that will come in very handy. I don't know if it would be good to take that kind of convenience away.
Your thought?Nobody's saying get rid of them, just the name "block"
jfahrenkrug
Wed Dec 23 06:14:49 -0800 2009
| link
Oh, ok. Then I just misunderstood you! I thought you meant removing the actual methods by saying "the block ones aren't needed". Ok, let me rename them to "Function"...
jfahrenkrug
Wed Dec 23 06:17:42 -0800 2009
| link
So "CPFunctionOperation" instead of "CPBlockOperation", "completionFunction" instead of "completionBlock" and so on, right?
jfahrenkrug
Wed Dec 23 06:29:50 -0800 2009
| link
Done. Everythings renamed and all the tests still pass: http://github.com/jfahrenkrug/CPOperation
Cool. One more tiny nit-picky kind of thing. Could you update the code to follow the project conventions: http://cappuccino.org/contribute/coding-style.php The main thing I noticed was brackets but if you take a quick look it would be really appreciated.
jfahrenkrug
Wed Dec 23 07:11:20 -0800 2009
| link
And this, sir, is now done as well :)
-
A native cursor support for elements like buttons, collectionViews etc. would be very important.
Of course, in native desktop apps there isn't the "pointer" cursor for example.
In the past I had some conversations with customers who didn't understand why there's no pointer-Cursor on a menu-item. And I understand the point.
This cursor got important when the web got bigger. It indicated that if you click on an element something would happen.Because of cappuccino apps live in the browser it would be very important to supprt the feature to manually choose the cursor.
By the way at the moment you have to solve this problem by touching the DOM:
self._DOMElement.style.cursor = "pointer";
Comments
Here is a basic CPCursor implementation.
Warning: you can't set a CPCursor and update on mouse moved events for a specific view but only for the whole application. This would come with a CPTrackingArea implementation i guess.
Tested in WebKit/FF/IE/Opera: see comments for what's working and what's not.
Feedback welcome !http://github.com/cacaodev/cappuccino/commit/123f3bfe5672c64daeb0bde05a5c9aeaaeacfb60
hey cocaodev, has this been posted to the Flow? Others might find it useful :)
-
itemPrototype test in the CPCollectionViewTest tests for equality and not identity
2 comments Created 2 months ago by luusetestItemPrototypeActuallyReturnsTheItemPrototype in the CPCollectionView test tests if the class CPCollectionViewItem are equal with each other. The test should test if the item prototype sent to the setter is identical to the one returned by the getter.
Comments
Fixed in luuse@7d9713c
-
CPAnimation not setting animationCurve correctly on init
1 comment Created 2 months ago by luddepWith last nights updates to CPAnimation to support curves (yay!) a critical bug seems to have slipped in.
Unless you set the curve directly using
setAnimationCurve:, the_timingFunctionivar isn't set and everything goes bonkers.initWithDuration:animationCurve:sets_animationCurvedirectly, simply replacing_animationCurve = anAnimationCurve;with
[self setAnimationCurve:anAnimationCurve];in
initWithDuration:animationCurve:seems to fix it.Comments
-
CPCollectionView doesn't have getter for isSelectable
2 comments Created 2 months ago by luuseCPCollectionView doesn't have a getter for isSelectable however it does have one for isSelected which doesn't exist.
Comments
Fixed in luuse@09858ca, luuse@792e02e and luuse@3303891
-
CPCollectionView isSelectable is not encoded/decoded from cib
2 comments Created 2 months ago by luuseThe isSelectable property is read from the xib file but it's never written to the cib file or read from it for that matter.
Comments
Fixed in luuse@773dac3
-
[CPTextField setPlaceHolderValue: ""] in textDidBeginEditing does not work.
14 comments Created 2 months ago by furusystemsSummary
When one subclass CPTextField.
Ant then in thetextDidBeginEditingmethod
we try to set the placeHolderStringValue of the textField to an empty string"".
But the placeHolderStringValue for the Field does not get updated at least not visually.The Case Scenario
We try to emulate an field where we toggle between the defaultValue and empty string
""when the element regains and loses focus.
Setting the value to back todefaultValueif it's an empty string
intextDidEndEditingworks without any problems.The code is the following.
- (void) textDidBeginEditing: (CPNotification) aNote { if(([self stringValue] == defaultValue)){ [self setPlaceholderString: ""]; } }An possible solution is the following that does the trick, is to make the element
first respondertwice.- (void) textDidBeginEditing: (CPNotification) aNote { if(([self stringValue] == defaultValue)){ [self setStringValue: ""]; [textField becomeFirstResponder]; } }Or the easiest but not ideal solution.
- (void) textDidBeginEditing: (CPNotification) aNote { [self _inputElement].value = ""; }Problem and Solution
This is due that the
[textField _inputElement].valuedoes not get updated
when the the element has become thefirst responder.So the ideal solution would be for the CPTextField, to update the
[textField _inputElement].value = value;
if it knows that it has become the
first responder.Comments
You cannot call becomeFirstResponder yourself. Doing so will cause unexpected and undefined behavior.
Separate question, is there a reason you aren't using the placeholder feature of text field?
furusystems
Thu Oct 08 18:08:00 -0700 2009
| link
Hmm didn't see that method before you mentioned it, but it only works when you set a delegate for the CPTextField and not when subclassing.
furusystems
Thu Oct 08 18:21:36 -0700 2009
| link
Heres a sample code that shows that it does not work for the SubClass.
I don't understand what you're trying to accomplish. Just do:
[textField setPlaceholderString:aValue];Do it once at the beginning. It does the rest for you.
furusystems
Thu Oct 08 18:37:54 -0700 2009
| link
Yes it does work when using delegate and in the
controlTextDidBeginEditingmethod.But it does not work when subclassing and using it from the
textDidBeginEditingmethod.I'm telling you don't do it in those methods. Do it upfront. Before you start editing at all. And only do it once. It wasn't designed to be called lots of times.
Also, you're sample code assumes those delegate methods will be called on your subclass, when if fact they won't be. Subclasses don't get delegate method calls unless they are also the delegate.
furusystems
Thu Oct 08 18:51:27 -0700 2009
| link
Sorry typo in the gist for the
[label2 setDelegate: self];removed now.
But still thetextDidBeginEditingandtextDidEndEditingmethods are being called even if don't specify it as a delegate.I will make a TextFieldController class instead, but why can't it update from a overriden
textDidBeginEditingmethod. I want to change the defaultValue only when the field gains focus and not before, any reason why this works then intextDidEndEditingmethod.
I don't understand what you are trying to do, but I don't think you understand placeholder strings. Can you describe step by step what you want displayed to the user using example text (starting from before the user starts editing).
furusystems
Thu Oct 08 19:03:35 -0700 2009
| link
Here is the example i want the behaviour for the label2 setPlaceHolderString to also work inside
textDidBeginEditingmethod for the subclass.The code is the same as in the gist http://gist.github.com/205607
You didn't really answer my question, but assuming I now understand, then you should do what I suggested at the beginning of this conversation. STOP using controlTextDid*. You DO NOT need it.
Exactly one time only, and when you CREATE the textfield, call [textField setPlaceholderString:"The string you want displayed until the user starts typing"];
furusystems
Thu Oct 08 19:21:44 -0700 2009
| link
If you see the first
Label: "Hello World!", when the field gains focus and the field
is using thedefaultValue: "Hello World!it turns blank. Then if the field loses focus
and is still blank it will go back to thedefaultValue: "Hello World!With the
label 2: "Good Night!"we try the same but this is an subclass of the CPTextField, and thesetStringValuemethod didn`t work inside textDidBeginEditing.Im changing some of the colors and background of the field when it gains and loses focus.
But as you say i misunderstood the usage of
[textfield setPlaceholderString: "DefaultValue"]This does the job i want to emulate.I will now make a subclass CPView which each has it own textfield which uses the,
I still need to change the text color on the fly when the field gains or loses focus.Thanks for the help :)
-
"null" in CPWindowWillCloseNotification when compiled
4 comments Created 2 months ago by eboehnischI am listening for the CPWindowWillCloseNotification notification and compare the object value with my CPPanel to detect whether it is my window that closed or not. When using the uncompiled code in my project it works as expected. When compiling it through rake, this no longer works but delivers "null" as the object value.
In addition, programmatically closing the panel using [myPanel close] has no effect. Manually closing closes the panel but, as said, does not send the correct notification. In the uncompiled code, it works as expected.
To recreate, open a CPPanel, then listen for CPWindowWillCloseNotification when you close the panel.
Comments
Hey eboehnisch, thanks for the report, I build a test app for the bug that has been pushed to http://github.com/stevegeek/CappuccinoBugs, however I do not see the problem. When i rake release or debug the project the notification is still sent fine. Please can you submit a test that highlights the problem so i can update my test app.
steve
eboehnisch
Mon Oct 12 01:49:33 -0700 2009
| link
Hi Steve. Sorry that I was so slow in commenting my own bug report. I have found the bug later that day and it was not in the CPWindowWillCloseNotification notification but actually in an instance variable that somehow gets lost in the compiled version. I first initialize a window using:
var theWindow = [[CPPanel alloc] initWithContentRect:CGRectMake(CGRectGetMidX-(NEWNOTEWIDTH/2), CGRectGetMidY-(NEWNOTEWIDTH/2), NEWNOTEWIDTH, NEWNOTEHEIGHT) styleMask:CPHUDBackgroundWindowMask | CPClosableWindowMask];I later compare theWindow with the object returned from CPWindowWillCloseNotification. At that time, however, theWindow is null. I now make a copy ("theWindowRef = theWindow;") and compare with it and this works. This is not necessary in the uncompiled version where everything works as I expected.
Seems like the problem was with user code? I'm going to close this. If there's still a problem we should refile it under a correct title.
eboehnisch
Mon Nov 30 08:57:48 -0800 2009
| link
Yes it was a user problem. Stupid me. Please close this ticket.
-
Safari 4: Certain Keyboard Events (e.g. arrow down) no longer handled in CPResponder
3 comments Created 2 months ago by j4johnfoxSince Safari 4 has been released, pressing the arrow keys no longer causes interpretKeyEvents: to be called.
To see the problem try this demo:
http://timetableapp.com/PR/datepicker/
In Firefox when of the date picker cells has focus, you can change the value using the up/down keys, and tab from one cell to another. Not so in Safari 4.
You can add a log statement in DatePicker.j (or presumable other CPResponder subclasses)
(void)interpretKeyEvents:(id)anEvent { var key = [anEvent keyCode];
console.log('here in DataPicker interpretKeyEvents key is ' +key);
}......
Notice that the log is visible in Firefox, not in Safari 4.
Comments
hey,
do you mind if I add this test app to the http://github.com/stevegeek/CappuccinoBugs repo?
Hi Steve:
I didn't write this component, they guy from RCLConcepts did. It's a great test app for validating keyboard access. I suspect he'd let you link it. The code for the DatePicker is on GitHub here http://github.com/Me1000/Cappuccino-datepicker -
Ran 'press test pressed' on a project generated with: 'capp gen test'
commit cb416e0
Date: Sat Sep 26 18:49:08 2009 -0700
identical results on Ubuntu Juanty Jackalope and Mac OSX Leopard
Rake 0.8.7 on both systems
ran 'rake clobber-all install' for both installs.
Trace follows:2009-08-29 16:27:55.214 Cappuccino [info]: Application root: /Users/anthony/work/cappuccino/temp/test 2009-08-29 16:27:55.220 Cappuccino [info]: Output directory: pressed 2009-08-29 16:27:55.244 Cappuccino [info]: Main file: /Users/anthony/work/cappuccino/temp/test/main.j 2009-08-29 16:27:55.275 Cappuccino [info]: Frameworks: /Users/anthony/work/cappuccino/temp/test/Frameworks 2009-08-29 16:27:55.381 Cappuccino [error]: PHASE 1: Loading application... 2009-08-29 16:27:55.542 Cappuccino [debug]: Evaling /Users/anthony/work/cappuccino/temp/test/main.j / /Users/anthony/work/cappuccino/temp/test/Info.plist /Users/anthony/work/cappuccino/temp/test/main.j ReferenceError: "system" is not defined. js: "Objective-J.js", line 1734: exception from uncaught JavaScript throw: ReferenceError: "system" is not defined. at Objective-J.js:1734 (objj_exception_report) at Objective-J.js:2460 (fragment_evaluate_code) at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib/press/objj-analysis-tools.j:152 at Objective-J.js:2422 at Objective-J.js:2439 at bridge.js:161 (serviceTimeouts) at <cmd>:5 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib/press/objj-analysis-tools.j:202 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib/press/objj-analysis-tools.j:158 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib/press/main.j:85 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib-js/objj/objj.js:96 at Objective-J.js:2430 at Objective-J.js:2438 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/browserjs/lib/browser/timeout.js:103 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/lib-js/objj/objj.js:120 at /Users/anthony/work/cappuccino/objj_home/share/narwhal/packages/objj/bin/objj:3 at /USers/anthony/work/cappuccino/objj_home/share/narwhal/lib/sandbox.js:250 at narwhal.js:209Comments
I can confirm this error with the following:
capp gen -l test
press test pressed
tlrobinson
Thu Oct 08 21:42:23 -0700 2009
| link
Should be fixed by 69cdc2c
-
Removing CPTabViewItem results in corrupt Tab bar
6 comments Created 3 months ago by jtietemaI've created a CPTabView and am amble to add CPTabViewItem's but when I remove them the Tabs don't seem to be correctly redrawn. The old tab is drawn on top of the others. Below are 2 screenshots showing the bug.
Multiple tabs before removing:
http://tietema.net/wp-content/tabs_good.pngAfter removing:
http://tietema.net/wp-content/tabs_bad.pngComments
hey jtietema, thanks for the bug report, could you please provide a small test app or code snippet that highlights this problem? many thanks
Hi stevegeek, thanks for the response. I created a small demo app to demonstrate the bug. I uploaded it at http://github.com/jtietema/cappuccino-tabbug
I've found the bug and created a patch. (Also made a pull request)
http://github.com/jtietema/cappuccino/commit/85197636d325e21d968f4317b8455fa01a73d86d
Fixes a tab view bug with removing tabs.
Closed by 341eddb.Kudos go to jtietema for tracking down the bug.
-
-
CPMenu doesn't seem to be sizing with the browser window properly
1 comment Created 3 months ago by saikatThis is a regression bug (just tried with 0.7.1 and the behavior works). If I add a separator CPMenuItem, anything I put after that separator does not move with the window's width and just gets cut off. Try the code here - http://gist.github.com/190119 .
Comments
thanks for the report, the test application is here http://github.com/stevegeek/CappuccinoBugs and i can confirm i see it too.
-
Comments
-
Trying to set header for tableview:
header = [[CPTableHeaderView alloc] initWithFrame: CGRectMake(10, 10, 1000, 10)];
[table setHeaderView: header];Got error: ReferenceError: Can't find variable: aSize
Looks like problem here:CPTableView.j:
705: [headerView setFrameSize:CGSizeMake(aSize.width, [_headerView frame].size.height)];
Comments
-
CPWebView loadHTMLString sets scrollMode to AppKit
3 comments Created 3 months ago by jfahrenkrugUsing loadHTMLString to set the contents of the webView calls [self _setScrollMode:CPWebViewScrollAppKit];
I don't know why. And loadHTMLString should, imho, not touch the scrollMode.Comments
This behavior is intended. Having an inconsistent scrollbar is never desired. It is merely tolerated when using a cross domain URL because it can't be fixed due to security restrictions.
jfahrenkrug
Tue Sep 22 03:24:35 -0700 2009
| link
Thanks, Ross.
But look at my use case: http://github.com/jfahrenkrug/MapKit-HelloWorld/blob/master/Frameworks/MapKit/MKMapView.j
tlrobinson suggested I'd load google maps in a CPWebView so it's in a frame and draggable markers would work. This works fine, but of course I don't want Cappuccino Scrollbars around the map. I've added a category to my code (as you can see in the link) that lets me load a html string without setting the scrollbars to scrollappkit. So in my case there are cases where it would make sense to be able to load a html string without changing the scrollbar.We should just document this behavior, and remove the _ from setScrollMode. If you don't want the default behavior, you can then just call setScrollMode: with the mode you want.
But it's definitely the case that we want the default to be CPWebViewScrollAppKit.
-
Invalid Objective-J code results in a client-side ParseError with no clue
3 comments Created 3 months ago by hlshipCappuccino should be able to do a better job reporting such errors (or include a server-side validation tool or some form). Currently, a typo in an Objective-J file is reported as a ParseError with no additional clue as to what was being parsed or how it is wrong.
For example, I had some code:
- (CPButton)makeDigit:(int)value at:(CGRect)frame { CPButton button = [self makeButton:value at:frame action:@selector(digit:)]; [button setTag:value]; return button; }It took me a long time to realize that in Objective-J, local variables have no type (always var) and it would have been nice if Cappuccino had identified the file and preferably the method (and line) that was at the root of the problem, as well as what I was doing wrong.
Comments
Perhaps when using debug mode, Cappuccino could log what file/class/method it is compiling, so that there's some context when an exception get thrown.
The requested context information has been added, but it won't solve this problem. The problem here is with your JavaScript, not your Objective-J. We don't parse the JavaScript at that level of detail, so there is no way for us to detect the error.
The real solution here is to correct the lack of context information in the WebKit error. Here's one bug I filed about it, feel free to comment in it (or commit a fix, something I'll attempt to look into at some point):
It seems to me that you are doing an XHR request to pull, say, AppController.j from the server. Are you saying that there's no room to either log that you are about to parse the content from AppController.j, or but a try block around that parsing? Yes, I'd prefer that it identify the line and/or method, but just narrowing down to the file can be a challenge. In fact, I've later discoverred that you can see the file being parsed in the stack trace (the very top-most frame has a parameter that identifies the file).
The WebKit error may help ... but won't that be on the post-parsed JavaScript?
-
Objective-J class documentation appears to omit methods defined via macros
1 comment Created 3 months ago by hlshipI was looking for documentation for the setAlignment: method and it was nowhere to be found; perusing the source I saw it was created via a macro:
#define BRIDGE(UPPERCASE, LOWERCASE, ATTRIBUTENAME) \ /*! Sets the value for ATTRIBUTENAME */\ - (void)set##UPPERCASE:(id)aValue\ {\ [self setValue:aValue forThemeAttribute:ATTRIBUTENAME];\ }\ /*! Returns the current value for ATTRIBUTENAME */\ - (id)LOWERCASE\ {\ return [self valueForThemeAttribute:ATTRIBUTENAME];\ } BRIDGE(Alignment, alignment, "alignment") BRIDGE(VerticalAlignment, verticalAlignment, "vertical-alignment") BRIDGE(LineBreakMode, lineBreakMode, "line-break-mode") BRIDGE(TextColor, textColor, "text-color") BRIDGE(Font, font, "font") BRIDGE(TextShadowColor, textShadowColor, "text-shadow-color") BRIDGE(TextShadowOffset, textShadowOffset, "text-shadow-offset") BRIDGE(ImagePosition, imagePosition, "image-position") BRIDGE(ImageScaling, imageScaling, "image-scaling")Comments
-
Objective-J class documentation should be sorted by class name or function name
1 comment Created 3 months ago by hlshipLook at
http://cappuccino.org/learn/documentation/group__appkit.html
It's in a pretty random order; it should be in alphabetical order.
Comments
-
CPWindow does not to (always) respect _autorecalculatesKeyViewLoop
3 comments Created 3 months ago by klaaspieterWhen autorecalculatesKeyViewLoop is set to NO the keyViewLoopIsDirty boolean is not set to NO as well. This results in the key view loop still being automatically recalculated.
Comments
This isn't a bug. The NSWindow documentation (and thus, CPWindow) states that the first time a window is loaded, the key view loop will be recalculated:
"If you do not want to maintain the key view loop of your window manually, you can use this method to do it for you. When it is first loaded, NSWindow calls this method automatically if your window does not have a key view loop already established. If you add or remove views later, you can call this method manually to update the window’s key view loop. You can also call setAutorecalculatesKeyViewLoop: to have the window recalculate the loop automatically."
If you establish a key view loop in IB/Atlas, the _keyViewLoopIsDirty flag will be set to NO. Otherwise, it starts out as YES, so that the very first key view loop access is respected.
Is this causing a problem for you?
klaaspieter
Mon Sep 07 01:05:50 -0700 2009
| link
I do have auto recalculates key view loop set to no in interface builder and that isn't respected. Also when I set the setAutorecalculatesKeyViewLoop bool to no I expect CPWindow to respect that immediately and not after the key view loop is automatically calculated once more.
It seems to be respected for me. If you've got a nib/cib where it isn't being respected, could you post a link here?
As for calling setAutorecalculatesKeyViewLoop:NO, I agree it probably shouldn't allow for delayed calculation like it currently does, but since there was an implicit assumption that calculation already occurred, we may need to force evaluation at that point. I'll have to check how Cocoa behaves in that situation.
-
CPArray's initWithArray CopyItems uses undefined variable
1 comment Created 4 months ago by wmeddieHaven't tested it but while reading through the code, I noticed the for loop was using index but incrementing i. Here's an untested patch.
index 566eb57..ecc1b47 100755 --- a/Foundation/CPArray.j +++ b/Foundation/CPArray.j @@ -209,13 +209,13 @@ var index = 0, count = [anArray count]; - for(; index < count; ++i) + for(; index < count; ++index) { - if (anArray[i].isa) - self[i] = [anArray copy]; + if (anArray[index].isa) + self[index] = [anArray copy]; // Do a deep/shallow copy? else - self[i] = anArray; + self[index] = anArray; } }Comments
-
CPTextField posts wrong notification on edit end
0 comments Created 4 months ago by sabberwormSee http://github.com/280north/cappuccino/blob/master/AppKit/CPTextField.j#L658
Notification should be CPControlTextDidEndEditingNotification but is CPControlTextDidBeginEditingNotification.
Comments
-
If the a dimenions of the document view's size is less than that dimension in the containing CPScrollView's size but more than that dimension in the size of the CPScrollView minus a scroller, an incorrect disabled scroller appears. For example, if I have a document that is 100x100, and my scroll view is 90 x 105, then a horizontal scroller appears as expected. However, since this horizontal scroller makes the effective height of the scroll view 105 - the height of the horizontal scroller (about 17 pixels right now), the CPScrollView's size becomes 90 x 88. This makes the height of the CPScrollView smaller than the height of the document view, and causes a vertical scroller to also appear - however this vertical scroller appears disabled and, so, I am not able to scroll to clipped parts of my document. The same happens in the other dimension.
Comments
-
Build error [fatal]: Auto-detected Cocoa Nib or Xib File
2 comments Created 4 months ago by matthewfordTrying to build from source I get the following error and warnings:
cp -r Templates/NibApplication/Resources/MainMenu.xib /Users/mattmini/dev/src/cappuccino/Build/Release/capp/Resources/Templates/NibApplication/Resources/MainMenu.xib
2009-07-22 15:03:43.176 Cappuccino [fatal]: Auto-detected Cocoa Nib or Xib File
i-nit form coder
2009-07-22 15:03:54.450 Cappuccino [warn]: Mapping NSApplication to CPApplication
:::CPApplication 2009-07-22 15:03:54.730 Cappuccino [debug]: => isBordered=false, isBezeled=true, bezelStyle=0(, null)
i-nit form coder
2009-07-22 15:03:54.995 Cappuccino [warn]: Mapping NSApplication to CPApplication
:::CPApplication i-nit form coder
:::AppController 2009-07-22 15:03:55.147 Cappuccino [warn]: Mapping NSWindow to CPWindow
Comments
matthewford
Sun Aug 23 03:06:57 -0700 2009
| link
ok thanks, just noticed someone else posted the same thing on the mailing list, changing the message to something other than fatal would nice.
-
CPURLConnection delegate methods won't get called
1 comment Created 4 months ago by osiggeI got this code:
var request = [CPURLRequest requestWithURL:@"http://myJSONPsite.com"];
[CPJSONPConnection connectionWithRequest:request callback:@"callback" delegate:self];If there is data, the didReceiveData delegate gets called. In case of an error (wrong url, etc.) the didFailOnError delegate won't get called.
If there's data received, the didFinishLoading delegate also won't get called.So it seems there's actually no way to respond to connection errors. (Version 0.7.1)
Comments
There is no did finish loading delegate method for CPJSONPConnection. JSONP does not allow cross browser detection of errors, but the limited errors that can be detected are reported.
A future version of this class could include a timeout option, but you could do the same thing in the meantime.
-
Enabling CPTextField trough DoubleClick + SetFocus
4 comments Created 4 months ago by furusystemsEnabling and Setting focus on a CPTextField and assigning it as the first responder adds an odd behaviour. Whenever in a view collectionView with more than one CPTextField in each CollectionView the value of the last edited textfield will pop as the new value for the new selected textfield.
An workaround is to have the textfield enabled and have an overlay CPView with transparency.
Then hide and show the CPView overlay over the TextField.Attached are the following files.
The code http://pyced.com/capp/scrollview.zip
Initial Edit State http://pyced.com/capp/Picture.png
Editing and Jump forth an back between the fields http://pyced.com/capp/PictureBug.pngComments
There are a couple theme bugs here (notably, while editing some attributes can't be changed), but what you are doing is easily achievable. I couldn't follow your code, so here's the rewrite:
furusystems
Thu Oct 08 19:54:47 -0700 2009
| link
Thanks for the update.
Solves my old problem.But still any easy guide on how to create a theme and change the values within, by setting changing the theme for an cp-element which supports changing it's theme .
The place to look for now is at the Aristo theme's ThemeAttributes.j. This will change the color of a textfield's placeholder text:
[textfield setValue:[CPColor blueColor] forThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder];
furusystems
Thu Oct 08 20:17:17 -0700 2009
| link
Found the file and thanks for the info :)
-
initWithFrame: not respected for CPTableView
2 comments Created 4 months ago by grinichWhen creating a CPTableView, the frame passed in via initWithFrame is not respected. Instead, the tableView expands to fill it's container's width.
Comments
This is "fixed" now. Tableviews still don't respect the width from initWithFrame:, but instead base it on the size of the columns. They don't fill their widths except for when in clip views.
-
CPTextField can fail to get all of its input when return is pressed quickly
1 comment Created 4 months ago by tumultA CPTextField with its target and action set might not always return the full contents of itself when you send stringValue to it in the action method body.
Example:
someTextField = [CPTextField textFieldWithStringValue:nil placeholder:@"blah" width:200]; [someTextField setTarget:self]; [someTextField setAction:@selector(echoInputFrom:)]; .... - (IBAction)echoInputFrom:(id)sender { CPLog.debug([sender stringValue]); }Type some stuff in the text field and hit enter quickly after typing or while still in the middle of editing.
asdfasdfasfdasdf -> asdfasdfasf 1234567 -> 123456Solution: right now I just wrap the body of the action method in a setTimeout(..., 0). I'm assuming the real way to do this would be to correctly insert something into the runloop?
Comments
-
CPButton created via buttonWithTItle: and an empty string messes up its text drawing
1 comment Created 4 months ago by tumult -
On trying to convert my xib with a fresh pull and rake install from github (or using the zipped tools on the site) I encounter this trace...
Trace:~/Documents/dev/capp_tests/Editor $ nib2cib Resources/MainMenu.xib 2009-07-04 21:51:54.067 Cappuccino [warn]: Mapping NSWindow to CPWindow
js: "/usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)", line 1724: exception from uncaught JavaScript throw: -[CPKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSTextView)
at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval):1724 (objj_exception_throw) at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):37 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):46 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):202 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):93 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):18 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):9 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):93 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):18 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):9 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):93 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):18 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):11 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):93 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):10 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):208 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):65 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2435(eval):131 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js:31 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval):2415 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js#20(eval):2423 at /usr/local/share/objj/narwhal/packages/browserjs/lib/browser/timeout.js:103 at /usr/local/share/objj/narwhal/packages/objj/lib/objj/objj.js:77 at sandbox.js:195 at /usr/local/share/objj/narwhal/packages/objj/bin/objj:3 at sandbox.js:195 at narwhal.js:157Duplication:
capp gen -t NibApplication Editor
open MainMenu.xib in Interface Builder
Add an NSTextView
save, and run nib2cib.
Watch it fail spectacularly ;)Comments
-
When a CPTextField is being edited, the function handlers for the DOMInputElement do not forward the event to cappuccino's keyDown/keyUp methods and as such extending the behavior of CPTextField is very difficult.
Secondly, the default behavior on Enter and Tab keys when editing are hard coded and cannot be overridden
All of the handlers are declared class level and thus are not visible to child classes, so behavior of the DOMElement cannot be modified directly (though this is probably the least nice option for extending).
Workarounds to this are overriding the [CPTextField _inputElement] in which case there is a large amount of code duplication in order to allow the textField to retain default behavior and no way to remove the event handlers as they are not visible to subclasses. For the Tab and Enter keys, resignFirstResponder can be modified to return false in a state where the Tab and Enter keys need to be handled differently. This makes for painful subclassing.
Comments
-
TableView won't be displayed if dataSource is set before the Delegate
2 comments Created 5 months ago by lavfrancisWhen you set the dataSource before the delegate, the tableView will be generated (as html) but nothing will be displayed in the browser.
So this wont work:
[table setDataSource:self]; [table setDelegate:self];This will work:
[table setDelegate:self]; [table setDataSource:self];Comments
is this in master tableview or tableview-branch tableview?
lavfrancis
Wed Jul 22 12:29:52 -0700 2009
| link
it applied only to the master. This is working fine with the tableView in the tableview's branch.
-
CPScrollView: setVerticalScroller and setHorizontalScroller not working
1 comment Created 5 months ago by HolgileinHi guys,
This code (CP 0.7.1) throws an error in FF 3.0 on Linux:
var clientScrollView = [
[CPScrollView alloc] initWithFrame:CGRectMake( 0, 0, 200, 400) ]; [clientScrollView setAutohidesScrollers:YES]; [clientScrollView setHorizontalScroller:NO]; //[clientScrollView setVerticalScroller:NO]; [self addSubview:clientScrollView];The error message is:
Error: [Exception... "'- [CPNumber setTarget:] unrecognized selector sent to instance 0x001332' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no]
Horizontal and vertical scrollers are both throwing the error. When the scroller setters are commented out, the error disappears.
Thanks in advance for fixing this,
Holger
Comments
you're not using the function correctly. from the documentation:
- (void) setVerticalScroller: (CPScroller) aScroller
You're passing a boolean value (NO), when you should be passing a CPScroller object. If you want to disable horizontal or vertical scrolling, you must use the appropriate methods:
- (void) setVerticalScroller: (CPScroller) aScroller
-
I fixed the bug reported here. It was an encoding issue.
http://groups.google.com/group/objectivej/browse_thread/thread/e4bc41026a8f100f/6b14f3b74189df18
Commit:
http://github.com/cacaodev/cappuccino/commit/259bb567af1026292fb7e1fb25a66db6387943e8Comments
Is this issue fixed? The code has changed slightly since then, and I can't tell if the patch is still needed or no longer relevant.
It works well in jake with the example provided in the ml. Can be closed in my opinion.
There is still an issue though when you set a custom template and try to archive CPSearchField (seems like an issue with CPMenuItem encoding/decoding). I will open a new issue for this if necessary.
-
Hi there,
Just ran the following code:
var cpAlert = [[CPAlert alloc] init];
[cpAlert setMessageText:@"Warning, HOT SOUP!"] [cpAlert setWindowStyle:CPHUDBackgroundWindowMask | CPClosableWindowMask ]; [cpAlert setAlertStyle:CPInformationalAlertStyle]; [cpAlert setTitle:@"Information"] [cpAlert addButtonWithTitle:@"OK"] [cpAlert addButtonWithTitle:@"Cancel"] [cpAlert setDelegate:self] [cpAlert runModal]and found that the text colour is black, instead of white, when window style is CPHUDBackgroundWindowMask.
Just wanted to let you guys know.
Many thanks,
Holger
Comments
-
Hi there,
Just ran the following code:
var cpAlert = [[CPAlert alloc] init];
[cpAlert setMessageText:@"Warning, HOT SOUP!"] [cpAlert setWindowStyle:CPHUDBackgroundWindowMask | CPClosableWindowMask ]; [cpAlert setAlertStyle:CPInformationalAlertStyle]; [cpAlert setTitle:@"Information"] [cpAlert addButtonWithTitle:@"OK"] [cpAlert addButtonWithTitle:@"Cancel"] [cpAlert setDelegate:self] [cpAlert runModal]and found that the text colour is black, instead of white, when window style is CPHUDBackgroundWindowMask.
Just wanted to let you guys know.
Many thanks,
Holger
Comments
-
Hi there,
Just ran the following code:
var cpAlert = [[CPAlert alloc] init];
[cpAlert setMessageText:@"Warning, HOT SOUP!"] [cpAlert setWindowStyle:CPHUDBackgroundWindowMask | CPClosableWindowMask ]; [cpAlert setAlertStyle:CPInformationalAlertStyle]; [cpAlert setTitle:@"Information"] [cpAlert addButtonWithTitle:@"OK"] [cpAlert addButtonWithTitle:@"Cancel"] [cpAlert setDelegate:self] [cpAlert runModal]and found that the text colour is black, instead of white, when window style is CPHUDBackgroundWindowMask.
Just wanted to let you guys know.
Many thanks,
Holger
Comments
jmacmullin
Tue Sep 15 22:52:13 -0700 2009
| link
I think this is due to the combination of both 'CPHUDBackgroundWindowMask' and 'CPClosableWindowMask'. If you just set the style to 'CPHUDBackgroundWindowMask' then the text appears as white.
However, it is probably still a bug as setting the 'CPClosableWindowMask' should not impact on the text colour. From a quick look at the code it seems CPAlert is checking to see if the 'styleMask == CPHUDBackgroundWindowMask' whereas I think it should be checking to see if that mask is set with 'styleMask & CPHUDBackgroundWindowMask'...
jmacmullin
Tue Sep 15 22:57:37 -0700 2009
| link
-
[CPTextField stringValue] returns incorrect stringValue after returnKey is pressed
1 comment Created 5 months ago by sandeeprmWhen returnKey is pressed, sendAction ( [owner sendAction:[owner action] to:[owner target]] ) occurs before updating objectValue (stringValue) , resulting in CPTextField returning an incorrect stringValue (last character omitted ) when queried for immediately.
Comments
-
Scrollers change from horizontal to vertical under different size conditions
1 comment Created 5 months ago by tolmasky -
Scrollers sometimes have the wrong size when nib2cibed
1 comment Created 5 months ago by tolmasky -
stringByAppendingString: behaves incorrectly with numbers
1 comment Created 6 months ago by Me1000If I have two strings with integers and try to append one to the other with the stringByAppendingString: method the integers get added. I would assume the behavior is the same for all numbers but I haven't tested.
example:
var number1 = [CPString stringWithString: @"2"];
var number2 = [CPString stringWithString: @"3"];var appendedString = [number1 stringByAppendingString: number2];
console.log(appendedString);That outputs "5" to the console. not "23" as it should.
Comments
-
Following through the tutorial; can't get the image to display. Suspect it is a recent change to -[CPImage loadStatus].
Comments
-
Trying to follow through the tutorial.
- (void)drawLayer:(CALayer)layer inContext:(CGContext)context { if ([image loadStatus] != CPImageLoadStatusCompleted) [image setDelegate:self]; else CGContextDrawImage(context, [layer bounds], image); } but [image loadStatus] will return BOOL which makes the check meaningless.
Comments
-
CPCollectionView resizing 'jumps' when there is only one row
3 comments Created 6 months ago by klaaspieterWhile resizing a collection view with only one row, the margin constantly jumps back to 0. I think the margin should just increase indefinitely.
Comments
klaaspieter
Fri Jun 26 04:54:51 -0700 2009
| link
I don't see any reason to change the existing behavior. Not only is it the same behavior as Cocoa, it's also consistent. Special casing single row behavior seems unnecessary.
Additionally, it was impossible to look at your suggested code change, because the diff changes every single line of the file.
klaaspieter
Tue Aug 18 01:40:16 -0700 2009
| link
The reason to change it would be because it's looks ugly and unfinished. If Cocoa has the same behavior, that behavior is flawed as well.
iTunes album cover did fix this bug and increases the margin if there is only one row.
I think the only lines I added are:
if (_numberOfColumns > count) _numberOfColumns = countThe reason why the entire file is changed is because I use tabs and you use spaces. I forgot to convert all my tabs back to spaces.
-
CPSearchField's resources have not been committed along with CPSearchField.
Comments
Images are there in the CPSearchField folder:
http://github.com/cacaodev/cappuccino/tree/f035f65ab1dbb812c487e7cbb1dbc01e522c8e4e/AppKit/ResourcesAre these resources under a license we can use? They look like the ones from Mac OS X which we do not have rights to.
What if they are in the Webkit repository ? It's a BSD-style licence.
Like these ones: http://svn.webkit.org/repository/webkit/trunk/WebKit/win/WebKit.vcproj/
And if it's ok, can we also change dimensions and colors ?If they are from the WebKit repo then it should be fine
-
custom views ignore setBackground color when called in initWithFrame:
4 comments Created 6 months ago by redmarfollowed from a discussion on the mailing list, with the complaint that setBackgroundColor does not get called in initWithFrame for a custom view inside a cib. (mail originated from Jong Hian Zin)
I looked it up inside the AppKit source, specifically AppKit/Cib/_CPCibCustomView.j.The real problem is not that initWithFrame is not getting called, it is, but the call is overridden by another call inside _cibInstantiate.
Comments
super mega small fix of one line can be found here:
http://github.com/redmar/cappuccino/commit/7117d29cae48422a8c9002d15b78fab0cdf4a0f9
lavfrancis
Thu Jun 25 09:09:47 -0700 2009
| link
I got the same problem and I tried your super mega smal fix and it didn't works.
I'm up-to-date with the repository
I have deleted the lines
rebuild : rake - rake install
I tried to copy the new release build into my application - didn't work
I created a new copy with capp. Doesn't work eitherHere is how I create the textfield :
userField = [[CPTextField alloc] initWithFrame:CGRectMake(110, 20, 200, 24)];[userField setEditable:YES];
[userField setSelectable:YES];
[userField setDrawsBackground:YES];
[userField setTextFieldBackgroundColor:[CPColor whiteColor]];
[contentView addSubview:userField];
i've tried and traced your code, the setTextFieldBackgroundColor method is called on your textfield so something else should be going wrong. (i think it's a bug in textfield, because when you use setBackgroundColor instead of setTextFieldBackgroundColor it works perfectly fine)
This is actually expected behavior. If you use an NSView in Cocoa, you will experience the same effect with properties such as "hidden":
@implementation MyView
- (id)initWithFrame:(NSRect)aFrame { //... [self setHidden:NO]; // This won't matter if you set hidden to "YES" in IB }
@end
The reason it is particularly confusing with backgroundColor is that you can't set the background color in IB Cocoa (but you can with iPhone IB and also with Atlas). The correct way to get around this is to just set the color in awakeFromCib as well:
- (void)awakeFromCib { [self setBackgroundColor:aColor]; }
-
mouseEntered gets called on superviews unnecessarily
1 comment Created 6 months ago by saikatWhen view A has subview B, moving the mouse from view A on to view B causes view A to get a mouseEntered view (even though the mouse was already on view A). I am currently working on the fix for this.
Comments
I am working on this - proposed fix at http://github.com/saikat/cappuccino/commit/9896dbd50fc534b1bae0dfb1aa2f8004dd7c8253
-
On slower connections when controls are accessed for the first time in a loaded application there is a very noticeable repainting of the control state while the new state's graphic assests are downloaded from the application's server.
See here:
http://cappuccino.org/aristo/showcase/For example, if you click a button for the first time, Cappuccino begins to download its pressed state graphics from the server, which causes the button to practically disappear for the time the new state's graphics are loaded. On slower Internet connections it takes a second or more for the new state to load fully.
Would it be possible to change the graphics loading behavior in a future version of Cappuccino, such that it downloads all the graphics for all the control states when the application is first loaded?
Comments
-
Menu Bar Items do not respond to mouse clicks properly
1 comment Created 6 months ago by amossonWhen a menu is open, a click on any other menu item closes the open item but does not open menu item that was clicked on.
Steps to reproduce -
- use capp gen to make a sample interface builder app
- load index.html
- click on New Application menu bar item
- click on File item
Expected Results
New Application closes AND File opensActual results
New Application closesComments
-
CPPopUpButton sends the action for a disabled menu item.
1 comment Created 6 months ago by sgriffinThe method to handle the menu window's selection associated with a CPPopUpButton send the menuItem's action to its target regardless of whether that menuItem is enabled or not.
Method where this is a problem is menuWindowDidFinishTracking:highlightedItem.
Comments
-
There is no good way to handle keyDown events for a text field
1 comment Created 6 months ago by saikatI want to create a text field that handles the up arrow, down arrow, and return keys in a specific way. Currently, there is no way to capture the up arrow and down arrow events without adding another event to the _inputElement's onKeyPress handler. Furthermore, I cannot even use this technique to handle return since the current event handler for return removes focus from the text field and, in javascript, there is no way to remove an event handler unless I already have a reference to it (which I don't since it is a file-scoped variable). There should be some way for a delegate to handle keyDown on a text field even if the actual text in the field doesn't change.
Comments
-
Fixed incorect menu positioning when the superview frame != window frame
Fixed search/cancel button autoResizingMask. Buttons where not hooked to the left/right edges
Commit : http://github.com/cacaodev/cappuccino/commit/2c7876b015d952f40d0aa8c88ce0ce61e7aee5c1
Comments
- Special menu items of searchMenuTemplate are now correctly handled
- Implemented autosave feature with CPCookie
- Reorg some methods to allow easier subclassing
- Removed the default template (when no template is set) to match cocoa impl
Commit:
http://github.com/cacaodev/cappuccino/commit/13318c92f8d69d1a80780f618ac998768b0153a2Workaround for a bug with CPEvent timestamp
in Firefox that was causing the menu to stay open.Commit:
http://github.com/cacaodev/cappuccino/commit/a7feaf4c1b3b848f59a380145372f6f1ac3aa708actually IIRC Ross merged in the autoResizingMask: stuff that I (also) fixed a few weeks back.
The 3 commits linked in my comments remain. Except the 2nd item in the description of my first comment : "Fixed search/cancel button autoResizingMask. Buttons where not hooked to the left/right edges" that was fixed a few weeks ago.
Also, i've just realized there is no test app in the commits links i posted and that may be a problem. I've got a test app from the beginning in my repo but It doesn't fit into a unique commit.
So here is the test app if you want to commit it yourself: http://github.com/cacaodev/cappuccino/tree/master/Tests/CPSearchField/
If there is a problem, I can also try to build a fresh commit for the test app in a new branch.note: all menus are broken in jake with the array fix, but are fixed with this commit in the menus branch.
http://github.com/280north/cappuccino/commit/b0acc13da7241fd0b4051637852604aa7489a62eIf menus isn't going to be merged soon I would suggest pushing it to jake as well.
ok, good news.
So, here is the master-bug for these 3 commits + CPSearchField test app (currently untestable in jake due to this menu bug).
http://github.com/cacaodev/cappuccino/commit/3c91213aafcb80c280b87065f1a240f559dfdb22#diff-0 -
CGContextFillRoundedRectangleInRect causes all other rounded rects drawn in the context to be filled the same color.
For example, the following code results in just one large yellow rounded rect:
CGContextSetFillColor(context,[CPColor greenColor]);
CGContextFillRoundedRectangleInRect(context,rect,2,YES,YES,YES,YES);
CGContextSetFillColor(context,[CPColor yellowColor]); CGContextFillRoundedRectangleInRect(context,CPRectInset(rect,20,20),2,YES,YES,YES,YES);The analagous code for regular rectangles (CGContextFillRect) works as expected, drawing a green rectangle and an inset yellow rectangle.
Comments
-
CPPopUpButton does not change selected item when it is a pull down (pullsDown:YES)
2 comments Created 6 months ago by chandlerkentWhen creating a CPPopUpButton either using initWithFrame:pullsDown:YES, or using setPullsDown:YES, it does not change its selected item appropriately.
A test case demonstrating this bug can be found here: http://gist.github.com/124686
The offending method seems to be synchronizeTitleAndSelectedItem in CPPopUpButton.j: http://gist.github.com/124687. Specifically, line 561 looks incorrect: http://github.com/280north/cappuccino/blob/886b4ef1188438ce9b3b8fdf982708c5de28df02/AppKit/CPPopUpButton.j#L561.
This bug was acknowledged by @tlrobinson on IRC.
Comments
Pull down menus are not supposed to change their state. You can test this in Interface Builder: http://tolmasky.com/letmeshowyou/PullDown.mov
Let me know if you meant something different, and we can reopen this
chandlerkent
Sat Jun 06 14:48:00 -0700 2009
| link
OK, thanks. I guess I didn't understand.
-
Due to the new Aristo theme, the rects created for the two sliders should be adjusted. With the current tutorial code, the handles are cropped at the top and bottom.
Working values are:
scaleSlider = [[CPSlider alloc] initWithFrame:CGRectMake(centerX, 13, 135, 24)]; ... [scaleStartLabel setFrameOrigin:CGPointMake(centerX - CGRectGetWidth([scaleStartLabel frame]), 16)]; [scaleEndLabel setFrameOrigin: CGPointMake(CGRectGetMaxX([scaleSlider frame]), 16)]; ... rotationSlider = [[CPSlider alloc] initWithFrame:CGRectMake(centerX, 43, 135, 24)]; ... [rotationStartLabel setFrameOrigin:CGPointMake(centerX - CGRectGetWidth([rotationStartLabel frame]), 46)]; [rotationEndLabel setFrameOrigin: CGPointMake(CGRectGetMaxX([rotationSlider frame]), 46)];Comments
chandlerkent
Sun Jun 21 09:14:00 -0700 2009
| link
I think this should be closed.
We should probably file tickets against the website's git repository:
-
CPWebView does not resize when window is resized
6 comments Created 7 months ago by glejeunesetAutoresizingMask: with CPViewHeightSizable | CPViewWidthSizable does not seem to work.
Example : http://gist.github.com/123554
Comments
chandlerkent
Sat Jun 06 10:09:52 -0700 2009
| link
The above example shows more than just the bug. Here is a new example that only contains the bug:
Tested in the release version of 0.7.
eboehnisch
Tue Jun 30 06:16:38 -0700 2009
| link
I second this bug report. I am loading a CPWebView into a CPSplitView and when the user changes the position of the CPSplitView divider or resizes the window, the CPWebView resizes correctly but not its content frame.
eboehnisch
Tue Jun 30 06:54:22 -0700 2009
| link
I tried to circumvent the problem by manually adjusting the width and height of the surrounding like with:
document.getElementsByName("My Web Vew")[0].parentNode.style.heightbut the original implementation actually does adjust these two attributes but always only to the original size, not the new size.
eboehnisch
Tue Jun 30 08:52:10 -0700 2009
| link
It seems that the _resizeWebFrame method does a bit more than just resizing the web frame, and at least here this does not work as expected. I have overwritten this method with the simple one:
- (BOOL)_resizeWebFrame { [super _resizeWebFrame]; [_frameView setFrameSize:[_scrollView bounds].size]; }The added line overwrites this line in the original method which seems to be there to enable Cappuccino show the CPWebView with its on scroll bars instead of the browsers':
[_frameView setFrameSize:CGSizeMake(width, height)];This could be a workaround until the original idea behind that code works as intended.
jfahrenkrug
Tue Sep 15 01:28:28 -0700 2009
| link
I got this to work in http://github.com/jfahrenkrug/MapKit and http://github.com/jfahrenkrug/MapKit-HelloWorld
Basically what you need to do is two things:
@implementation CPWebView(ScrollFixes) { - (void)loadHTMLStringWithoutMessingUpScrollbars:(CPString)aString { [self _startedLoading]; _ignoreLoadStart = YES; _ignoreLoadEnd = NO; _url = null; _html = aString; [self _load]; } } @endThat will give you a way to load html into your webview without messing up the scrollbars. And overriding
_resizeWebFramelike so did the trick for me:- (BOOL)_resizeWebFrame { var width = [self bounds].size.width, height = [self bounds].size.width; _iframe.setAttribute("width", width); _iframe.setAttribute("height", height); [_frameView setFrameSize:CGSizeMake(width, height)]; }- Johannes
-
CPKeyedArchiver : Can't find variable: __address with CPDate
1 comment Created 7 months ago by cjedIn CPKeyedArchiver code, CPDate are considered as objects (they own an isa field), but then there is an error when the _CPKeyedArchiverEncodeObject function tries to call :
var hash = objj_msgSend(anObject, "hash"),In fact CPObject's hash method returns __address field, but there isn't such field in CPDate.
--> jumps (don''t follow remaining breakpoints) and displays "ReferenceError: Can't find variable: __address"
Comments
tlrobinson
Sat Jun 06 14:33:02 -0700 2009
| link
-
setStringValue does not work inside delegate controlTextDidChange
1 comment Created 7 months ago by cwsAs it says: If a CPTextField is still in input operation and catches the event "controlTextDidChange" during input, the "setStringValue" method does not work on the same object.
What I want to do is a kind of autocomplete. During input I want to check matches an replace the input.
Comments
-
setStringValue does not work inside delegate controlTextDidChange
5 comments Created 7 months ago by cwsAs it says: If a CPTextField is still in input operation and catches the event "controlTextDidChange" during input, the "setStringValue" method does not work on the same object.
What I want to do is a kind of autocomplete. During input I want to check matches an replace the input.
Comments
sirsgriffin
Wed Jun 03 11:31:36 -0700 2009
| link
I was wrong in the format of the delegate method when I commented on your previous ticket. contolTextDidChange uses the notification center and as such the parameter passed to the method if a CPNotification. You can get the CPTextField object from the notification via the accessor [aNotification object] then use set string value on that. Hope that helps, otherwise this sounds like a bug.
Thanks for the hint. I think it is a bug, because if I try following:
- (void)controlTextDidChange: (CPNotification)aNotification { if ([aNotification object] == SomeTextField) { [[aNotification object] setStringValue:"Test"]; alert("Text changed:" + [[aNotification object] stringValue]); } }I get a alert window which shows me "Test", but the textfield is not updated to "Test".
Additionally:
It works, when I hide the textfield:
- (void)controlTextDidChange: (CPNotification)aNotification { if ([aNotification object] == inpHelfer) { [[aNotification object] setHidden:true]; [[aNotification object] setStringValue:"Test"]; [[aNotification object] setHidden:false]; } }But I think, this is still a bug.
Yes, it looks like CPTextField doesn't like having setStringValue called when it is being edited.
Here is a possible patch that I cooked up:
From <a href="/280north/cappuccino/commit/77a11e7251fe6544f3a606bea4b99422b6254f17">77a11e7</a> Mon Sep 17 00:00:00 2001 From: Nick Takayama <nicktak@mac.com> Date: Thu, 18 Jun 2009 21:54:28 +0800 Subject: [PATCH] fix for setStringValue not working on CPTextField when the CPTextField is being edited (particularly when changed within controlTextDidChange:) --- AppKit/CPTextField.j | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 9c44c1f..4b94b5f 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -281,10 +281,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); CPTextFieldKeyUpFunction = function() { - [CPTextFieldInputOwner setStringValue:CPTextFieldDOMInputElement.value]; - - if ([CPTextFieldInputOwner stringValue] !== CPTextFieldTextDidChangeValue) + if (CPTextFieldDOMInputElement.value !== CPTextFieldTextDidChangeValue) { + [CPTextFieldInputOwner setStringValue:CPTextFieldDOMInputElement.value]; + CPTextFieldTextDidChangeValue = [CPTextFieldInputOwner stringValue]; [CPTextFieldInputOwner textDidChange:[CPNotification notificationWithName:CPControlTextDidChangeNotification object:CPTextFieldInputOwner userInfo:nil]]; } @@ -768,6 +768,16 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); #endif } +#if PLATFORM(DOM) +- (void)setStringValue:(CPString)anObject +{ + [super setStringValue:anObject]; + + var element = [self _inputElement]; + element.value = anObject; +} +#endif + #pragma mark Setting the Delegate - (void)setDelegate:(id)aDelegate -- 1.6.0.2 -
This isn't a Cappuccino issue at all, but it is highly related. Some editors need to have a code completion (like Xcode's one), to improve coding performance.
Furthermore I think that at least for now the editor plugins should be more tightly connected to the Cappuccino project and therefore integrated into the repository (or at least a repository with a strong relationship to this one). This would broaden the appeal of developing applications for Cappuccino.
Comments
-
More meaningful error messages when breaking simple syntax rules
1 comment Created 7 months ago by rbugajewskiCurrently there aren't any nice error messages for breaking simple syntax rules like forgetting a closing bracket or putting it at the wrong place. Some other cases are with commas, missing assignments (=) or when you try to add a method variable with a concrete type (let's say CPView foo instead of var foo).
What I would wish: at least the file and line number (±2 lines) of the corresponding syntax error.
Comments
-
E.g. magentaColor… I would expect to have the same amounts of colors like in NSColor/UIColor.
Comments
I've uploaded a patch (http://github.com/nabs749/cappuccino/commit/229b9465847f80ed2bb75ca451e5a2d5ba8bd154) and submitted it to the community (http://groups.google.com/group/objectivej-dev/browse_thread/thread/4e132318f11a4f55#) for feedback.
chandlerkent
Sun Jun 21 09:08:48 -0700 2009
| link
I believe this should be closed.
http://github.com/280north/cappuccino/commit/c7f81691bff7a9ffd5d73d967111c071175c0a4e
I agree - but I don't know how this new github issue tracking thing works.
-
Add an easy possibility to have a scroll bar at the right side of the browser
1 comment Created 7 months ago by rbugajewskiThis issue isn't really important, but it would be nice to have a kind of scrollbar at the right of the browser window, so you can scroll in your Cappuccino apps like in a "normal" web page.
Concrete use case:
Do a web page which has a collection view with a lot of items that are bigger than the screen real estate. Normally you would place the collection view in a scroll view, but then the scroll bar would be "inside" the app. If you do a more web oriented approach this isn't so nice and intuitive. One fix for this is to add a scroll view to the whole window, then add a view to this scroll view. Inside this view you would place other elements like the already mentioned collection view. In this case there are two issues:
1) You have to calculate the size of your custom view inside the scroll view. In the other case the collection view would be clipped at the bottom of the browser window.
2) The scroll bar doesn't get displayed properly (or at least: "what a user would expect"). If you set a minimum width of 800px and then minize the window to 100x100 px the scroll bar disappears after the window gets smaller than 800px.
Comments
You've already hit on all the approaches that could be used to do what you're looking for. I don't see us implementing a third, new, option for this very specific use case. In particular, it doesn't sound like the kind of thing you would want with a Cappuccino application. As you mention yourself, its a "normal" web page design technique, and Cappuccino is specifically not targeted at "normal" web pages.
-
When building Cappuccino from source, it would be expected to put the build location in one's path (e.g. "export CAPP_BUILD=/some/dir". Xcode gets the version of plutil via the PATH (e.g. locate plutil), rather than hard coding to "/usr/bin/plutil". This naming collision leads to difficult to troubleshoot PATH errors. We should rename our plutil to something more obviously within the Cappuccino tool chain given the different usage of each script.
A sample traceback from within the build/run process of an Objective-C application: js: "/usr/local/bin/plutil", line 19: uncaught JavaScript runtime exception: ReferenceError: "NO" is not defined. at /usr/local/bin/plutil:19 (main) at /usr/local/bin/plutil:101 at sandbox.js:153 at narwhal.js:90Comments
aburkhalter
Mon Jun 01 11:19:09 -0700 2009
| link
Dupe. Sorry.
-
When building Cappuccino from source, it would be expected to put the build location in one's path (e.g. "export CAPP_BUILD=/some/dir". Xcode gets the version of plutil via the PATH (e.g. locate plutil), rather than hard coding to "/usr/bin/plutil". This naming collision leads to difficult to troubleshoot PATH errors. We should rename our plutil to something more obviously within the Cappuccino tool chain given the different usage of each script.
A sample traceback from within the build/run process of an Objective-C application: js: "/usr/local/bin/plutil", line 19: uncaught JavaScript runtime exception: ReferenceError: "NO" is not defined. at /usr/local/bin/plutil:19 (main) at /usr/local/bin/plutil:101 at sandbox.js:153 at narwhal.js:90Comments
aburkhalter
Mon Jun 01 11:18:59 -0700 2009
| link
Dupe. Sorry.
-
When building Cappuccino from source, it would be expected to put the build location in one's path (e.g. "export CAPP_BUILD=/some/dir". Xcode gets the version of plutil via the PATH (e.g. locate plutil), rather than hard coding to "/usr/bin/plutil". This naming collision leads to difficult to troubleshoot PATH errors. We should rename our plutil to something more obviously within the Cappuccino tool chain given the different usage of each script.
A sample traceback from within the build/run process of an Objective-C application: js: "/usr/local/bin/plutil", line 19: uncaught JavaScript runtime exception: ReferenceError: "NO" is not defined. at /usr/local/bin/plutil:19 (main) at /usr/local/bin/plutil:101 at sandbox.js:153 at narwhal.js:90Comments
aburkhalter
Sat Jun 06 00:23:44 -0700 2009
| link
This looks resolved. Confirmed?
-
OBJJ_MAIN_FILE and OBJJ_INCLUDE_PATHS not working
2 comments Created 7 months ago by smockSetting these environment variables as follows in index.html:
OBJJ_INCLUDE_PATHS = ["/static/pathto/Cappucino"]; OBJJ_MAIN_FILE = "/js/pathto/main.j';does not appear to execute the app at main.j using the libraries found in the include paths. The library files and files referenced in main.j are all referenced and loaded properly across the network - but the application never executes.
Comments
-
If a CPTextField is displayed as a label, then is set to be editable the bezel should display around the label while it's being edited by default.
Currently the textfield remains bezel-less.
Comments
-
If the textfield is empty (or placeholder text is there) when you click the textfield to edit it the cursor does not show up editing is impossible. It requires a second click to make the text field enter edit mode.
A single click will however cause the placeholder text to disappear.
Comments
-
1.Webkit browsers shift the text down 2-3 pixels when editing
Webkit browsers center the text in multi-line text fields vertically when editing. Text is aligned to the top when not editing (as it should be)
IE shifts editable text fields to the left 2-3 pixels when editing
Comments
-
CPJSObjectCreateJSON() -- Values of 0 converted to null
4 comments Created 7 months ago by sirsgriffinCPJSObjectCreateJSON() will convert 0 (zero) values to null and place them in the output JSON.
Here is the culprit:
valueOf = aJSObject ? aJSObject.valueOf() : null,Comments
and of course the same will happen for undefined, empty string (""), 0.0, false, NaN
i've dealt with a lot of unexpected behavior in the past few days due to the conversion of false to null.
chandlerkent
Sat Jun 06 10:39:05 -0700 2009
| link
I'm not sure if this should be closed due to the new inclusion of json2.js.
tlrobinson
Sat Jun 06 14:40:08 -0700 2009
| link
-
Ellipse Stroke and Fill broken for non-square rectangles
1 comment Created 7 months ago by spakanatiCGContextStrokeEllipseInRect and CGContextFillEllipseInRect only work if passed perfect squares. For example, CGContextStrokeEllipseInRect(aContext,CPMakeRect(0,0,10,11)) results in "KAPPA is not defined" error.
Comments
-
Typo in filename: CPWindowStandardCLoseButtonHighlighted.png
1 comment Created 7 months ago by benedikt -
Textfields with backgroundcolor doesn't work
1 comment Created 7 months ago by [deleted user] -
Non-ASCII-Characters make some problems
4 comments Created 7 months ago by [deleted user]I have some problems with non ASCII-Charakters:
The german "Umlaute" like ä, ö , Ă¼ - Ă„, Ăœ, Ă– doesn't work.
I try it with the the HTML-Tags & a u m l ; , & o u m l ; , ... , but doesn't work, too.
This letters are shown as a question mark.Comments
Are you referring to hard-coded text in a .j file and if yes did you try to set your file encoding to UTF-8 ?
Is this still an issue, we had a UTF8 fix go in recently
-
2 Backgroundcolor - Problems:
a)
if your window is 800x600 pixels, and you use a backgroundcolor in the AppController.j,
the hole page in safari is blue, instead of only the 800x600 pixels.b)
if you set the
[theWindow setFullBridge:YES]; to NO or comment it out with // the backgroundcolor is gone. No BGcolor anymore there.workaround: i use a 1x1 pixel with the color, made an image in interfacebuilder about the hole window and send it to back.
Comments
I don't understand this bug. Could you please provide a sample application that exhibits the problem?
[deleted user] Sat May 30 14:11:06 -0700 2009 | linkok, no problem. :)
example for a)
[i delete the link, because of high traffic]This is the example, that the backgroundcolor make all to blue, just not the x to y - size of the webapp.
in the .j, i make a comment
//the background-color error to find easier the bg-color - entry.b)
i add to same code the setFullBridge:NO,
and the backgroundcolor is gone.examplecode:
[i delete the link, because of high traffic]EDIT: [i delete the link, because of high traffic - if the examples needed again, please contact me]
hey can we please have these tests again, you can paste them as gists http://gist.github.com/ to save your traffic.
thanks
-
9 buttons in a row, same Y-Height, one jump in the sky
3 comments Created 7 months ago by [deleted user]I made 9 borderless buttons in one row in IB, all with the same Y-Height, different nonoverlapping X.
After nib2cib and testing it in Safari, some buttons are higher?Comments
I have created a NibApp then used IB to add 9 borderless buttons in a row and used nib2cib... i dont see any alignment problem . might have miss understood the problem
-
Selecting an added item to CPCollectionView does not work
1 comment Created 7 months ago by saikatI am trying to select the text of a text field that is being added to a collection view. It doesn't work, however, when attempting to do this after a reload of the content. For more details, look at the comments in the code.
http://dl.getdropbox.com/u/211886/CPCollectionSelectOnAddBug.zip
Comments
-
When trying to set focus and selection on a CPTextField, odd behavior occurs
4 comments Created 7 months ago by saikatWhen I attempt to make a CPTextField editable with its text highlighted upon double clicking, the order in which it is made first responder, set to be editable, and selected seem to affect the results in a non-intuitive way. See the code and comments in the code for details:
Comments
Yes and no. I still get the problem, except now, none of the examples I have listed work correctly to select the text either (I talked with Ross a while back about selectText having gotten broken - I was going to look into it at some point). Also, with the second example in my example code, I now get it so that the text field doesn't receive focus on the first double click but does on the second double click. I'm using the jake branch of Cappuccino to test.
-
I use following code, but the Control will not be rendered "disabled" when I use default theme aristo.
btnSave = [[CPButton alloc] initWithFrame:CGRectMake(500,15,100,24)]; [btnSave setTitle:@"save"]; [btnSave setFrameOrigin:CGPointMake(CGRectGetWidth([self bounds]) - 230, 15)]; [btnSave setAutoresizingMask:CPViewMinXMargin]; [btnSave setAction:@selector(saveToServer:)]; [btnSave setTarget:self]; [btnSave setEnabled:false]; [self addSubview:btnSave];It is disabled. But visualization is wrong. With version 0.6 it worked just fine.
Comments
chandlerkent
Sat Jun 06 10:22:11 -0700 2009
| link
The button is in fact disabled, but it looks exactly the same as an enabled button.
Here is a more simplified test case:
Tested on release version 0.7.
-
Q: How can I configure "onChange" event on CPTextField?
4 comments Created 7 months ago by cwsIt''s more a question, than a bug report:
I tried a lot, but I cannot get into. Any idea, how to configure a "onChange" event immediately when content of CPTextField changes? By default, the event method will be called, if I press "return" key:inpHelper = [[CPTextField alloc] initWithFrame:CGRectMake(150, 50, 200, 24)]; [inpHelper setEditable:true]; [inpHelper setBezeled:true]; [inpHelper setAction:@selector(findHelper:)];I think I must deal with "sendActionOn" but I don't know how.
This should be used for a AJAX autocomplete function.
Comments
Firstly:
Text fields support the following 3 delegate methods:controlTextDidBeginEditing: (CPTextField)aTextField
controlTextDidChange: (CPTextField)aTextField
controlTextDidEndEditing: (CPTextField)aTextFieldWhat you want to do is implement controlTextDidChange: in the text fields delegate class.
Secondly:
This question should be directed towards the mailing list or irc channel rather than the issue tracker. Mailing list and irc channels can be found here: http://cappuccino.org/discuss/list.php
sirsgriffin
Wed Jun 03 11:18:28 -0700 2009
| link
no problem. I was a bit off on the parameters to the delegate method though. These methods use the notification manager and as such pass in CPNotification objects, of which the CPTextField will be the object property object and can be accessed via [aNotification object].
-
I have got a strange behavior. If I add items to a CPPopUpButton on the "onSuccess" function of a prototype ajax call, both label divs of the collapsed CPPopUpButton use the font color "black", so that it appears "bold" instead of "white/black" combination.
Here is the a code snippet:
- (void)loadDepartments { new Ajax.Request('loadDepartments.php', { method:'post', parameters: {selection: "all"}, onSuccess: function(nom, json){ for (var i = 0; i < json.length; i++) { [ddnAbteilung addItemWithTitle: json[i].description]; } }, onFailure: function(){ [self showAJAXErrorAlert]; } }); }The web-inspector of Safari 4 beta shows me following divs:
<div style="position: absolute; cursor: default; z-index: 200; font: normal normal bold 12px/normal Arial; text-overflow: ellipsis; white-space: nowrap; overflow-x: hidden; overflow-y: hidden; top: 5px; left: 0px; width: 163px; height: 15px; ">Some json response text</div> <div style="position: absolute; cursor: default; z-index: 150; font: normal normal bold 12px/normal Arial; overflow-x: hidden; overflow-y: hidden; white-space: nowrap; text-overflow: ellipsis; top: 6px; left: 0px; width: 163px; height: 15px; ">Some json response text</div>Normally it shoud look like this:
<div style="position: absolute; cursor: default; z-index: 200; font: normal normal bold 12px/normal Arial; text-overflow: ellipsis; white-space: nowrap; overflow-x: hidden; overflow-y: hidden; top: 5px; left: 0px; width: 163px; height: 15px; ">Some json response text</div> <div style="position: absolute; cursor: default; z-index: 150; font: normal normal bold 12px/normal Arial; overflow-x: hidden; overflow-y: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgb(240, 240, 240); top: 6px; left: 0px; width: 163px; height: 15px; ">Some json response text</div>What do you think could be the problem?
Comments
If you are using callbacks outside of Cappuccino you need to end them with
[[CPRunLoop currentRunLoop] limitDateForMode:nil]
See if it works after placing that in there
Thanks. It should look like this, or?
- (void)loadDepartments { new Ajax.Request('loadDepartments.php', { method:'post', parameters: {selection: "all"}, onSuccess: function(nom, json){ for (var i = 0; i < json.length; i++) { [ddnAbteilung addItemWithTitle: json[i].description]; } [[CPRunLoop currentRunLoop] limitDateForMode:nil]; }, onFailure: function(){ [self showAJAXErrorAlert]; } }); }It has no impact. The text on the collapsed drown down is still looking "bold", because both layers are rendered with black font. Any further idea available?
I think it is using "CPMenuItemSelectionColor" twice instead of "CPMenuItemTextShadowColor" for rendering the colapsed popup, when I am using the above mentioned example.
Btw: It appears similar bold if I use native AJAX requests:
- (void)loadDepartments { var request = [CPURLRequest requestWithURL:"loadDepartments.php"]; connection = [CPURLConnection connectionWithRequest:request delegate: self]; } - (void)connection:(CPURLConnection)connection didReceiveData:(CPString)data { var jsonObj = [data objectFromJSON]; for (var i = 0; i < jsonObj.length; i++) { [ddnAbteilung addItemWithTitle: jsonObj[i].description]; } }This is my PHP part, which catches 50 items from the mysql database:
<?php require_once("Config/config.php"); $dbcon = mysql_connect($db_path, $db_user,$db_pw); mysql_select_db($db_scheme); $response = array(); $sql = "SELECT a.`id`, concat(a.`id`, ' - ', a.`description`) FROM departments a ORDER BY a.`id`;"; $result = mysql_query($sql); if ($result) { while($row = mysql_fetch_row($result)) { $response[] = array('id' => $row[0], 'description' => utf8_encode($row[1])); } mysql_free_result($result); } else { $response[] = array('id' => '0', 'description' => '[no dept.]'); } mysql_close($dbcon); header('text/x-json'); echo trim(json_encode($response)); ?>Any idea?
Here is a patch for this issue:
From <a href="/280north/cappuccino/commit/a447de487bd1a28b23384a18ff988854a989e6e4">a447de4</a> Mon Sep 17 00:00:00 2001 From: Nick Takayama <nicktak@mac.com> Date: Wed, 17 Jun 2009 21:38:27 +0800 Subject: [PATCH] fix for issue <a href="/280north/cappuccino/issues/#issue/147" class="internal">#147</a> where CPPopUpButtons with no initial values would render wrong shadow color when populated --- AppKit/_CPImageAndTextView.j | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index 8710d26..5b850f5 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -395,7 +395,7 @@ var HORIZONTAL_MARGIN = 3.0, hasDOMTextShadowElement = YES; - _flags |= _CPImageAndTextViewTextChangedFlag; //sigh... + _flags |= _CPImageAndTextViewTextChangedFlag | _CPImageAndTextViewTextShadowColorChangedFlag; //sigh... } var shadowStyle = hasDOMTextShadowElement ? _DOMTextShadowElement.style : nil; -- 1.6.0.2 -
I ran into a problem when compiling the Objective-J code: the page wouldn't load if I compiled a .j file containing a UTF-8 character in Debug mode. If I compiled in Release mode, the page would load, but the character is displayed incorrectly. When not using the compiler, everything works perfectly.
-Fisk
Comments





Fixed.