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

version 1.3, 2002/04/17 07:38:31 version 1.4, 2002/04/17 08:31:11
Line 9 Line 9
 #import "BookmarksButton.h"  #import "BookmarksButton.h"
 #import "BookmarksToolbar.h"  #import "BookmarksToolbar.h"
 #import "BookmarksService.h"  #import "BookmarksService.h"
   #include "nsIDOMElement.h"
   
 @implementation BookmarksToolbar  @implementation BookmarksToolbar
   
Line 17 Line 18
   if (self) {    if (self) {
     mBookmarks = nsnull;      mBookmarks = nsnull;
   }    }
   
   // Create a sample button.  
 /*  BookmarksButton* testButton = [[[BookmarksButton alloc] initWithFrame: NSMakeRect(2, 1, 100, 17)] autorelease];  
   [testButton setTitle: @"Gamespot - Gaming Site"];  
   [self addSubview: testButton];   
   */  
     
   return self;    return self;
 }  }
   
Line 32 Line 26
   // Initialization code here.    // Initialization code here.
   mBookmarks = new BookmarksService(self);    mBookmarks = new BookmarksService(self);
   mBookmarks->AddObserver();    mBookmarks->AddObserver();
  mBookmarks->ConstructBookmarksToolbar();  mBookmarks->EnsureToolbarRoot();
   [self buildButtonList];
 }  }
   
 -(void) dealloc  -(void) dealloc
Line 60 Line 55
   // The buttons will paint themselves.    // The buttons will paint themselves.
 }  }
   
   -(void)buildButtonList
   {
     // Build the buttons, and then lay them all out.
     nsCOMPtr<nsIDOMNode> child;
     BookmarksService::gToolbarRoot->GetFirstChild(getter_AddRefs(child));
     while (child) {
       nsCOMPtr<nsIDOMElement> childElt(do_QueryInterface(child));
       if (childElt) {
         BookmarksButton* button = [[[BookmarksButton alloc] initWithFrame: NSMakeRect(2, 1, 100, 17)] autorelease];
         [button setElement: childElt];
         [self addSubview: button];
       }
   
       nsCOMPtr<nsIDOMNode> temp = child;
       temp->GetNextSibling(getter_AddRefs(child));
     }
   
     [self reflowButtons];
   }
   
   -(void)reflowButtons
   {
   }
 @end  @end

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


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