mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 21:31:56 +00:00
Add type casts to keep compiler happy.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27481 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5eeaed8339
commit
d638941e57
5 changed files with 31 additions and 19 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSMenu.m
|
||||||
|
* Source/NSPopUpButton.m,
|
||||||
|
* Source/NSTextView.m,
|
||||||
|
* Source/GSNibLoading.m: Add type casts to keep compiler happy.
|
||||||
|
|
||||||
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
|
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add some 10.5 methods.
|
* Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add some 10.5 methods.
|
||||||
|
|
|
@ -95,11 +95,14 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface NSMenu (NibCompatibility)
|
@interface NSMenu (NibCompatibility)
|
||||||
- (void) _setGeometry;
|
|
||||||
- (void) _setMain: (BOOL)isMain;
|
- (void) _setMain: (BOOL)isMain;
|
||||||
@end
|
@end
|
||||||
|
@interface NSMenu (GNUstepPrivate)
|
||||||
|
- (void) _setGeometry;
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation NSMenu (NibCompatibility)
|
@implementation NSMenu (NibCompatibility)
|
||||||
|
// FIXME: Why can't this be merged with setMain: ?
|
||||||
- (void) _setMain: (BOOL)isMain
|
- (void) _setMain: (BOOL)isMain
|
||||||
{
|
{
|
||||||
if (isMain)
|
if (isMain)
|
||||||
|
@ -107,13 +110,11 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
NSMenuView *oldRep;
|
NSMenuView *oldRep;
|
||||||
NSInterfaceStyle oldStyle;
|
NSInterfaceStyle oldStyle;
|
||||||
NSInterfaceStyle newStyle;
|
NSInterfaceStyle newStyle;
|
||||||
NSMenuItem *appItem;
|
|
||||||
NSString *processName;
|
NSString *processName;
|
||||||
|
|
||||||
if([self numberOfItems] == 0)
|
if([self numberOfItems] == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
appItem = [self itemAtIndex: 0]; // Info item.
|
|
||||||
oldRep = [self menuRepresentation];
|
oldRep = [self menuRepresentation];
|
||||||
oldStyle = [oldRep interfaceStyle];
|
oldStyle = [oldRep interfaceStyle];
|
||||||
newStyle = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
|
newStyle = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil);
|
||||||
|
@ -146,19 +147,22 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
|
|
||||||
// if it's a standard menu, transform it to be more NeXT'ish/GNUstep-like
|
// if it's a standard menu, transform it to be more NeXT'ish/GNUstep-like
|
||||||
if(_menu.horizontal == NO)
|
if(_menu.horizontal == NO)
|
||||||
{
|
{
|
||||||
NSString *infoString = NSLocalizedString (@"Info", @"Info");
|
NSString *infoString = NSLocalizedString (@"Info", @"Info");
|
||||||
NSString *quitString = [NSString stringWithFormat: @"%@ %@",
|
NSString *quitString = [NSString stringWithFormat: @"%@ %@",
|
||||||
NSLocalizedString (@"Quit", @"Quit"), processName];
|
NSLocalizedString (@"Quit", @"Quit"), processName];
|
||||||
NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle: quitString
|
NSMenuItem *quitItem = [[NSMenuItem alloc] initWithTitle: quitString
|
||||||
action: @selector(terminate:)
|
action: @selector(terminate:)
|
||||||
keyEquivalent: @"q"];
|
keyEquivalent: @"q"];
|
||||||
|
NSMenuItem *appItem;
|
||||||
|
|
||||||
|
appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item.
|
||||||
|
|
||||||
[self addItem: quitItem];
|
[self addItem: quitItem];
|
||||||
[self setTitle: processName];
|
[self setTitle: processName];
|
||||||
[appItem setTitle: infoString];
|
[appItem setTitle: infoString];
|
||||||
[[appItem submenu] setTitle: infoString];
|
[[appItem submenu] setTitle: infoString];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self _setGeometry];
|
[self _setGeometry];
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
|
|
|
@ -975,7 +975,7 @@ static BOOL menuBarVisible = YES;
|
||||||
while (cont && i < num)
|
while (cont && i < num)
|
||||||
{
|
{
|
||||||
cont = [_delegate menu: self
|
cont = [_delegate menu: self
|
||||||
updateItem: [self itemAtIndex: i]
|
updateItem: (NSMenuItem*)[self itemAtIndex: i]
|
||||||
atIndex: i
|
atIndex: i
|
||||||
shouldCancel: NO];
|
shouldCancel: NO];
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -417,7 +417,7 @@ this to return nil to indicate that we have no context menu.
|
||||||
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
NSMenu *m = [self menu];
|
NSMenu *m = [self menu];
|
||||||
NSMenuItem *oldSelectedItem = [_cell selectedItem];
|
NSMenuItem *oldSelectedItem = (NSMenuItem *)[_cell selectedItem];
|
||||||
|
|
||||||
if (m != nil)
|
if (m != nil)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5313,7 +5313,8 @@ configuation! */
|
||||||
NSTextView *tv = [self _bestTextViewForUndo];
|
NSTextView *tv = [self _bestTextViewForUndo];
|
||||||
|
|
||||||
if ([tv shouldChangeTextInRange: undoRange
|
if ([tv shouldChangeTextInRange: undoRange
|
||||||
replacementString: undoString ? [undoString string] : @""])
|
replacementString: undoString ? (NSString*)[undoString string] :
|
||||||
|
(NSString*)@""])
|
||||||
{
|
{
|
||||||
[tv replaceCharactersInRange: undoRange
|
[tv replaceCharactersInRange: undoRange
|
||||||
withAttributedString: undoString];
|
withAttributedString: undoString];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue