Annotation of chimera/BookmarksToolbar.mm, revision 1.2

1.1       hyatt       1: //
                      2: //  BookmarksToolbar.mm
                      3: //  Chimera
                      4: //
                      5: //  Created by David Hyatt on Mon Apr 15 2002.
                      6: //  Copyright (c) 2001 __MyCompanyName__. All rights reserved.
                      7: //
                      8: 
1.2     ! hyatt       9: #import "BookmarksButton.h"
1.1       hyatt      10: #import "BookmarksToolbar.h"
                     11: 
                     12: @implementation BookmarksToolbar
                     13: 
                     14: - (id)initWithFrame:(NSRect)frame {
                     15:   self = [super initWithFrame:frame];
                     16:   if (self) {
                     17:     // Initialization code here.
                     18:   }
1.2     ! hyatt      19: 
        !            20:   // Create a sample button.
        !            21:   BookmarksButton* testButton = [[[BookmarksButton alloc] initWithFrame: NSMakeRect(2, 1, 100, 17)] autorelease];
        !            22:   [testButton setTitle: @"Gamespot - Gaming Site"];
        !            23:   [self addSubview: testButton]; 
        !            24:   
1.1       hyatt      25:   return self;
                     26: }
                     27: 
                     28: - (void)drawRect:(NSRect)aRect {
                     29:   // Fill the background with our background color.
1.2     ! hyatt      30: //  [[NSColor colorWithCalibratedWhite: 0.98 alpha: 1.0] set];
        !            31: //  NSRectFill(aRect);
1.1       hyatt      32: 
                     33:   //printf("The rect is: %f %f %f %f\n", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
                     34:   
                     35:   if (aRect.origin.y + aRect.size.height ==
                     36:       [self bounds].size.height) {
                     37:     // The personal toolbar is 21 pixels tall.  The bottom two pixels
                     38:     // are a separator.
                     39:     [[NSColor colorWithCalibratedWhite: 0.92 alpha: 1.0] set];
                     40:     NSRectFill(NSMakeRect(aRect.origin.x, aRect.origin.y, aRect.size.width, 2));
                     41:   }
                     42: 
1.2     ! hyatt      43:   // The buttons will paint themselves.
1.1       hyatt      44: }
                     45: 
                     46: @end

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