mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:40:48 +00:00
Added methods to handle target and action.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9146 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3010c7e6e4
commit
b7b85df10a
1 changed files with 30 additions and 1 deletions
|
@ -240,6 +240,8 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
- (void) setColor: (NSColor *)color
|
- (void) setColor: (NSColor *)color
|
||||||
{
|
{
|
||||||
ASSIGN(_the_color, color);
|
ASSIGN(_the_color, color);
|
||||||
|
// Notify our target of colour change
|
||||||
|
[self sendAction: _action to: _target];
|
||||||
[self setNeedsDisplay: YES];
|
[self setNeedsDisplay: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,10 +249,31 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
{
|
{
|
||||||
if ([sender respondsToSelector: @selector(color)])
|
if ([sender respondsToSelector: @selector(color)])
|
||||||
{
|
{
|
||||||
ASSIGN(_the_color, [sender color]);
|
[self setColor: [sender color]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (void) setAction: (SEL)action
|
||||||
|
{
|
||||||
|
_action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (SEL) action
|
||||||
|
{
|
||||||
|
return _action;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setTarget: (id)target
|
||||||
|
{
|
||||||
|
_target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) target
|
||||||
|
{
|
||||||
|
return _target;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Managing Borders
|
// Managing Borders
|
||||||
//
|
//
|
||||||
|
@ -321,6 +344,8 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
[aCoder encodeObject: _the_color];
|
[aCoder encodeObject: _the_color];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_active];
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_active];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_bordered];
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_bordered];
|
||||||
|
[aCoder encodeConditionalObject: _target];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
|
@ -329,6 +354,10 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_the_color];
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_the_color];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_active];
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_active];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_bordered];
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_bordered];
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_target];
|
||||||
|
// Undo RETAIN by decoder
|
||||||
|
TEST_RELEASE(_target);
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue