mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 14:30:48 +00:00
Merged Trunk changes from rev 35219 to TestPlant branch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36953 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
343da32c8c
commit
4b27157a46
215 changed files with 13994 additions and 8840 deletions
|
@ -363,7 +363,7 @@ static NSMapTable *viewInfo = 0;
|
|||
return _font;
|
||||
}
|
||||
|
||||
- (void) setHighlightedItemIndex: (int)index
|
||||
- (void) setHighlightedItemIndex: (NSInteger)index
|
||||
{
|
||||
NSMenuItemCell *aCell;
|
||||
|
||||
|
@ -390,13 +390,13 @@ static NSMapTable *viewInfo = 0;
|
|||
}
|
||||
}
|
||||
|
||||
- (int) highlightedItemIndex
|
||||
- (NSInteger) highlightedItemIndex
|
||||
{
|
||||
return _highlightedItemIndex;
|
||||
}
|
||||
|
||||
- (void) setMenuItemCell: (NSMenuItemCell *)cell
|
||||
forItemAtIndex: (int)index
|
||||
forItemAtIndex: (NSInteger)index
|
||||
{
|
||||
NSMenuItem *anItem = [_items_link objectAtIndex: index];
|
||||
|
||||
|
@ -416,7 +416,7 @@ static NSMapTable *viewInfo = 0;
|
|||
[self setNeedsDisplayForItemAtIndex: index];
|
||||
}
|
||||
|
||||
- (NSMenuItemCell*) menuItemCellForItemAtIndex: (int)index
|
||||
- (NSMenuItemCell*) menuItemCellForItemAtIndex: (NSInteger)index
|
||||
{
|
||||
if (index < [_itemCells count])
|
||||
return [_itemCells objectAtIndex: index];
|
||||
|
@ -564,7 +564,7 @@ static NSMapTable *viewInfo = 0;
|
|||
}
|
||||
}
|
||||
|
||||
- (void) attachSubmenuForItemAtIndex: (int)index
|
||||
- (void) attachSubmenuForItemAtIndex: (NSInteger)index
|
||||
{
|
||||
/*
|
||||
* Transient menus are used for torn-off menus, which are already on the
|
||||
|
@ -962,7 +962,7 @@ static NSMapTable *viewInfo = 0;
|
|||
}
|
||||
}
|
||||
|
||||
- (NSRect) rectOfItemAtIndex: (int)index
|
||||
- (NSRect) rectOfItemAtIndex: (NSInteger)index
|
||||
{
|
||||
if (_needsSizing == YES)
|
||||
{
|
||||
|
@ -1001,7 +1001,7 @@ static NSMapTable *viewInfo = 0;
|
|||
}
|
||||
}
|
||||
|
||||
- (int) indexOfItemAtPoint: (NSPoint)point
|
||||
- (NSInteger) indexOfItemAtPoint: (NSPoint)point
|
||||
{
|
||||
unsigned howMany = [_itemCells count];
|
||||
unsigned i;
|
||||
|
@ -1029,7 +1029,7 @@ static NSMapTable *viewInfo = 0;
|
|||
return -1;
|
||||
}
|
||||
|
||||
- (void) setNeedsDisplayForItemAtIndex: (int)index
|
||||
- (void) setNeedsDisplayForItemAtIndex: (NSInteger)index
|
||||
{
|
||||
NSRect aRect;
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ static NSMapTable *viewInfo = 0;
|
|||
- (void) setWindowFrameForAttachingToRect: (NSRect)screenRect
|
||||
onScreen: (NSScreen*)screen
|
||||
preferredEdge: (NSRectEdge)edge
|
||||
popUpSelectedItem: (int)selectedItemIndex
|
||||
popUpSelectedItem: (NSInteger)selectedItemIndex
|
||||
{
|
||||
NSRect r;
|
||||
NSRect cellFrame;
|
||||
|
@ -1361,7 +1361,7 @@ static NSMapTable *viewInfo = 0;
|
|||
/*
|
||||
* Event Handling
|
||||
*/
|
||||
- (void) performActionWithHighlightingForItemAtIndex: (int)index
|
||||
- (void) performActionWithHighlightingForItemAtIndex: (NSInteger)index
|
||||
{
|
||||
NSMenu *candidateMenu = _attachedMenu;
|
||||
NSMenuView *targetMenuView;
|
||||
|
@ -1445,7 +1445,7 @@ static NSMapTable *viewInfo = 0;
|
|||
- (BOOL) _trackWithEvent: (NSEvent*)event
|
||||
startingMenuView: (NSMenuView*)mainWindowMenuView
|
||||
{
|
||||
unsigned eventMask = NSPeriodicMask;
|
||||
NSUInteger eventMask = NSPeriodicMask;
|
||||
NSDate *theDistantFuture = [NSDate distantFuture];
|
||||
NSPoint lastLocation = {0,0};
|
||||
BOOL justAttachedNewSubmenu = NO;
|
||||
|
@ -1454,6 +1454,8 @@ static NSMapTable *viewInfo = 0;
|
|||
int delayCount = 0;
|
||||
int indexOfActionToExecute = -1;
|
||||
int firstIndex = -1;
|
||||
NSInterfaceStyle style =
|
||||
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self);
|
||||
NSEvent *original;
|
||||
NSEventType type;
|
||||
|
||||
|
@ -1496,21 +1498,22 @@ static NSMapTable *viewInfo = 0;
|
|||
|
||||
/*We need know if the user press a modifier key to close the menu
|
||||
when the menu is in a window*/
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self) ==
|
||||
NSWindows95InterfaceStyle)
|
||||
if (style == NSWindows95InterfaceStyle)
|
||||
{
|
||||
eventMask |= NSFlagsChangedMask;
|
||||
}
|
||||
|
||||
/* We attempt to mimic Mac OS X behavior for pop up menus. If the user
|
||||
presses the mouse button over a pop up button and then drags the mouse
|
||||
over the menu, the menu is closed when the user releases the mouse. On the
|
||||
other hand, when the user clicks on the button and then moves the mouse
|
||||
the menu is closed upon the next mouse click. */
|
||||
// Ignore the first mouse up if menu is horizontal.
|
||||
if ([self isHorizontal] == YES ||
|
||||
([[self menu] _ownedByPopUp] == YES &&
|
||||
NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self)
|
||||
== NSMacintoshInterfaceStyle))
|
||||
// Or if menu is transient and style is NSWindows95InterfaceStyle.
|
||||
([[self menu] isTransient] && style == NSWindows95InterfaceStyle) ||
|
||||
/* Or to mimic Mac OS X behavior for pop up menus. If the user
|
||||
presses the mouse button over a pop up button and then drags the mouse
|
||||
over the menu, the menu is closed when the user releases the mouse. On
|
||||
the other hand, when the user clicks on the button and then moves the
|
||||
mouse the menu is closed upon the next mouse click. */
|
||||
([[self menu] _ownedByPopUp] &&
|
||||
style == NSMacintoshInterfaceStyle))
|
||||
{
|
||||
/*
|
||||
* Ignore the first mouse up if nothing interesting has happened.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue