mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:40:48 +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
2a8503b5b6
commit
fc22065400
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>
|
2004-04-16 15:33 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Source/NSTableView.m (-dragImageForRows:event:dragImageOffset:):
|
* Source/NSTableView.m (-dragImageForRows:event:dragImageOffset:):
|
||||||
|
@ -11,17 +17,17 @@
|
||||||
|
|
||||||
2004-04-13 Quentin Mathe <qmathe@club-internet.fr>
|
2004-04-13 Quentin Mathe <qmathe@club-internet.fr>
|
||||||
|
|
||||||
* Source/NSToolbarItem.m:
|
* Source/NSToolbarItem.m:
|
||||||
* Headers/AppKit/NSToolbarItem.h:
|
* Headers/AppKit/NSToolbarItem.h:
|
||||||
* Source/NSToolbar.m:
|
* Source/NSToolbar.m:
|
||||||
* Headers/AppKit/NSToolbar.h:
|
* Headers/AppKit/NSToolbar.h:
|
||||||
* Source/GSToolbar.m:
|
* Source/GSToolbar.m:
|
||||||
* Headers/GNUstepGUI/GSToolbar.h:
|
* Headers/GNUstepGUI/GSToolbar.h:
|
||||||
* Source/GSToolbarView.m:
|
* Source/GSToolbarView.m:
|
||||||
* Headers/GNUstepGUI/GSToolbarView.h:
|
* Headers/GNUstepGUI/GSToolbarView.h:
|
||||||
* Source/NSWindow+Toolbar.m:
|
* Source/NSWindow+Toolbar.m:
|
||||||
* Headers/AppKit/NSWindow+Toolbar.h:
|
* Headers/AppKit/NSWindow+Toolbar.h:
|
||||||
Added support for display mode and size mode and other minor changes.
|
Added support for display mode and size mode and other minor changes.
|
||||||
|
|
||||||
2004-04-09 Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
|
2004-04-09 Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
#include <Foundation/NSDebug.h>
|
#include <Foundation/NSDebug.h>
|
||||||
|
|
||||||
|
#include "AppKit/NSApplication.h"
|
||||||
#include "AppKit/NSToolbarItem.h"
|
#include "AppKit/NSToolbarItem.h"
|
||||||
#include "AppKit/NSMenu.h"
|
#include "AppKit/NSMenu.h"
|
||||||
#include "AppKit/NSMenuItem.h"
|
#include "AppKit/NSMenuItem.h"
|
||||||
|
@ -78,11 +79,14 @@
|
||||||
@interface GSToolbarButton : NSButton
|
@interface GSToolbarButton : NSButton
|
||||||
{
|
{
|
||||||
NSToolbarItem *_toolbarItem;
|
NSToolbarItem *_toolbarItem;
|
||||||
|
SEL _toolbarItemAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem;
|
- (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem;
|
||||||
- (void) layout;
|
- (void) layout;
|
||||||
|
- (void) setToolbarItemAction: (SEL)action;
|
||||||
- (NSToolbarItem *) toolbarItem;
|
- (NSToolbarItem *) toolbarItem;
|
||||||
|
- (SEL) toolbarItemAction;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GSToolbarButton
|
@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
|
- (NSToolbarItem *) toolbarItem
|
||||||
{
|
{
|
||||||
return _toolbarItem;
|
return _toolbarItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setToolbarItemAction: (SEL) action
|
||||||
|
{
|
||||||
|
_toolbarItemAction = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (SEL) toolbarItemAction
|
||||||
|
{
|
||||||
|
return _toolbarItemAction;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -653,13 +680,13 @@
|
||||||
// gets
|
// gets
|
||||||
_flags._isEnabled = [_backView respondsToSelector: @selector(isEnabled)];
|
_flags._isEnabled = [_backView respondsToSelector: @selector(isEnabled)];
|
||||||
_flags._tag = YES;
|
_flags._tag = YES;
|
||||||
_flags._action = [_backView respondsToSelector: @selector(action)];
|
_flags._action = [_backView respondsToSelector: @selector(toolbarItemAction)];
|
||||||
_flags._target = [_backView respondsToSelector: @selector(target)];
|
_flags._target = [_backView respondsToSelector: @selector(target)];
|
||||||
_flags._image = [_backView respondsToSelector: @selector(image)];
|
_flags._image = [_backView respondsToSelector: @selector(image)];
|
||||||
// sets
|
// sets
|
||||||
_flags._setEnabled = [_backView respondsToSelector: @selector(setEnabled:)];
|
_flags._setEnabled = [_backView respondsToSelector: @selector(setEnabled:)];
|
||||||
_flags._setTag = YES;
|
_flags._setTag = YES;
|
||||||
_flags._setAction = [_backView respondsToSelector: @selector(setAction:)];
|
_flags._setAction = [_backView respondsToSelector: @selector(setToolbarItemAction:)];
|
||||||
_flags._setTarget = [_backView respondsToSelector: @selector(setTarget:)];
|
_flags._setTarget = [_backView respondsToSelector: @selector(setTarget:)];
|
||||||
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
||||||
|
|
||||||
|
@ -726,8 +753,8 @@
|
||||||
{
|
{
|
||||||
if(_flags._setAction)
|
if(_flags._setAction)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [NSButton class]])
|
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||||
[(NSButton *)_backView setAction: action];
|
[(GSToolbarButton *)_backView setToolbarItemAction: action];
|
||||||
if (action != NULL)
|
if (action != NULL)
|
||||||
{
|
{
|
||||||
[(NSButton *)_backView setEnabled: YES];
|
[(NSButton *)_backView setEnabled: YES];
|
||||||
|
@ -819,12 +846,12 @@
|
||||||
{
|
{
|
||||||
// gets
|
// gets
|
||||||
_flags._isEnabled = [_backView respondsToSelector: @selector(isEnabled)];
|
_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._target = [_backView respondsToSelector: @selector(target)];
|
||||||
_flags._image = [_backView respondsToSelector: @selector(image)];
|
_flags._image = [_backView respondsToSelector: @selector(image)];
|
||||||
// sets
|
// sets
|
||||||
_flags._setEnabled = [_backView respondsToSelector: @selector(setEnabled:)];
|
_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._setTarget = [_backView respondsToSelector: @selector(setTarget:)];
|
||||||
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
_flags._setImage = [_backView respondsToSelector: @selector(setImage:)];
|
||||||
}
|
}
|
||||||
|
@ -907,8 +934,8 @@
|
||||||
{
|
{
|
||||||
if(_flags._action)
|
if(_flags._action)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [NSButton class]])
|
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||||
return [(NSButton *)_backView action];
|
return [(GSToolbarButton *)_backView toolbarItemAction];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue