Diff for /chimera/BrowserWindowController.mm between versions 1.67 and 1.73

version 1.67, 2002/04/17 10:30:13 version 1.73, 2002/04/20 00:02:55
Line 166  static NSString *PrintToolbarItemIdentif Line 166  static NSString *PrintToolbarItemIdentif
     [[self window] setFrameUsingName: @"NavigatorWindow"];      [[self window] setFrameUsingName: @"NavigatorWindow"];
           
     if (mModalSession)      if (mModalSession)
      [NSApp stopModal: mModalSession];      [NSApp stopModal];
               
     mInitialized = YES;      mInitialized = YES;
   
Line 213  static NSString *PrintToolbarItemIdentif Line 213  static NSString *PrintToolbarItemIdentif
   if (windowFrame.origin.x + windowFrame.size.width + drawerSize.width >    if (windowFrame.origin.x + windowFrame.size.width + drawerSize.width >
       screenFrame.size.width) {        screenFrame.size.width) {
     // We need to adjust the window so that it can fit.      // We need to adjust the window so that it can fit.
    int shrinkDelta = (windowFrame.size.width + drawerSize.width) - screenFrame.size.width;    float shrinkDelta = (windowFrame.size.width + drawerSize.width) - screenFrame.size.width;
     if (shrinkDelta < 0) shrinkDelta = 0;      if (shrinkDelta < 0) shrinkDelta = 0;
    int newWidth = (windowFrame.size.width - shrinkDelta);    float newWidth = (windowFrame.size.width - shrinkDelta);
    int newPosition = screenFrame.size.width - newWidth - drawerSize.width;    float newPosition = screenFrame.size.width - newWidth - drawerSize.width;
     if (newPosition < 0) newPosition = 0;      if (newPosition < 0) newPosition = 0;
     mCachedFrameBeforeDrawerOpen = windowFrame;      mCachedFrameBeforeDrawerOpen = windowFrame;
     windowFrame.origin.x = newPosition;      windowFrame.origin.x = newPosition;
Line 253  static NSString *PrintToolbarItemIdentif Line 253  static NSString *PrintToolbarItemIdentif
         frame.size.width == mCachedFrameAfterDrawerOpen.size.width &&          frame.size.width == mCachedFrameAfterDrawerOpen.size.width &&
         frame.size.height == mCachedFrameAfterDrawerOpen.size.height) {          frame.size.height == mCachedFrameAfterDrawerOpen.size.height) {
       printf("Got here too.\n");        printf("Got here too.\n");
      printf("Xes are %d %d\n", frame.origin.x, mCachedFrameAfterDrawerOpen.origin.x);      printf("Xes are %f %f\n", frame.origin.x, mCachedFrameAfterDrawerOpen.origin.x);
      printf("Widths are %d %d\n", frame.size.width, mCachedFrameAfterDrawerOpen.size.width);      printf("Widths are %f %f\n", frame.size.width, mCachedFrameAfterDrawerOpen.size.width);
       // Restore the original frame.        // Restore the original frame.
       [[self window] setFrame: mCachedFrameBeforeDrawerOpen display: YES];        [[self window] setFrame: mCachedFrameBeforeDrawerOpen display: YES];
     }      }
Line 467  static NSString *PrintToolbarItemIdentif Line 467  static NSString *PrintToolbarItemIdentif
   
 -(IBAction)manageBookmarks: (id)aSender  -(IBAction)manageBookmarks: (id)aSender
 {  {
  if (![mSidebarDrawer isOpen])  if ([mSidebarDrawer state] == NSDrawerClosedState)
     [self toggleSidebar: self];      [self toggleSidebar: self];
   
   [mSidebarTabView selectFirstTabViewItem:self];    [mSidebarTabView selectFirstTabViewItem:self];
Line 508  static NSString *PrintToolbarItemIdentif Line 508  static NSString *PrintToolbarItemIdentif
     return [[mBrowserView getBrowserView] findInPage:text];      return [[mBrowserView getBrowserView] findInPage:text];
 }  }
   
- (void)addBookmarkExtended: (BOOL)aIsFromMenu- (void)addBookmarkExtended: (BOOL)aIsFromMenu isFolder:(BOOL)aIsFolder
 {  {
   [mSidebarBookmarksDataSource ensureBookmarks];    [mSidebarBookmarksDataSource ensureBookmarks];
  [mSidebarBookmarksDataSource addBookmark: self useSelection: !aIsFromMenu];  BOOL useSel = aIsFromMenu;
   if (aIsFromMenu) {
     // Use selection only if the sidebar is open and the bookmarks panel is displaying.
     if ([mSidebarDrawer state] == NSDrawerClosedState)
       useSel = NO;
     else
       if ([mSidebarTabView tabViewItemAtIndex: 0] != [mSidebarTabView selectedTabViewItem])
         useSel = NO;
   }
   
   [mSidebarBookmarksDataSource addBookmark: self useSelection: useSel isFolder: aIsFolder];
 }  }
   
 - (IBAction)back:(id)aSender  - (IBAction)back:(id)aSender
Line 588  static NSString *PrintToolbarItemIdentif Line 598  static NSString *PrintToolbarItemIdentif
 -(void)newTab  -(void)newTab
 {  {
     NSTabViewItem* newTab = [[[NSTabViewItem alloc] initWithIdentifier: nil] autorelease];      NSTabViewItem* newTab = [[[NSTabViewItem alloc] initWithIdentifier: nil] autorelease];
    MyBrowserView* newView = [[[MyBrowserView alloc] initWithFrame: [mBrowserView frame]] autorelease];    MyBrowserView* newView = [[[MyBrowserView alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease];
    [newView setTab: newTab];    
 
     [newTab setLabel: @"Untitled"];      [newTab setLabel: @"Untitled"];
     [newTab setView: newView];      [newTab setView: newView];
   
     [mTabBrowser addTabViewItem: newTab];      [mTabBrowser addTabViewItem: newTab];
    
     [[newView getBrowserView] loadURI:[NSURL URLWithString:@"about:blank"] flags:NSLoadFlagsNone];      [[newView getBrowserView] loadURI:[NSURL URLWithString:@"about:blank"] flags:NSLoadFlagsNone];
   
     [mTabBrowser selectLastTabViewItem: self];      [mTabBrowser selectLastTabViewItem: self];
Line 648  static NSString *PrintToolbarItemIdentif Line 656  static NSString *PrintToolbarItemIdentif
         progress: mProgress windowController: self];          progress: mProgress windowController: self];
 }  }
   
   -(id)getTabBrowser
   {
     return mTabBrowser;
   }
   
 -(MyBrowserView*)getMyBrowserView  -(MyBrowserView*)getMyBrowserView
 {  {
    return mBrowserView;  return mBrowserView;
 }  }
   
 -(void)openNewWindowWithURL: (NSURL*)aURL loadInBackground: (BOOL)aLoadInBG  -(void)openNewWindowWithURL: (NSURL*)aURL loadInBackground: (BOOL)aLoadInBG
Line 676  static NSString *PrintToolbarItemIdentif Line 689  static NSString *PrintToolbarItemIdentif
     NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem];      NSTabViewItem* selectedTab = [mTabBrowser selectedTabViewItem];
     int index = [mTabBrowser indexOfTabViewItem: selectedTab];      int index = [mTabBrowser indexOfTabViewItem: selectedTab];
     [mTabBrowser insertTabViewItem: newTab atIndex: index+1];      [mTabBrowser insertTabViewItem: newTab atIndex: index+1];
    
    MyBrowserView* newView = [[[MyBrowserView alloc] initWithFrame: [mBrowserView frame]] autorelease];    MyBrowserView* newView = [[[MyBrowserView alloc] initWithTab: newTab andWindow: [mTabBrowser window]] autorelease];
     [newView setTab: newTab];      [newView setTab: newTab];
           
     [newTab setLabel: @"Loading..."];      [newTab setLabel: @"Loading..."];
Line 792  static NSString *PrintToolbarItemIdentif Line 805  static NSString *PrintToolbarItemIdentif
   return mAddBookmarkFolderField;    return mAddBookmarkFolderField;
 }  }
   
   -(id)getAddBookmarkCheckbox
   {
     return mAddBookmarkCheckbox;
   }
   
 // Called when a context menu should be shown.  // Called when a context menu should be shown.
 - (void)onShowContextMenu:(int)flags domEvent:(nsIDOMEvent*)aEvent domNode:(nsIDOMNode*)aNode  - (void)onShowContextMenu:(int)flags domEvent:(nsIDOMEvent*)aEvent domNode:(nsIDOMNode*)aNode
 {  {
Line 925  static NSString *PrintToolbarItemIdentif Line 943  static NSString *PrintToolbarItemIdentif
   }      }  
 }  }
   
   - (NSView*) bookmarksToolbar
   {
     return mPersonalToolbar;
   }
   
 @end  @end
   

Removed from v.1.67  
changed lines
  Added in v.1.73


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>