This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* | |
* Created by __Me__ on __Date__. | |
* Copyright 2008 __MyCompanyName__. All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import "Checkbox.j" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ZebraList : CPCollectionView | |
{ | |
CPView _backgroundFrame; | |
} | |
+ (void)initialize | |
{ | |
backgroundImage = [[CPImage alloc] initWithContentsOfFile: "Resources/ZebraList/bg.png" size: CPSizeMake(1, 40)]; | |
} | |
-(id)initWithFrame:(CPRect)frame | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- coding: utf-8 -*- | |
* | |
* Starrater with a revised version from boucher from 280North | |
*/ | |
@import <AppKit/CPControl.j> | |
@import <AppKit/CPImage.j> | |
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)], | |
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- coding: utf-8 -*- | |
* | |
* Starrater with a revised version from boucher from 280North | |
*/ | |
@import <AppKit/CPControl.j> | |
@import <AppKit/CPImage.j> | |
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)], | |
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- coding: utf-8 -*- | |
* | |
* Starrater with a revised version from boucher from 280North | |
*/ | |
@import <AppKit/CPControl.j> | |
@import <AppKit/CPImage.j> | |
var starEmpty = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/empty.gif" size: CPSizeMake(25, 25)], | |
starSet = [[CPImage alloc] initWithContentsOfFile: "Resources/StarRater/set.gif" size: CPSizeMake(25, 25)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* | |
* Created by __Me__ on __Date__. | |
* Copyright 2008 __MyCompanyName__. All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import "StarRatingView.j" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -*- coding: utf-8 -*- | |
* Created by Moritz Angermann on 6. March 2009. | |
* Copyright 2009 Moritz Angermann. All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- replace onward from line 429 of CPTextField | |
element.onblur = function () | |
{ | |
console.log("blur start"); | |
[self setObjectValue:element.value]; | |
[self sendAction:[self action] to:[self target]]; | |
[[self window] makeFirstResponder:nil]; | |
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode]; | |
console.log("blur end"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j | |
index 40ac8c5..d83c0e0 100644 | |
--- a/AppKit/CPTextField.j | |
+++ b/AppKit/CPTextField.j | |
@@ -129,6 +129,7 @@ var _CPTextFieldSquareBezelColor = nil, | |
if (!CPTextFieldDOMInputElement) | |
{ | |
CPTextFieldDOMInputElement = document.createElement("input"); | |
+ CPTextFieldDOMInputElement.isActive = NO; | |
CPTextFieldDOMInputElement.style.position = "absolute"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec map f x y = | |
match (x,y) with | |
([],_) | (_,[]) -> failwith "list do not have same length" | |
| ([a],[b]) -> [f a b] | |
| (h1::t1,h2::t2) -> (f h1 h2)::(map f t1 t2) | |
;; (* map *) | |
open Printf;; | |
Printf.printf "%d\n" (map (fun x y -> x * y) [1;2;3;4;5] [1;2;3;4;5]);; |
OlderNewer