mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 08:51:29 +00:00
Add some more KVB and move some.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25746 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4590c33681
commit
0b14647109
3 changed files with 51 additions and 14 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-12-15 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSTextField.m: Move some KVB to NSControl, add binding
|
||||||
|
for text colour.
|
||||||
|
* Source/NSControl.m: Add some bindings from NSTextField plus
|
||||||
|
NSValueBinding.
|
||||||
|
|
||||||
2007-12-13 Fred Kiefer <FredKiefer@gmx.de>
|
2007-12-13 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/GSBindingHelpers.h,
|
* Source/GSBindingHelpers.h,
|
||||||
|
|
|
@ -39,9 +39,11 @@
|
||||||
#include "AppKit/NSControl.h"
|
#include "AppKit/NSControl.h"
|
||||||
#include "AppKit/NSColor.h"
|
#include "AppKit/NSColor.h"
|
||||||
#include "AppKit/NSEvent.h"
|
#include "AppKit/NSEvent.h"
|
||||||
|
#include "AppKit/NSKeyValueBinding.h"
|
||||||
#include "AppKit/NSTextStorage.h"
|
#include "AppKit/NSTextStorage.h"
|
||||||
#include "AppKit/NSTextView.h"
|
#include "AppKit/NSTextView.h"
|
||||||
#include "AppKit/NSWindow.h"
|
#include "AppKit/NSWindow.h"
|
||||||
|
#include "GSBindingHelpers.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class variables
|
* Class variables
|
||||||
|
@ -69,7 +71,13 @@ static NSNotificationCenter *nc;
|
||||||
actionCellClass = [NSActionCell class];
|
actionCellClass = [NSActionCell class];
|
||||||
// Cache the notifiaction centre for editing notifications
|
// Cache the notifiaction centre for editing notifications
|
||||||
nc = [NSNotificationCenter defaultCenter];
|
nc = [NSNotificationCenter defaultCenter];
|
||||||
}
|
|
||||||
|
// expose bindings
|
||||||
|
[self exposeBinding: NSValueBinding];
|
||||||
|
[self exposeBinding: NSEnabledBinding];
|
||||||
|
[self exposeBinding: NSAlignmentBinding];
|
||||||
|
[self exposeBinding: NSFontBinding];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**<p> Returns the cell Class used by NSControl. Used by subclasses.</p>
|
/**<p> Returns the cell Class used by NSControl. Used by subclasses.</p>
|
||||||
|
@ -959,4 +967,38 @@ static NSNotificationCenter *nc;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) bind: (NSString *)binding
|
||||||
|
toObject: (id)anObject
|
||||||
|
withKeyPath: (NSString *)keyPath
|
||||||
|
options: (NSDictionary *)options
|
||||||
|
{
|
||||||
|
if ([binding isEqual: NSValueBinding])
|
||||||
|
{
|
||||||
|
[self unbind: binding];
|
||||||
|
[[GSKeyValueOrBinding alloc] initWithBinding: @"objectValue"
|
||||||
|
withName: NSValueBinding
|
||||||
|
toObject: anObject
|
||||||
|
withKeyPath: keyPath
|
||||||
|
options: options
|
||||||
|
fromObject: self];
|
||||||
|
}
|
||||||
|
else if ([binding hasPrefix: NSEnabledBinding])
|
||||||
|
{
|
||||||
|
[self unbind: binding];
|
||||||
|
[[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding
|
||||||
|
withName: binding
|
||||||
|
toObject: anObject
|
||||||
|
withKeyPath: keyPath
|
||||||
|
options: options
|
||||||
|
fromObject: self];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[super bind: binding
|
||||||
|
toObject: anObject
|
||||||
|
withKeyPath: keyPath
|
||||||
|
options: options];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -68,9 +68,7 @@ static Class textFieldCellClass;
|
||||||
nc = [NSNotificationCenter defaultCenter];
|
nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
[self exposeBinding: NSEditableBinding];
|
[self exposeBinding: NSEditableBinding];
|
||||||
[self exposeBinding: NSEnabledBinding];
|
[self exposeBinding: NSTextColorBinding];
|
||||||
[self exposeBinding: NSAlignmentBinding];
|
|
||||||
[self exposeBinding: NSFontBinding];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -766,16 +764,6 @@ static Class textFieldCellClass;
|
||||||
options: options
|
options: options
|
||||||
fromObject: self];
|
fromObject: self];
|
||||||
}
|
}
|
||||||
else if ([binding hasPrefix: NSEnabledBinding])
|
|
||||||
{
|
|
||||||
[self unbind: binding];
|
|
||||||
[[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding
|
|
||||||
withName: binding
|
|
||||||
toObject: anObject
|
|
||||||
withKeyPath: keyPath
|
|
||||||
options: options
|
|
||||||
fromObject: self];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[super bind: binding
|
[super bind: binding
|
||||||
|
|
Loading…
Reference in a new issue