Diff for /chimera/BookmarksButton.mm between versions 1.5 and 1.6

version 1.5, 2002/04/17 10:30:13 version 1.6, 2002/04/17 22:57:07
Line 8 Line 8
   
 #import "BookmarksButton.h"  #import "BookmarksButton.h"
 #include "nsIDOMElement.h"  #include "nsIDOMElement.h"
   #include "nsIContent.h"
 #include "nsString.h"  #include "nsString.h"
   #import "BookmarksService.h"
   
 @implementation BookmarksButton  @implementation BookmarksButton
   
Line 51 Line 53
   [super drawRect: aRect];    [super drawRect: aRect];
 }  }
   
   -(void)mouseDown:(NSEvent*)aEvent
   {
     if (mIsFolder) {
       nsCOMPtr<nsIContent> content(do_QueryInterface(mElement));
       NSMenu* menu = BookmarksService::LocateMenu(content);
       [NSMenu popUpContextMenu: menu withEvent: aEvent forView: self];
     }
     else
       [super mouseDown: aEvent];
   }
   
 -(void)setElement: (nsIDOMElement*)aElt  -(void)setElement: (nsIDOMElement*)aElt
 {  {
   mElement = aElt;    mElement = aElt;
   nsAutoString tag;    nsAutoString tag;
   mElement->GetLocalName(tag);    mElement->GetLocalName(tag);
  if (tag.Equals(NS_LITERAL_STRING("folder")))  if (tag.Equals(NS_LITERAL_STRING("folder"))) {
     [self setImage: [NSImage imageNamed: @"folder"]];      [self setImage: [NSImage imageNamed: @"folder"]];
       mIsFolder = YES;
     }
   else {    else {
       mIsFolder = NO;
     [self setImage: [NSImage imageNamed: @"smallbookmark"]];      [self setImage: [NSImage imageNamed: @"smallbookmark"]];
     [self setAction: @selector(openBookmark:)];      [self setAction: @selector(openBookmark:)];
     [self setTarget: self];      [self setTarget: self];
Line 69 Line 85
   [self setTitle: [NSString stringWithCharacters: name.get() length: nsCRT::strlen(name.get())]];    [self setTitle: [NSString stringWithCharacters: name.get() length: nsCRT::strlen(name.get())]];
 }  }
   
   -(nsIDOMElement*)element
   {
     return mElement;
   }
   
 @end  @end

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


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