Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes | Properties
Silverstone.Manticore.Bookmarks.BookmarksTreeView Class Reference

A Bookmarks Tree widget. More...

Inheritance diagram for Silverstone.Manticore.Bookmarks.BookmarksTreeView:
Inheritance graph
Collaboration diagram for Silverstone.Manticore.Bookmarks.BookmarksTreeView:
Collaboration graph

List of all members.

Public Member Functions

 BookmarksTreeView (String aRoot)
void Build ()
virtual bool ShouldBuild (CommandTarget aTarget)
int GetIconIndex (String aIconURL)
virtual int GetIconIndex (CommandTarget aCommandTarget)
 Client overrides to provide special Icons for the particular treeview.

Protected Attributes

BaseTreeBuilder mBuilder
Queue mFilterAttributes
Hashtable mImages = null
 Holds imageURL->imageIndex mapping of images.
int mImageCount = 0
 Number of images currently hashed (current image index)
Color mIconTransparentColor
 Transparent colour used in icons. We could be pedantic and allow this to come from the datastore, but this'll do for now.


String Root get

Detailed Description

A Bookmarks Tree widget.

Definition at line 53 of file BookmarksTreeView.cs.

Constructor & Destructor Documentation

Definition at line 58 of file BookmarksTreeView.cs.

      mBuilder = new BaseTreeBuilder(this, null);
      mBuilder.Root = aRoot;
      mBuilder.DataStore = DataStoreRegistry.GetDataStore("Bookmarks");

      // Use bright green as transparent colour
      mIconTransparentColor = ColorTranslator.FromOle(0x00FF00);

      ImageList = new ImageList();
      // Built in Bookmark icons
      ImageList.Images.Add(Image.FromFile(@"resources\bookmark-folder-closed.png"), mIconTransparentColor);
      ImageList.Images.Add(Image.FromFile(@"resources\bookmark-folder-open.png"), mIconTransparentColor);
      ImageList.Images.Add(Image.FromFile(@"resources\bookmark.png"), mIconTransparentColor);

      // Don't draw lines to root
      ShowRootLines = false;
      ShowPlusMinus = true;

      AfterLabelEdit += new NodeLabelEditEventHandler(OnAfterLabelEdit);
      AfterExpand += new TreeViewEventHandler(OnAfterExpand);
      AfterCollapse += new TreeViewEventHandler(OnAfterCollapse);

Here is the call graph for this function:

Member Function Documentation

Definition at line 83 of file BookmarksTreeView.cs.


Definition at line 246 of file toolkit.menus.cs.

      if (aIconURL == "")
        return -1;

      if (mImages == null)
        mImages = new Hashtable();

      int key = aIconURL.GetHashCode();
      if (!mImages.ContainsKey(key)) 
        if (ImageList == null) 
          ImageList = new ImageList();
          ImageList.Images.Add(Image.FromFile(aIconURL), mIconTransparentColor);
          mImages.Add(key, mImageCount);
        catch (FileNotFoundException)
          // If the file can't be found, don't add it to the list.
          return -1;
        return mImageCount++;
        return (int) mImages[key];
virtual int Silverstone.Manticore.Toolkit.ManticoreTreeView.GetIconIndex ( CommandTarget  aCommandTarget) [inline, virtual, inherited]

Client overrides to provide special Icons for the particular treeview.


Definition at line 281 of file toolkit.menus.cs.

      return -1;
virtual bool Silverstone.Manticore.Toolkit.ManticoreTreeView.ShouldBuild ( CommandTarget  aTarget) [inline, virtual, inherited]

Definition at line 241 of file toolkit.menus.cs.

      return true;

Member Data Documentation

Definition at line 55 of file BookmarksTreeView.cs.

Definition at line 56 of file BookmarksTreeView.cs.

Transparent colour used in icons. We could be pedantic and allow this to come from the datastore, but this'll do for now.

Definition at line 239 of file toolkit.menus.cs.

Number of images currently hashed (current image index)

Definition at line 233 of file toolkit.menus.cs.

Holds imageURL->imageIndex mapping of images.

Definition at line 228 of file toolkit.menus.cs.

Property Documentation

Definition at line 91 of file BookmarksTreeView.cs.

The documentation for this class was generated from the following file: