mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:50:37 +00:00
* Source/NSMenuView.m:
New private method [NSMenuView -_itemCell] in newly created GNUstepPrivate category. * Source/NSMenu.m: Add GNUstepPrivate interface of NSMenuView. [NSMenu -_setOwnedByPopUp:]: update itemCells' menuView (fix NSPopUpButtonCell-decoding problem). * Source/NSPopUpButtonCell.m ([NSPopUpButtonCell -synchronizeTitleAndSelectedItem]): Fix "mouseUp outside of menu" problem. Now the previous selected item stay selected. ([NSPopUpButtonCell -initWithCoder:]): Set the selectedItem properly. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14446 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
54f5952632
commit
b24ec8eb74
4 changed files with 46 additions and 2 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2002-09-15 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
||||||
|
|
||||||
|
* Source/NSMenuView.m:
|
||||||
|
New private method [NSMenuView -_itemCell] in newly created
|
||||||
|
GNUstepPrivate category.
|
||||||
|
* Source/NSMenu.m:
|
||||||
|
Add GNUstepPrivate interface of NSMenuView.
|
||||||
|
[NSMenu -_setOwnedByPopUp:]: update itemCells' menuView
|
||||||
|
(fix NSPopUpButtonCell-decoding problem).
|
||||||
|
* Source/NSPopUpButtonCell.m
|
||||||
|
([NSPopUpButtonCell -synchronizeTitleAndSelectedItem]):
|
||||||
|
Fix "mouseUp outside of menu" problem. Now the previous
|
||||||
|
selected item stay selected.
|
||||||
|
([NSPopUpButtonCell -initWithCoder:]):
|
||||||
|
Set the selectedItem properly.
|
||||||
|
|
||||||
|
|
||||||
2002-09-15 13:17 Alexander Malmberg <alexander@malmberg.org>
|
2002-09-15 13:17 Alexander Malmberg <alexander@malmberg.org>
|
||||||
|
|
||||||
* Source/NSImage.m (compositeToPoint:fromRect:operation:,,
|
* Source/NSImage.m (compositeToPoint:fromRect:operation:,,
|
||||||
|
|
|
@ -70,6 +70,11 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSMenuView (GNUstepPrivate)
|
||||||
|
- (NSArray *)_itemCells;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
static NSZone *menuZone = NULL;
|
static NSZone *menuZone = NULL;
|
||||||
static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
static NSNotificationCenter *nc;
|
static NSNotificationCenter *nc;
|
||||||
|
@ -1338,7 +1343,17 @@ static NSNotificationCenter *nc;
|
||||||
[_aWindow setLevel: NSPopUpMenuWindowLevel];
|
[_aWindow setLevel: NSPopUpMenuWindowLevel];
|
||||||
[_bWindow setLevel: NSPopUpMenuWindowLevel];
|
[_bWindow setLevel: NSPopUpMenuWindowLevel];
|
||||||
}
|
}
|
||||||
// FIXME
|
|
||||||
|
{
|
||||||
|
NSArray *itemCells = [_view _itemCells];
|
||||||
|
int i;
|
||||||
|
int count = [itemCells count];
|
||||||
|
|
||||||
|
for ( i = 0; i < count; i++ )
|
||||||
|
{
|
||||||
|
[[itemCells objectAtIndex: i] setMenuView: _view];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1175,3 +1175,10 @@ _addLeftBorderOffsetToRect(NSRect aRect, BOOL isHorizontal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation NSMenuView (GNUstepPrivate)
|
||||||
|
- (NSArray *)_itemCells
|
||||||
|
{
|
||||||
|
return _itemCells;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
|
@ -376,8 +376,11 @@ static NSImage *_pbc_image[2];
|
||||||
{
|
{
|
||||||
int index = [[_menu menuRepresentation] highlightedItemIndex];
|
int index = [[_menu menuRepresentation] highlightedItemIndex];
|
||||||
|
|
||||||
|
if (index < 0)
|
||||||
|
index = [self indexOfSelectedItem];
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
[self selectItemAtIndex: index];
|
[self selectItemAtIndex: index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -629,10 +632,11 @@ static NSImage *_pbc_image[2];
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
{
|
{
|
||||||
int flag;
|
int flag;
|
||||||
|
id<NSMenuItem> selectedItem;
|
||||||
|
|
||||||
self = [super initWithCoder: aDecoder];
|
self = [super initWithCoder: aDecoder];
|
||||||
_menu = [aDecoder decodeObject];
|
_menu = [aDecoder decodeObject];
|
||||||
_selectedItem = [aDecoder decodeObject];
|
selectedItem = [aDecoder decodeObject];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &flag];
|
[aDecoder decodeValueOfObjCType: @encode(int) at: &flag];
|
||||||
_pbcFlags.pullsDown = flag;
|
_pbcFlags.pullsDown = flag;
|
||||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &flag];
|
[aDecoder decodeValueOfObjCType: @encode(int) at: &flag];
|
||||||
|
@ -645,6 +649,7 @@ static NSImage *_pbc_image[2];
|
||||||
_pbcFlags.arrowPosition = flag;
|
_pbcFlags.arrowPosition = flag;
|
||||||
|
|
||||||
[_menu _setOwnedByPopUp: self];
|
[_menu _setOwnedByPopUp: self];
|
||||||
|
[self selectItem: selectedItem];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue