mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 16:20:46 +00:00
Sender for NSToolbarItem action corrected
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19200 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f126976fd5
commit
b48e7de1bc
2 changed files with 52 additions and 19 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,9 @@
|
|||
2004-04-27 Quentin mathe <qmathe@club-internet.fr>
|
||||
|
||||
* Source/NSToolbarItem.m: Modified to have the action message sent by
|
||||
NSToolbarItem instances (not by GSToolbarButton instances) in order to
|
||||
match the Mac OS X behavior. (Bug reported by Ludovic Marcotte)
|
||||
|
||||
2004-04-16 15:33 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSTableView.m (-dragImageForRows:event:dragImageOffset:):
|
||||
|
@ -11,17 +17,17 @@
|
|||
|
||||
2004-04-13 Quentin Mathe <qmathe@club-internet.fr>
|
||||
|
||||
* Source/NSToolbarItem.m:
|
||||
* Headers/AppKit/NSToolbarItem.h:
|
||||
* Source/NSToolbar.m:
|
||||
* Headers/AppKit/NSToolbar.h:
|
||||
* Source/GSToolbar.m:
|
||||
* Headers/GNUstepGUI/GSToolbar.h:
|
||||
* Source/GSToolbarView.m:
|
||||
* Headers/GNUstepGUI/GSToolbarView.h:
|
||||
* Source/NSWindow+Toolbar.m:
|
||||
* Headers/AppKit/NSWindow+Toolbar.h:
|
||||
Added support for display mode and size mode and other minor changes.
|
||||
* Source/NSToolbarItem.m:
|
||||
* Headers/AppKit/NSToolbarItem.h:
|
||||
* Source/NSToolbar.m:
|
||||
* Headers/AppKit/NSToolbar.h:
|
||||
* Source/GSToolbar.m:
|
||||
* Headers/GNUstepGUI/GSToolbar.h:
|
||||
* Source/GSToolbarView.m:
|
||||
* Headers/GNUstepGUI/GSToolbarView.h:
|
||||
* Source/NSWindow+Toolbar.m:
|
||||
* Headers/AppKit/NSWindow+Toolbar.h:
|
||||
Added support for display mode and size mode and other minor changes.
|
||||
|
||||
2004-04-09 Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include "AppKit/NSApplication.h"
|
||||
#include "AppKit/NSToolbarItem.h"
|
||||
#include "AppKit/NSMenu.h"
|
||||
#include "AppKit/NSMenuItem.h"
|
||||
|
@ -78,11 +79,14 @@
|
|||
@interface GSToolbarButton : NSButton
|
||||
{
|
||||
NSToolbarItem *_toolbarItem;
|
||||
SEL _toolbarItemAction;
|
||||
}
|
||||
|
||||
- (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem;
|
||||
- (void) layout;
|
||||
- (void) setToolbarItemAction: (SEL)action;
|
||||
- (NSToolbarItem *) toolbarItem;
|
||||
- (SEL) toolbarItemAction;
|
||||
@end
|
||||
|
||||
@implementation GSToolbarButton
|
||||
|
@ -171,10 +175,33 @@
|
|||
|
||||
}
|
||||
|
||||
- (BOOL) sendAction: (SEL)action to: (id)target
|
||||
{
|
||||
if (_toolbarItemAction)
|
||||
{
|
||||
return [NSApp sendAction: _toolbarItemAction to: target from: _toolbarItem];
|
||||
}
|
||||
else
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSToolbarItem *) toolbarItem
|
||||
{
|
||||
return _toolbarItem;
|
||||
}
|
||||
|
||||
- (void) setToolbarItemAction: (SEL) action
|
||||
{
|
||||
_toolbarItemAction = action;
|
||||
}
|
||||
|
||||
- (SEL) toolbarItemAction
|
||||
{
|
||||
return _toolbarItemAction;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
|
@ -653,13 +680,13 @@
|
|||
// gets
|
||||
_flags._isEnabled = [_backView respondsToSelector: @selector(isEnabled)];
|
||||
_flags._tag = YES;
|
||||
_flags._action = [_backView respondsToSelector: @selector(action)];
|
||||
_flags._action = [_backView respondsToSelector: @selector(toolbarItemAction)];
|
||||
_flags._target = [_backView respondsToSelector: @selector(target)];
|
||||
_flags._image = [_backView respondsToSelector: @selector(image)];
|
||||
// sets
|
||||
_flags._setEnabled = [_backView respondsToSelector: @selector(setEnabled:)];
|
||||
_flags._setTag = YES;
|
||||
_flags._setAction = [_backView respondsToSelector: @selector(setAction:)];
|
||||
_flags._setAction = [_backView respondsToSelector: @selector(setToolbarItemAction:)];
|
||||
_flags._setTarget = [_backView respondsToSelector: @selector(setTarget:)];
|
||||
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
||||
|
||||
|
@ -726,8 +753,8 @@
|
|||
{
|
||||
if(_flags._setAction)
|
||||
{
|
||||
if ([_backView isKindOfClass: [NSButton class]])
|
||||
[(NSButton *)_backView setAction: action];
|
||||
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||
[(GSToolbarButton *)_backView setToolbarItemAction: action];
|
||||
if (action != NULL)
|
||||
{
|
||||
[(NSButton *)_backView setEnabled: YES];
|
||||
|
@ -819,12 +846,12 @@
|
|||
{
|
||||
// gets
|
||||
_flags._isEnabled = [_backView respondsToSelector: @selector(isEnabled)];
|
||||
_flags._action = [_backView respondsToSelector: @selector(action)];
|
||||
_flags._action = [_backView respondsToSelector: @selector(toolbarItemAction)];
|
||||
_flags._target = [_backView respondsToSelector: @selector(target)];
|
||||
_flags._image = [_backView respondsToSelector: @selector(image)];
|
||||
// sets
|
||||
_flags._setEnabled = [_backView respondsToSelector: @selector(setEnabled:)];
|
||||
_flags._setAction = [_backView respondsToSelector: @selector(setAction:)];
|
||||
_flags._setAction = [_backView respondsToSelector: @selector(setToolbarItemAction:)];
|
||||
_flags._setTarget = [_backView respondsToSelector: @selector(setTarget:)];
|
||||
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
||||
}
|
||||
|
@ -907,8 +934,8 @@
|
|||
{
|
||||
if(_flags._action)
|
||||
{
|
||||
if ([_backView isKindOfClass: [NSButton class]])
|
||||
return [(NSButton *)_backView action];
|
||||
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||
return [(GSToolbarButton *)_backView toolbarItemAction];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue