Merge branch 'master' of git@github.com:280north/cappuccino

This commit is contained in:
Ross Boucher committed 2009-07-24 22:50:01 -07:00
commit 16be11325f
3 files changed
+36 -10

No files matched your search

+6 -5
View File
@@ -143,8 +143,7 @@ var CPSearchFieldSearchImage = nil,
// Managing Buttons
/*!
Sets the button used to display the search-button image
@param button
@param The search button.
@param button The search button.
*/
- (void)setSearchButton:(CPButton)button
{
@@ -567,7 +566,7 @@ var CPSearchFieldSearchImage = nil,
- (void)_showMenu:(id)sender
{
if(_searchMenu == nil)
if(_searchMenu == nil || ![self isEnabled])
return;
[super selectText:nil];
@@ -690,13 +689,15 @@ var CPSearchButtonKey = @"CPSearchButtonKey",
self = [super initWithCoder:coder];
_searchButton = [coder decodeObjectForKey:CPSearchButtonKey];
_searchButton = [coder decodeObjectForKey:CPCancelButtonKey];
_cancelButton = [coder decodeObjectForKey:CPCancelButtonKey];
_recentsAutosaveName = [coder decodeObjectForKey:CPRecentsAutosaveNameKey];
_sendsWholeSearchString = [coder decodeBoolForKey:CPSendsWholeSearchStringKey];
_sendsSearchStringImmediately = [coder decodeBoolForKey:CPSendsSearchStringImmediatelyKey];
_maximumRecents = [coder decodeIntForKey:CPMaximumRecentsKey];
[self setSearchMenuTemplate:[coder decodeObjectForKey:CPSearchMenuTemplateKey]];
[self resetCancelButton];
[self setDelegate:self];
return self;
}
+12 -1
View File
@@ -47,10 +47,21 @@ var _CPCibCustomObjectClassName = @"_CPCibCustomObjectClassName";
{
var theClass = CPClassFromString(_className);
#if DEBUG
// Hey this is us!
if (theClass === [self class])
{
_className = @"CPObject";
return self;
}
if (!theClass)
{
#if DEBUG
CPLog("Unknown class \"" + _className + "\" in cib file");
#endif
theClass = [CPObject class];
}
if (theClass === [CPApplication class])
return [CPApplication sharedApplication];
+18 -4
View File
@@ -170,6 +170,7 @@ var objj_preprocessor = function(aString, aSourceFile, aBundle, flags)
{
this._currentClass = "";
this._currentSuperClass = "";
this._currentSuperMetaClass = "";
this._file = aSourceFile;
this._fragments = [];
@@ -177,6 +178,7 @@ var objj_preprocessor = function(aString, aSourceFile, aBundle, flags)
this._tokens = new objj_lexer(aString);
this._flags = flags;
this._bundle = aBundle;
this._classMethod = false;
this.preprocess(this._tokens, this._preprocessed);
//alert(this._preprocessed + "");
@@ -262,8 +264,7 @@ objj_preprocessor.prototype.brackets = function(/*objj_lexer*/ tokens, /*objj_st
if (tuples[0][0].atoms[0] == TOKEN_SUPER)
{
CONCAT(aStringBuffer, "objj_msgSendSuper(");
CONCAT(aStringBuffer, "{ receiver:self, super_class:" + this._currentSuperClass + " }");
CONCAT(aStringBuffer, "{ receiver:self, super_class:" + (this._classMethod ? this._currentSuperMetaClass : this._currentSuperClass ) + " }");
}
else
{
@@ -350,7 +351,7 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
category = NO,
class_name = tokens.skip_whitespace(),
superclass_name = "Nil",
instance_methods = new objj_stringBuffer(),
class_methods = new objj_stringBuffer();
@@ -358,6 +359,7 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected class name, found \"" + class_name + "\"."));
this._currentSuperClass = NULL;
this._currentSuperMetaClass = NULL;
this._currentClass = class_name;
// If we reach an open parenthesis, we are declaring a category.
@@ -376,12 +378,18 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
CONCAT(buffer, "var meta_class = the_class.isa;");
var superclass_name = dictionary_getValue(SUPER_CLASSES, class_name);
// FIXME: We should have a better solution for this case, although it's actually not much slower than the real case.
if (!superclass_name)
{
this._currentSuperClass = "objj_getClass(\"" + class_name + "\").super_class";
this._currentSuperMetaClass = "objj_getMetaClass(\"" + class_name + "\").super_class";
}
else
{
this._currentSuperClass = "objj_getClass(\"" + superclass_name + "\")";
this._currentSuperMetaClass = "objj_getMeraClass(\"" + superclass_name + "\")";
}
}
else
{
@@ -394,7 +402,9 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
objj_exception_throw(new objj_exception(OBJJParseException, "*** Expected class name, found \"" + token + "\"."));
superclass_name = token;
this._currentSuperClass = "objj_getClass(\"" + superclass_name + "\")";
this._currentSuperMetaClass = "objj_getMetaClass(\"" + superclass_name + "\")";
dictionary_setValue(SUPER_CLASSES, class_name, superclass_name);
@@ -503,6 +513,8 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
{
if (token == TOKEN_PLUS)
{
this._classMethod = true;
if (IS_NOT_EMPTY(class_methods))
CONCAT(class_methods, ", ");
@@ -511,6 +523,8 @@ objj_preprocessor.prototype.implementation = function(tokens, /*objj_stringBuffe
else if (token == TOKEN_MINUS)
{
this._classMethod = false;
if (IS_NOT_EMPTY(instance_methods))
CONCAT(instance_methods, ", ");