source: trunk/aux/cocotron/win32/cocotron/cocotron-r710.patch @ 13367

Last change on this file since 13367 was 13367, checked in by palter, 9 years ago

Better fix for NSPopUpButton

File size: 5.2 KB
  • AppKit/NSPopUpButtonCell.m

     
    1818
    1919@implementation NSPopUpButtonCell
    2020
     21-init {
     22   self = [super init];
     23   _pullsDown = NO;
     24   _menu = [[[NSMenu alloc] init] retain];
     25   _arrowPosition = NSPopUpArrowAtCenter;
     26   _preferredEdge = NSMaxYEdge;
     27   return self;
     28}
     29
    2130-(void)encodeWithCoder:(NSCoder *)coder {
    2231   NSUnimplementedMethod();
    2332}
     
    5968    [super initTextCell:string];
    6069    _menu = [[NSMenu alloc] initWithTitle:string];
    6170    [_menu addItemWithTitle:string action:[self action] keyEquivalent:@""];
    62        
     71    _arrowPosition = NSPopUpArrowAtCenter;
     72    _preferredEdge = NSMaxYEdge;
     73
    6374    [self setPullsDown:pullDown];
    6475   
    6576    return self;
  • AppKit/NSApplication.m

     
    2929#import <AppKit/CGWindow.h>
    3030#import <AppKit/NSRaise.h>
    3131#import <objc/message.h>
     32#import <AppKit/NSWindow.h>
    3233
    3334NSString *NSModalPanelRunLoopMode=@"NSModalPanelRunLoopMode";
    3435NSString *NSEventTrackingRunLoopMode=@"NSEventTrackingRunLoopMode";
     
    413414       needsUntitled = [_delegate applicationShouldOpenUntitledFile: self];
    414415   }
    415416
     417   if(needsUntitled && _delegate && [_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) {
     418     needsUntitled = ![_delegate applicationOpenUntitledFile: self];
     419   }
     420                                                 
     421
    416422   if(needsUntitled && controller && ![controller documentClassForType:[controller defaultType]]) {
    417423       needsUntitled = NO;
    418424   }
     
    466472}
    467473
    468474-(void)run {
    469    
    470    NSAutoreleasePool *pool=[NSAutoreleasePool new];
    471    [self finishLaunching];
    472    [pool release];
     475  static BOOL didlaunch = NO;
     476  NSAutoreleasePool *pool;
     477
     478  _isRunning=YES;
     479
     480  if (!didlaunch) {
     481    didlaunch = YES;
     482    pool=[NSAutoreleasePool new];
     483    [self finishLaunching];
     484    [pool release];
     485  }
    473486   
    474    _isRunning=YES;
    475487   
    476488   do {
    477489       pool = [NSAutoreleasePool new];
  • AppKit/NSMenu.subproj/NSMenu.m

     
    4040}
    4141
    4242-(void)encodeWithCoder:(NSCoder *)coder {
    43    [coder encodeObject:_title forKey:@"NSMenu title"];
    44    [coder encodeObject:_itemArray forKey:@"NSMenu itemArray"];
    45    [coder encodeBool:_autoenablesItems forKey:@"NSMenu autoenablesItems"];
     43   [coder encodeObject:_title forKey:@"NSTitle"];
     44   [coder encodeObject:_name forKey:@"NSName"];
     45   [coder encodeObject:_itemArray forKey:@"NSMenuItems"];
     46   [coder encodeBool:!_autoenablesItems forKey:@"NSNoAutoenable"];
    4647}
    4748
    4849-initWithCoder:(NSCoder *)coder {
     
    221222
    222223-(void)addItem:(NSMenuItem *)item {
    223224   [item performSelector:@selector(_setMenu:) withObject:self];
    224    [[self mutableArrayValueForKey:@"itemArray"] addObject:item];
     225   [_itemArray addObject:item];
    225226}
    226227
    227228-(NSMenuItem *)addItemWithTitle:(NSString *)title action:(SEL)action keyEquivalent:(NSString *)keyEquivalent {
     
    239240
    240241-(void)removeItem:(NSMenuItem *)item {
    241242   [item performSelector:@selector(_setMenu:) withObject:nil];
    242    [[self mutableArrayValueForKey:@"itemArray"] removeObjectIdenticalTo:item];
     243   [_itemArray removeObjectIdenticalTo:item];
    243244}
    244245
    245246-(void)removeItemAtIndex:(int)index {
     
    248249
    249250-(void)insertItem:(NSMenuItem *)item atIndex:(int)index {
    250251   [item performSelector:@selector(_setMenu:) withObject:self];
    251    [[self mutableArrayValueForKey:@"itemArray"] insertObject:item atIndex:index];
     252   [_itemArray insertObject:item atIndex:index];
    252253}
    253254
    254255-(NSMenuItem *)insertItemWithTitle:(NSString *)title action:(SEL)action keyEquivalent:(NSString *)keyEquivalent atIndex:(int)index {
  • AppKit/NSFontManager.m

     
    306306    return [NSFont fontWithName:[newface name] size:[font pointSize]];
    307307
    308308   NSLog(@"%s failed, %@ %d",sel_getName(_cmd),[font fontName],addTraits);
    309    NSUnimplementedMethod();
    310309   return font;
    311310}
    312311
  • AppKit/NSDocument.m

     
    2121
    2222@implementation NSDocument
    2323
     24static int untitled_document_number = 0;
     25
    2426+(NSArray *)readableTypes {
    2527   int             i;
    2628   NSArray        *knownDocTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDocumentTypes"];
     
    98100      _fileURL=nil;
    99101      _fileType=nil;
    100102      _changeCount=0;
    101       _untitledNumber=0;
     103      _untitledNumber=untitled_document_number++;
    102104      _hasUndoManager=YES;
    103105      _activeEditors=[NSMutableArray new];
    104106    }
     
    344346{
    345347  if(_fileURL==nil)
    346348    {
    347       if(_untitledNumber > 1)
     349      if(_untitledNumber != 0)
    348350        return [NSString stringWithFormat:@"Untitled %d", _untitledNumber];
    349351      else
    350352        return @"Untitled";
Note: See TracBrowser for help on using the repository browser.