Diff for /chimera/BookmarksToolbar.mm between versions 1.4 and 1.5

version 1.4, 2002/04/17 08:31:11 version 1.5, 2002/04/17 08:56:57
Line 17 Line 17
   self = [super initWithFrame:frame];    self = [super initWithFrame:frame];
   if (self) {    if (self) {
     mBookmarks = nsnull;      mBookmarks = nsnull;
       mButtons = [[NSMutableArray alloc] init];
   }    }
   return self;    return self;
 }  }
Line 32 Line 33
   
 -(void) dealloc  -(void) dealloc
 {  {
     [mButtons autorelease];
   mBookmarks->RemoveObserver();    mBookmarks->RemoveObserver();
   delete mBookmarks;    delete mBookmarks;
   [super dealloc];    [super dealloc];
Line 39 Line 41
   
 - (void)drawRect:(NSRect)aRect {  - (void)drawRect:(NSRect)aRect {
   // Fill the background with our background color.    // Fill the background with our background color.
//  [[NSColor colorWithCalibratedWhite: 0.98 alpha: 1.0] set];  [[NSColor colorWithCalibratedWhite: 0.98 alpha: 1.0] set];
//  NSRectFill(aRect);  NSRectFill(aRect);
   
   //printf("The rect is: %f %f %f %f\n", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);    //printf("The rect is: %f %f %f %f\n", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
       
Line 48 Line 50
       [self bounds].size.height) {        [self bounds].size.height) {
     // The personal toolbar is 21 pixels tall.  The bottom two pixels      // The personal toolbar is 21 pixels tall.  The bottom two pixels
     // are a separator.      // are a separator.
    [[NSColor colorWithCalibratedWhite: 0.92 alpha: 1.0] set];    [[NSColor colorWithCalibratedWhite: 0.90 alpha: 1.0] set];
     NSRectFill(NSMakeRect(aRect.origin.x, aRect.origin.y, aRect.size.width, 2));      NSRectFill(NSMakeRect(aRect.origin.x, aRect.origin.y, aRect.size.width, 2));
   }    }
   
Line 66 Line 68
       BookmarksButton* button = [[[BookmarksButton alloc] initWithFrame: NSMakeRect(2, 1, 100, 17)] autorelease];        BookmarksButton* button = [[[BookmarksButton alloc] initWithFrame: NSMakeRect(2, 1, 100, 17)] autorelease];
       [button setElement: childElt];        [button setElement: childElt];
       [self addSubview: button];        [self addSubview: button];
         [mButtons addObject: button];
     }      }
   
     nsCOMPtr<nsIDOMNode> temp = child;      nsCOMPtr<nsIDOMNode> temp = child;
Line 77 Line 80
   
 -(void)reflowButtons  -(void)reflowButtons
 {  {
     int count = [mButtons count];
     int prevX = 2;
     for (int i = 0; i < count; i++) {
       BookmarksButton* button = [mButtons objectAtIndex: i];
       [button sizeToFit];
       int width = [button frame].size.width;
       if (width > 150)
         width = 150;
       [button setFrame: NSMakeRect(prevX, [button frame].origin.y, width, [button frame].size.height)];
       prevX += [button frame].size.width + 2;
     }
 }  }
 @end  @end

Removed from v.1.4  
changed lines
  Added in v.1.5


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