[Monodevelop-patches-list] r878 - in trunk/MonoDevelop/src: AddIns/DisplayBindings/SourceEditor/CodeCompletion Libraries/MonoDevelop.Gui.Widgets/Tree Main/Base/Commands/ProjectBrowserCommands Main/Base/Gui/Dialogs Main/Base/Gui/Pads/ClassScout Main/Base/Gui/Pads/ClassScout/NodeBuilder Main/Base/Gui/Pads/ProjectBrowser/BrowserNode Main/Base/Gui/Pads/ProjectBrowser/NodeBuilder Main/Base/Services Main/Base/Services/ClassBrowserIcons
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Feb 13 15:04:47 EST 2004
Author: benm
Date: 2004-02-13 15:04:47 -0500 (Fri, 13 Feb 2004)
New Revision: 878
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CommentCompletionDataProvider.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionData.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionDataProvider.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TemplateCompletionDataProvider.cs
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNode.cs
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeView.cs
trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/WordCountDialog.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/AbstractBrowserNode.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs
trunk/MonoDevelop/src/Main/Base/Services/ClassBrowserIcons/ClassBrowserIconsService.cs
trunk/MonoDevelop/src/Main/Base/Services/IconService.cs
trunk/MonoDevelop/src/Main/Base/Services/ResourceService.cs
Log:
icon cleanup
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionData.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -23,7 +23,7 @@
static IParserService parserService = (IParserService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IParserService));
static AmbienceService ambienceService = (AmbienceService)ServiceManager.Services.GetService(typeof(AmbienceService));
- int imageIndex;
+ string image;
int overloads;
string text;
string description;
@@ -50,12 +50,12 @@
}
}
- public int ImageIndex {
+ public string Image {
get {
- return imageIndex;
+ return image;
}
set {
- imageIndex = value;
+ image = value;
}
}
@@ -143,19 +143,19 @@
}
}
- public CodeCompletionData(string s, int imageIndex)
+ public CodeCompletionData(string s, string image)
{
description = pango_description = documentation = String.Empty;
text = s;
completionString = s;
- this.imageIndex = imageIndex;
+ this.image = image;
}
public CodeCompletionData(IClass c)
{
// save class (for the delegate description shortcut
this.c = c;
- imageIndex = classBrowserIconService.GetIcon(c);
+ image = classBrowserIconService.GetIcon(c);
text = c.Name;
completionString = c.Name;
description = ambienceService.CurrentAmbience.Convert(c);
@@ -165,7 +165,7 @@
public CodeCompletionData(IMethod method)
{
- imageIndex = classBrowserIconService.GetIcon(method);
+ image = classBrowserIconService.GetIcon(method);
text = method.Name;
description = ambienceService.CurrentAmbience.Convert(method);
pango_description = PangoAmbience.Convert (method);
@@ -175,7 +175,7 @@
public CodeCompletionData(IField field)
{
- imageIndex = classBrowserIconService.GetIcon(field);
+ image = classBrowserIconService.GetIcon(field);
text = field.Name;
description = ambienceService.CurrentAmbience.Convert(field);
pango_description = PangoAmbience.Convert (field);
@@ -185,7 +185,7 @@
public CodeCompletionData(IProperty property)
{
- imageIndex = classBrowserIconService.GetIcon(property);
+ image = classBrowserIconService.GetIcon(property);
text = property.Name;
description = ambienceService.CurrentAmbience.Convert(property);
pango_description = PangoAmbience.Convert (property);
@@ -195,7 +195,7 @@
public CodeCompletionData(IEvent e)
{
- imageIndex = classBrowserIconService.GetIcon(e);
+ image = classBrowserIconService.GetIcon(e);
text = e.Name;
description = ambienceService.CurrentAmbience.Convert(e);
pango_description = PangoAmbience.Convert (e);
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CodeCompletionDataProvider.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -21,6 +21,7 @@
using SharpDevelop.Internal.Parser;
using MonoDevelop.SourceEditor.Gui;
+using Stock = MonoDevelop.Gui.Stock;
namespace MonoDevelop.SourceEditor.CodeCompletion
{
@@ -35,13 +36,6 @@
Hashtable insertedPropertiesElements = new Hashtable();
Hashtable insertedEventElements = new Hashtable();
- public Gdk.Pixbuf[] ImageList {
- get {
- PixbufList list = classBrowserIconService.ImageList;
- return (Gdk.Pixbuf[])list.ToArray (typeof(Gdk.Pixbuf));
- }
- }
-
int caretLineNumber;
int caretColumn;
string fileName;
@@ -117,7 +111,7 @@
if (results.Namespaces != null && results.Namespaces.Count > 0) {
foreach (string s in results.Namespaces) {
- completionData.Add(new CodeCompletionData(s, classBrowserIconService.NamespaceIndex));
+ completionData.Add(new CodeCompletionData(s, Stock.NameSpace));
}
}
if (results.Members != null && results.Members.Count > 0) {
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CommentCompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CommentCompletionDataProvider.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CommentCompletionDataProvider.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -18,6 +18,7 @@
using SharpDevelop.Internal.Parser;
using MonoDevelop.SourceEditor.Gui;
+using Stock = MonoDevelop.Gui.Stock;
namespace MonoDevelop.SourceEditor.CodeCompletion {
/// <summary>
@@ -52,13 +53,6 @@
new string[] {"value", "A description of a property"}
};
- public Gdk.Pixbuf[] ImageList {
- get {
- PixbufList list = classBrowserIconService.ImageList;
- return (Gdk.Pixbuf[])list.ToArray (typeof (Gdk.Pixbuf));
- }
- }
-
/// <remarks>
/// Returns true, if the given coordinates (row, column) are in the region.
/// </remarks>
@@ -89,9 +83,9 @@
string text;
string description;
- public int ImageIndex {
+ public string Image {
get {
- return classBrowserIconService.MethodIndex;
+ return Stock.Method;
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/CompletionWindow.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -144,7 +144,7 @@
SkipTaskbarHint = true;
TypeHint = Gdk.WindowTypeHint.Dialog;
- store = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof(ICompletionData));
+ store = new Gtk.TreeStore (typeof (string), typeof (string), typeof(ICompletionData));
listView = new Gtk.TreeView (store);
listView.HeadersVisible = false;
@@ -153,8 +153,9 @@
complete_column.Title = "completion";
Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
+ pix_render.StockSize = Gtk.IconSize.Button;
complete_column.PackStart (pix_render, false);
- complete_column.AddAttribute (pix_render, "pixbuf", 1);
+ complete_column.AddAttribute (pix_render, "stock-id", 1);
Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
complete_column.PackStart (text_render, true);
@@ -169,8 +170,7 @@
Gtk.Frame frame = new Gtk.Frame ();
frame.Add (scroller);
this.Add(frame);
-
- imgList = completionDataProvider.ImageList;
+
listView.KeyPressEvent += new KeyPressEventHandler(ListKeypressEvent);
listView.KeyReleaseEvent += new KeyReleaseEventHandler(ListKeyreleaseEvent);
listView.FocusOutEvent += new FocusOutEventHandler(LostFocusListView);
@@ -265,7 +265,7 @@
}
foreach (ICompletionData data in completionData) {
- store.AppendValues (data.Text[0], imgList[data.ImageIndex], data);
+ store.AppendValues (data.Text[0], data.Image, data);
}
// sort here
store.SetSortColumnId (0, SortType.Ascending);
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionData.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionData.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionData.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -16,7 +16,7 @@
{
public interface ICompletionData
{
- int ImageIndex {
+ string Image {
get;
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionDataProvider.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/ICompletionDataProvider.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -16,10 +16,6 @@
namespace MonoDevelop.SourceEditor.CodeCompletion {
public interface ICompletionDataProvider {
- Pixbuf[] ImageList {
- get;
- }
-
ICompletionData[] GenerateCompletionData(string fileName, SourceEditorView textArea, char charTyped);
}
}
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TemplateCompletionDataProvider.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TemplateCompletionDataProvider.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/CodeCompletion/TemplateCompletionDataProvider.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -14,6 +14,7 @@
using ICSharpCode.SharpDevelop.Internal.Templates;
using MonoDevelop.SourceEditor.Gui;
+using Stock = MonoDevelop.Gui.Stock;
namespace MonoDevelop.SourceEditor.CodeCompletion {
public class TemplateCompletionDataProvider : ICompletionDataProvider {
@@ -41,9 +42,9 @@
{
CodeTemplate template;
- public int ImageIndex {
+ public string Image {
get {
- return 0;
+ return Stock.Method;
}
}
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNode.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNode.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNode.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -7,24 +7,26 @@
internal TreeNode parent = null;
private TreeNodeCollection nodes;
private string text;
- private Gdk.Pixbuf image, opened_image, closed_image;
+ private string image, opened_image, closed_image;
private object tag;
internal Gtk.TreeRowReference row;
- public TreeNode() {
+ public TreeNode ()
+ {
nodes = new TreeNodeCollection();
nodes.TreeNodeCollectionChanged += new TreeNodeCollectionChangedHandler(OnNodesChanged);
nodes.NodeInserted += new NodeInsertedHandler(OnNodeInserted);
nodes.NodeRemoved += new NodeRemovedHandler(OnNodeRemoved);
}
- public TreeNode(string text, Gdk.Pixbuf image): this() {
+ public TreeNode(string text, string image) : this()
+ {
this.text = text;
this.image = image;
}
- public TreeNode(string text): this(text, null) {}
+ public TreeNode (string text): this (text, null) {}
public string Text {
get {
@@ -36,7 +38,7 @@
}
}
- public Gdk.Pixbuf Image {
+ public string Image {
get {
if (image == null)
return closed_image;
@@ -48,9 +50,9 @@
}
}
- public Gdk.Pixbuf OpenedImage {
+ public string OpenedImage {
get {
- return opened_image != null ? opened_image : image;
+ return opened_image;
}
set {
opened_image = value;
@@ -58,9 +60,9 @@
}
}
- public Gdk.Pixbuf ClosedImage {
+ public string ClosedImage {
get {
- return closed_image != null ? closed_image : image;
+ return closed_image;
}
set {
closed_image = value;
@@ -94,8 +96,8 @@
TreeView.Model.SetValue (TreeIter, 0, text);
if (image != null) TreeView.Model.SetValue (TreeIter, 1, image);
- if (opened_image != null) TreeView.Model.SetValue (TreeIter, 3, opened_image);
- if (closed_image != null) TreeView.Model.SetValue (TreeIter, 4, closed_image);
+ if (opened_image != null) TreeView.Model.SetValue (TreeIter, 3, TreeView.RenderIcon (opened_image));
+ if (closed_image != null) TreeView.Model.SetValue (TreeIter, 4, TreeView.RenderIcon (closed_image));
}
public TreeNodeCollection Nodes {
@@ -128,38 +130,45 @@
}
}
- public void Expand() {
+ public void Expand ()
+ {
if (TreeView != null)
TreeView.ExpandToPath (TreePath);
}
- public void EnsureVisible() {
- Expand(); // TODO
+ public void EnsureVisible ()
+ {
+ Expand (); // TODO
}
- public void Remove() {
+ public void Remove ()
+ {
if (parent != null)
parent.Nodes.Remove(this);
}
- internal void SetTreeView(TreeView t) {
+ internal void SetTreeView (TreeView t)
+ {
this.treeView = t;
}
- private void OnNodeInserted(TreeNode node) {
+ private void OnNodeInserted (TreeNode node)
+ {
node.parent = this;
if (TreeView != null)
- TreeView.AddNode(this, node);
+ TreeView.AddNode (this, node);
}
- private void OnNodeRemoved(TreeNode node) {
+ private void OnNodeRemoved(TreeNode node)
+ {
if (TreeView != null)
TreeView.RemoveNode(node);
node.parent = null;
}
- private void OnNodesChanged() {
+ private void OnNodesChanged ()
+ {
if (TreeView != null)
TreeView.OnTreeChanged();
}
@@ -197,6 +206,7 @@
{
Nodes.Sort ();
}
+
public void Sort (IComparer c)
{
Nodes.Sort (c);
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeView.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeView.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeView.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -25,7 +25,7 @@
3 -- Expanded Icon
4 -- Unexpanded Icon
*/
- store = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof (TreeNode), typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf));
+ store = new Gtk.TreeStore (typeof (string), typeof (string), typeof (TreeNode), typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf));
this.Model = store;
this.canEdit = canEdit;
@@ -37,7 +37,9 @@
Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
complete_column.PackStart (pix_render, false);
- complete_column.AddAttribute (pix_render, "pixbuf", 1);
+ complete_column.AddAttribute (pix_render, "stock_id", 1);
+ pix_render.StockSize = Gtk.IconSize.Button;
+ // Sadly, gtk+ does not have support for stock being here :-(
complete_column.AddAttribute (pix_render, "pixbuf-expander-open", 3);
complete_column.AddAttribute (pix_render, "pixbuf-expander-closed", 4);
@@ -159,8 +161,8 @@
if (new_child.Text != null) store.SetValue (it, 0, new_child.Text);
if (new_child.Image != null) store.SetValue (it, 1, new_child.Image);
- if (new_child.OpenedImage != null) store.SetValue (it, 3, new_child.OpenedImage);
- if (new_child.ClosedImage != null) store.SetValue (it, 4, new_child.ClosedImage);
+ if (new_child.OpenedImage != null) store.SetValue (it, 3, RenderIcon (new_child.OpenedImage));
+ if (new_child.ClosedImage != null) store.SetValue (it, 4, RenderIcon (new_child.ClosedImage));
new_child.row = new Gtk.TreeRowReference (store, store.GetPath (it));
@@ -184,8 +186,8 @@
if (new_child.Text != null) store.SetValue (it, 0, new_child.Text);
if (new_child.Image != null) store.SetValue (it, 1, new_child.Image);
- if (new_child.OpenedImage != null) store.SetValue (it, 3, new_child.OpenedImage);
- if (new_child.ClosedImage != null) store.SetValue (it, 4, new_child.ClosedImage);
+ if (new_child.OpenedImage != null) store.SetValue (it, 3, RenderIcon (new_child.OpenedImage));
+ if (new_child.ClosedImage != null) store.SetValue (it, 4, RenderIcon (new_child.ClosedImage));
new_child.row = new Gtk.TreeRowReference (store, store.GetPath (it));
@@ -226,7 +228,7 @@
Gtk.TreeIter i = Append (node);
- AddNodesRecursively(store, i, node);
+ AddNodesRecursively (store, i, node);
}
private void OnNodeRemoved (TreeNode node)
@@ -242,7 +244,7 @@
private TreeNode GetNodeByIter (Gtk.TreeIter iter)
{
- TreeNode ret = (TreeNode)store.GetValue(iter, 2);
+ TreeNode ret = (TreeNode) store.GetValue(iter, 2);
return ret;
}
@@ -259,6 +261,11 @@
{
// Nothing
}
+
+ internal Gdk.Pixbuf RenderIcon (string stock_id)
+ {
+ return RenderIcon (stock_id, Gtk.IconSize.Button, "");
+ }
}
public class TreeViewCancelEventArgs {
Modified: trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -28,6 +28,7 @@
using ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser;
using Gtk;
+using Stock = MonoDevelop.Gui.Stock;
namespace ICSharpCode.SharpDevelop.Commands.ProjectBrowser
{
@@ -70,8 +71,8 @@
ProjectFile fileInformation = projectService.AddFileToProject(project, fileName, BuildAction.EmbedAsResource);
AbstractBrowserNode newResNode = new FileNode(fileInformation);
- newResNode.IconImage = resourceService.GetBitmap ("Icons.16x16.ResourceFileIcon");
- node.Nodes.Add(newResNode);
+ newResNode.Image = Stock.ResourceFileIcon;
+ node.Nodes.Add (newResNode);
}
node.Expand();
projectService.SaveCombine();
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/NewProjectDialog.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -31,7 +31,6 @@
public class NewProjectDialog {
ArrayList alltemplates = new ArrayList();
ArrayList categories = new ArrayList();
- Hashtable icons = new Hashtable();
IconView TemplateView;
FolderEntry entry_location;
@@ -55,7 +54,6 @@
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
- IconService iconService = (IconService)ServiceManager.Services.GetService(typeof(IconService));
MessageService messageService = (MessageService)ServiceManager.Services.GetService(typeof(MessageService));
bool openCombine;
@@ -78,35 +76,6 @@
void InitializeView()
{
- PixbufList imglist = new PixbufList();
-
- imglist.Add(resourceService.GetBitmap("Icons.32x32.EmptyProjectIcon"));
-
- // load the icons and set their index from the image list in the hashtable
- int i = 0;
- Hashtable tmp = new Hashtable(icons);
-
- foreach (DictionaryEntry entry in icons) {
- Gdk.Pixbuf bitmap = iconService.GetBitmap(entry.Key.ToString());
- if (bitmap != null) {
- imglist.Add(bitmap);
- tmp[entry.Key] = ++i;
- } else {
- Console.WriteLine("can't load bitmap " + entry.Key.ToString() + " using default");
- }
- }
-
- // set the correct imageindex for all templates
- icons = tmp;
- foreach (TemplateItem item in alltemplates) {
- if (item.Template.Icon == null) {
- // item.ImageIndex = 0;
- } else {
- // item.ImageIndex = (int)icons[item.Template.Icon];
- }
- }
-
-
InsertCategories (TreeIter.Zero, categories);
/*for (int j = 0; j < categories.Count; ++j) {
if (((Category)categories[j]).Name == propertyService.GetProperty("Dialogs.NewProjectDialog.LastSelectedCategory", "C#")) {
@@ -145,8 +114,6 @@
{
foreach (ProjectTemplate template in ProjectTemplate.ProjectTemplates) {
TemplateItem titem = new TemplateItem(template);
- if (titem.Template.Icon != null)
- icons[titem.Template.Icon] = 0; // "create template icon"
Category cat = GetCategory(titem.Template.Category);
cat.Templates.Add(titem);
//if (cat.Templates.Count == 1)
@@ -162,8 +129,9 @@
if (lst_template_types.Selection.GetSelected (out mdl, out iter)) {
TemplateView.Clear ();
foreach (TemplateItem item in ((Category)catStore.GetValue (iter, 1)).Templates) {
- TemplateView.AddIcon (new Gtk.Image (iconService.GetBitmap (item.Template.Icon)), item.Name, item.Template);
+ TemplateView.AddIcon (new Gtk.Image (item.Template.Icon, Gtk.IconSize.Button), item.Name, item.Template);
}
+
btn_new.Sensitive = false;
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/WordCountDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/WordCountDialog.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/WordCountDialog.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -319,8 +319,8 @@
store.AppendValues ("", "", "", "");
resultListView.Model = store;
- IconService iconService = (IconService)ICSharpCode.Core.Services.ServiceManager.Services.GetService (typeof(IconService));
- this.Icon = iconService.GetIcon ("Icons.16x16.FindIcon");
+ ResourceService resourceService = (ResourceService) ServiceManager.Services.GetService(typeof(IResourceService));
+ this.Icon = resourceService.GetIcon ("Icons.16x16.FindIcon");
this.TransientFor = (Window) WorkbenchSingleton.Workbench;
HBox hbox = new HBox (false, 0);
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -25,6 +25,7 @@
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.Services;
using MonoDevelop.Gui.Widgets;
+using Stock = MonoDevelop.Gui.Stock;
namespace ICSharpCode.SharpDevelop.Gui.Pads
{
@@ -59,7 +60,7 @@
{
//Panel contentPanel = new Panel();
Gtk.Frame contentPanel;
- int imageIndexOffset = -1;
+
ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
ParseInformationEventHandler addParseInformationHandler = null;
ParseInformationEventHandler removeParseInformationHandler = null;
@@ -103,22 +104,9 @@
addParseInformationHandler = new ParseInformationEventHandler(OnParseInformationAdded);
removeParseInformationHandler = new ParseInformationEventHandler(OnParseInformationRemoved);
- ClassBrowserIconsService classBrowserIconService = (ClassBrowserIconsService)ServiceManager.Services.GetService(typeof(ClassBrowserIconsService));
-
- this.ImageList = classBrowserIconService.ImageList;
-
- imageIndexOffset = ImageList.Count;
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
- IconService iconService = (IconService)ServiceManager.Services.GetService(typeof(IconService));
- foreach (Gdk.Pixbuf img in iconService.ImageList) {
- ImageList.Add(img);
- }
LabelEdit = false;
- //HotTracking = false;
- //AllowDrop = true;
- //HideSelection = false;
- //Dock = DockStyle.Fill;
IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
@@ -313,7 +301,7 @@
ClassBrowserIconsService classBrowserIconService = (ClassBrowserIconsService)ServiceManager.Services.GetService(typeof(ClassBrowserIconsService));
TreeNode combineNode = new TreeNode(combine.Name);
//combineNode.SelectedImageIndex = combineNode.ImageIndex = classBrowserIconService.CombineIndex;
- combineNode.Image = classBrowserIconService.ImageList[classBrowserIconService.CombineIndex];
+ combineNode.Image = Stock.CombineIcon;
foreach (CombineEntry entry in combine.Entries) {
if (entry is ProjectCombineEntry) {
@@ -332,7 +320,7 @@
bool builderFound = false;
foreach (IClassScoutNodeBuilder classBrowserNodeBuilder in classBrowserNodeBuilders) {
if (classBrowserNodeBuilder.CanBuildClassTree(p)) {
- TreeNode prjNode = classBrowserNodeBuilder.BuildClassTreeNode(p, imageIndexOffset);
+ TreeNode prjNode = classBrowserNodeBuilder.BuildClassTreeNode(p);
nodes.Add(prjNode);
prjNode.Tag = p;
builderFound = true;
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -22,11 +22,12 @@
using ICSharpCode.SharpDevelop.Services;
using MonoDevelop.Gui.Widgets;
+using Stock = MonoDevelop.Gui.Stock;
+
namespace ICSharpCode.SharpDevelop.Gui.Pads
{
public class DefaultDotNetClassScoutNodeBuilder : IClassScoutNodeBuilder
{
- int imageIndexOffset;
IAmbience languageConversion;
public DefaultDotNetClassScoutNodeBuilder()
@@ -74,23 +75,21 @@
public void UpdateClassTree(TreeNode projectNode)
{
- TreeNode newNode = BuildClassTreeNode((IProject)projectNode.Tag, imageIndexOffset);
+ TreeNode newNode = BuildClassTreeNode((IProject)projectNode.Tag);
projectNode.Nodes.Clear();
foreach (TreeNode node in newNode.Nodes)
projectNode.Nodes.Add(node);
}
- public TreeNode BuildClassTreeNode(IProject p, int imageIndexOffset)
+ public TreeNode BuildClassTreeNode(IProject p)
{
Type fus = typeof (FileUtilityService);
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(fus);
Type iconserv = typeof (IconService);
IconService iconService = (IconService)ServiceManager.Services.GetService(iconserv);
- this.imageIndexOffset = imageIndexOffset;
GetCurrentAmbience();
TreeNode prjNode = new AbstractClassScoutNode(p.Name);
- //prjNode.SelectedImageIndex = prjNode.ImageIndex = imageIndexOffset + iconService.GetImageIndexForProjectType(p.ProjectType);
prjNode.Image = iconService.GetImageForProjectType(p.ProjectType);
foreach (ProjectFile finfo in p.ProjectFiles) {
if (finfo.BuildAction == BuildAction.Compile) {
@@ -151,8 +150,8 @@
ClassBrowserIconsService classBrowserIconService = (ClassBrowserIconsService)ServiceManager.Services.GetService(typeof(ClassBrowserIconsService));
AbstractClassScoutNode classNode = new AbstractClassScoutNode(c.Name);
- //classNode.SelectedImageIndex = classNode.ImageIndex = classBrowserIconService.GetIcon(c);
- classNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(c)];
+
+ classNode.Image = classBrowserIconService.GetIcon (c);
classNode.ContextmenuAddinTreePath = "/SharpDevelop/Views/ClassScout/ContextMenu/ClassNode";
classNode.Tag = new ClassScoutTag(c.Region.BeginLine, filename);
@@ -166,7 +165,7 @@
TreeNode innerClassNode = new AbstractClassScoutNode(languageConversion.Convert(innerClass));
innerClassNode.Tag = new ClassScoutTag(innerClass.Region.BeginLine, filename);
//innerClassNode.SelectedImageIndex = innerClassNode.ImageIndex = classBrowserIconService.GetIcon(innerClass);
- innerClassNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(innerClass)];
+ innerClassNode.Image = classBrowserIconService.GetIcon(innerClass);
classNode.Nodes.Add(innerClassNode);
} else {
TreeNode n = BuildClassNode(filename, innerClass);
@@ -180,7 +179,7 @@
TreeNode methodNode = new AbstractClassScoutNode(languageConversion.Convert(method));
methodNode.Tag = new ClassScoutTag(method.Region.BeginLine, filename);
//methodNode.SelectedImageIndex = methodNode.ImageIndex = classBrowserIconService.GetIcon(method);
- methodNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(method)];
+ methodNode.Image = classBrowserIconService.GetIcon(method);
classNode.Nodes.Add(methodNode);
}
@@ -188,7 +187,7 @@
TreeNode propertyNode = new AbstractClassScoutNode(languageConversion.Convert(property));
propertyNode.Tag = new ClassScoutTag(property.Region.BeginLine, filename);
//propertyNode.SelectedImageIndex = propertyNode.ImageIndex = classBrowserIconService.GetIcon(property);
- propertyNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(property)];
+ propertyNode.Image = classBrowserIconService.GetIcon(property);
classNode.Nodes.Add(propertyNode);
}
@@ -196,7 +195,7 @@
TreeNode fieldNode = new AbstractClassScoutNode(languageConversion.Convert(field));
fieldNode.Tag = new ClassScoutTag(field.Region.BeginLine, filename);
//fieldNode.SelectedImageIndex = fieldNode.ImageIndex = classBrowserIconService.GetIcon(field);
- fieldNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(field)];
+ fieldNode.Image = classBrowserIconService.GetIcon(field);
classNode.Nodes.Add(fieldNode);
}
@@ -204,7 +203,7 @@
TreeNode eventNode = new AbstractClassScoutNode(languageConversion.Convert(e));
eventNode.Tag = new ClassScoutTag(e.Region.BeginLine, filename);
//eventNode.SelectedImageIndex = eventNode.ImageIndex = classBrowserIconService.GetIcon(e);
- eventNode.Image = classBrowserIconService.ImageList[classBrowserIconService.GetIcon(e)];
+ eventNode.Image = classBrowserIconService.GetIcon(e);
classNode.Nodes.Add(eventNode);
}
@@ -228,7 +227,7 @@
if (create) {
TreeNode newnode = new AbstractClassScoutNode(path);
//newnode.ImageIndex = newnode.SelectedImageIndex = classBrowserIconService.NamespaceIndex;
- newnode.Image = classBrowserIconService.ImageList[classBrowserIconService.NamespaceIndex];
+ newnode.Image = Stock.NameSpace;
curcollection.Add (newnode);
curnode = newnode;
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -22,7 +22,7 @@
public interface IClassScoutNodeBuilder
{
bool CanBuildClassTree(IProject project);
- TreeNode BuildClassTreeNode(IProject project, int fileUtilityImageListOffset);
+ TreeNode BuildClassTreeNode(IProject project);
void AddToClassTree(TreeNode projectNode, ParseInformationEventArgs e);
void RemoveFromClassTree(TreeNode parentNode, ParseInformationEventArgs e);
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/AbstractBrowserNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/AbstractBrowserNode.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/AbstractBrowserNode.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -98,18 +98,6 @@
}
#endregion
-
- /// <summary>
- /// This property gets/sets the current image of this tree node.
- /// </summary>
- public Gdk.Pixbuf IconImage {
- get {
- return Image;
- }
- set {
- Image = value;
- }
- }
/// <summary>
/// Generates a Drag & Drop data object. If this property returns null
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -17,6 +17,7 @@
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.Internal.Project;
using ICSharpCode.SharpDevelop.Gui.Components;
+using Stock = MonoDevelop.Gui.Stock;
namespace ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser
{
@@ -40,7 +41,7 @@
UserData = combine;
this.combine = combine;
UpdateNaming();
- IconImage = resourceService.GetBitmap("Icons.16x16.CombineIcon");
+ Image = Stock.CombineIcon;
contextmenuAddinTreePath = defaultContextMenuPath;
combine.NameChanged += new EventHandler(UpdateCombineName);
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -18,6 +18,7 @@
using ICSharpCode.SharpDevelop.Services;
using ICSharpCode.SharpDevelop.Internal.Project;
using ICSharpCode.SharpDevelop.Gui.Components;
+using Stock = MonoDevelop.Gui.Stock;
namespace ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser
{
@@ -49,9 +50,9 @@
this.folderName = folderName;
canLabelEdited = true;
contextmenuAddinTreePath = defaultContextMenuPath;
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenFolderBitmap");
- ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedFolderBitmap");
+
+ OpenedImage = Stock.OpenFolderBitmap;
+ ClosedImage = Stock.ClosedFolderBitmap;
}
/*
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -65,7 +65,7 @@
protected virtual void SetNodeIcon()
{
IconService iconService = (IconService)ServiceManager.Services.GetService(typeof(IconService));
- IconImage = iconService.GetImageForFile(((ProjectFile)userData).Name);
+ Image = iconService.GetImageForFile(((ProjectFile)userData).Name);
}
protected virtual void SetNodeLabel()
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -20,6 +20,7 @@
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.Internal.Project;
using MonoDevelop.Gui.Widgets;
+using Stock = MonoDevelop.Gui.Stock;
namespace ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser
{
@@ -51,19 +52,19 @@
IconService iconService = (IconService)ServiceManager.Services.GetService(typeof(IconService));
ProjectBrowserNode projectNode = new ProjectBrowserNode(project);
- projectNode.IconImage = iconService.GetImageForProjectType(project.ProjectType);
+ projectNode.Image = iconService.GetImageForProjectType (project.ProjectType);
FolderNode resourceNode = new NamedFolderNode("ProjectComponent.ResourceFilesString", 0);
resourceNode.ContextmenuAddinTreePath = "/SharpDevelop/Views/ProjectBrowser/ContextMenu/ResourceFolderNode";
- resourceNode.OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenResourceFolder");
- resourceNode.ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedResourceFolder");
- projectNode.Nodes.Add(resourceNode);
+ resourceNode.OpenedImage = Stock.OpenResourceFolder;
+ resourceNode.ClosedImage = Stock.ClosedResourceFolder;
+ projectNode.Nodes.Add (resourceNode);
FolderNode referenceNode = new NamedFolderNode("ProjectComponent.ReferencesString", 1);
referenceNode.ContextmenuAddinTreePath = "/SharpDevelop/Views/ProjectBrowser/ContextMenu/ReferenceFolderNode";
- referenceNode.OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenReferenceFolder");
- referenceNode.ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedReferenceFolder");
- projectNode.Nodes.Add(referenceNode);
+ referenceNode.OpenedImage = Stock.OpenReferenceFolder;
+ referenceNode.ClosedImage = Stock.ClosedReferenceFolder;
+ projectNode.Nodes.Add (referenceNode);
// build a hash of projectFile items
System.Collections.Hashtable fileHash = new Hashtable();
@@ -240,7 +241,7 @@
default:
AbstractBrowserNode currentPathNode1;
- currentPathNode1 = GetPath(relativeFile, parentNode, true);
+ currentPathNode1 = GetPath (relativeFile, parentNode, true);
AbstractBrowserNode newNode = new FileNode(projectFile);
newNode.ContextmenuAddinTreePath = FileNode.ProjectFileContextMenuPath;
@@ -253,7 +254,7 @@
case Subtype.Directory:
{
// add a directory
- string directoryName = relativeFile;
+ string directoryName = relativeFile;
// if directoryname starts with ./ oder .\ //
if (directoryName.StartsWith(".")) {
@@ -268,17 +269,18 @@
if(currentPathNode == null) {
currentPathNode = parentNode;
DirectoryNode newFolderNode = new DirectoryNode(projectFile.Name);
- if(IsWebReference(currentPathNode)) {
- newFolderNode.OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenWebReferenceFolder");
- newFolderNode.ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedWebReferenceFolder");
- } else {
- newFolderNode.OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenFolderBitmap");
- newFolderNode.ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedFolderBitmap");
- }
+ //if(IsWebReference(currentPathNode)) {
+ // newFolderNode.OpenedImage = Stock.OpenWebReferenceFolder;
+ // newFolderNode.ClosedImage = Stock.ClosedWebReferenceFolder;
+ //} else {
+ newFolderNode.OpenedImage = Stock.OpenFolderBitmap;
+ newFolderNode.ClosedImage = Stock.ClosedFolderBitmap;
+ //}
currentPathNode.Nodes.Add(newFolderNode);
}
}
break;
+#if NOT_DONE
case Subtype.WebReferences:
{
// add a web directory
@@ -289,13 +291,14 @@
}
DirectoryNode newFolderNode = new DirectoryNode(projectFile.Name);
- newFolderNode.OpenedImage = resourceService.GetBitmap("Icons.16x16.OpenWebReferenceFolder");
- newFolderNode.ClosedImage = resourceService.GetBitmap("Icons.16x16.ClosedWebReferenceFolder");
-
+ newFolderNode.OpenedImage = Stock.OpenWebReferenceFolder;
+ newFolderNode.ClosedImage = Stock.ClosedWebReferenceFolder;
+
string parentDirectory = Path.GetFileName(directoryName);
projectNode.Nodes.Add (newFolderNode);
}
break;
+
case Subtype.WebForm:
{
// add the source file with the cool icon
@@ -304,7 +307,8 @@
currentPathNode1 = GetPath(relativeFile, parentNode, true);
AbstractBrowserNode newNode = new FileNode(projectFile);
- newNode.IconImage = resourceService.GetBitmap("Icons.16x16.WebForm");
+ // Dont have this
+ //newNode.IconImage = Stock.WebForm;
newNode.ContextmenuAddinTreePath = FileNode.ProjectFileContextMenuPath;
//parentNode.Nodes.Add(newNode);
@@ -313,7 +317,6 @@
}
break;
-
case Subtype.WinForm:
{
// add the source file with the cool icon
@@ -321,8 +324,8 @@
AbstractBrowserNode currentPathNode1;
currentPathNode1 = GetPath(relativeFile, parentNode, true);
- AbstractBrowserNode newNode = new FileNode(projectFile);
- newNode.IconImage = resourceService.GetBitmap("Icons.16x16.WinForm");
+ AbstractBrowserNode newNode = new FileNode (projectFile);
+ newNode.IconImage = Stock.WinForm;
newNode.ContextmenuAddinTreePath = FileNode.ProjectFileContextMenuPath;
//parentNode.Nodes.Add(newNode);
@@ -339,12 +342,14 @@
case Subtype.WebService:
// not supported yet
break;
+#endif
default:
+ Console.WriteLine ("UNHANDLED TYPE {0}, DefaultDotNetNodeBuilder.cs", projectFile.Subtype);
// unknown file type
break;
}
- if(projectNode.TreeView != null)
- projectNode.TreeView.EndUpdate();
+ if (projectNode.TreeView != null)
+ projectNode.TreeView.EndUpdate ();
}
public static AbstractBrowserNode GetProjectNode(AbstractBrowserNode childNode) {
@@ -444,11 +449,11 @@
throw new NotImplementedException("reference type : " + referenceInformation.ReferenceType);
}
- AbstractBrowserNode newReferenceNode = new ReferenceNode(referenceInformation);
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- newReferenceNode.IconImage = resourceService.GetBitmap("Icons.16x16.Reference");
+ AbstractBrowserNode newReferenceNode = new ReferenceNode (referenceInformation);
+
+ newReferenceNode.Image = Stock.Reference;
- parentNode.Nodes.Add(newReferenceNode);
+ parentNode.Nodes.Add (newReferenceNode);
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Services/ClassBrowserIcons/ClassBrowserIconsService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ClassBrowserIcons/ClassBrowserIconsService.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Services/ClassBrowserIcons/ClassBrowserIconsService.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -20,344 +20,144 @@
using ICSharpCode.Core.Properties;
using ICSharpCode.Core.Services;
+using Stock = MonoDevelop.Gui.Stock;
-namespace ICSharpCode.SharpDevelop.Services
-{
- public class ClassBrowserIconsService : AbstractService
- {
- const int namespaceIndex = 3;
- const int combineIndex = 46;
- const int literalIndex = 47;
-
- const int classIndex = 14;
- const int structIndex = classIndex + 1 * 4;
- const int interfaceIndex = classIndex + 2 * 4;
- const int enumIndex = classIndex + 3 * 4;
- const int methodIndex = classIndex + 4 * 4;
- const int propertyIndex = classIndex + 5 * 4;
- const int fieldIndex = classIndex + 6 * 4;
- const int delegateIndex = classIndex + 7 * 4;
- const int eventIndex = classIndex + 8 * 4 + 2;
-
- const int internalModifierOffset = 1;
- const int protectedModifierOffset = 2;
- const int privateModifierOffset = 3;
-
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- PixbufList imglist = null;
-
- public PixbufList ImageList {
- get {
- if (imglist == null) {
- LoadImageList();
- }
- return imglist;
- }
- }
-
- public int CombineIndex {
- get {
- return combineIndex;
- }
- }
-
- public int NamespaceIndex {
- get {
- return namespaceIndex;
- }
- }
-
- public int LiteralIndex {
- get {
- return literalIndex;
- }
- }
-
- public int ClassIndex {
- get {
- return classIndex;
- }
- }
+namespace ICSharpCode.SharpDevelop.Services {
+ public class ClassBrowserIconsService : AbstractService {
- public int StructIndex {
- get {
- return structIndex;
- }
- }
+ string GetWithModifiers (ModifierEnum modifier, string mod_public, string mod_protected, string mod_internal, string mod_private)
+ {
+ if ((modifier & ModifierEnum.Public) == ModifierEnum.Public)
+ return mod_public;
+
+ if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected)
+ return mod_protected;
- public int InterfaceIndex {
- get {
- return interfaceIndex;
- }
+ if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal)
+ return mod_internal;
+
+ return mod_private;
}
-
- public int EnumIndex {
- get {
- return enumIndex;
- }
- }
-
- public int MethodIndex {
- get {
- return methodIndex;
- }
- }
- public int PropertyIndex {
- get {
- return propertyIndex;
- }
+ public string GetIcon (IMethod method)
+ {
+ return GetWithModifiers (method.Modifiers, Stock.Method, Stock.ProtectedMethod, Stock.InternalMethod, Stock.PrivateMethod);
}
-
- public int FieldIndex {
- get {
- return fieldIndex;
- }
- }
-
- public int DelegateIndex {
- get {
- return delegateIndex;
- }
- }
-
- public int EventIndex {
- get {
- return eventIndex;
- }
- }
-
- public int InternalModifierOffset {
- get {
- return internalModifierOffset;
- }
- }
-
- public int ProtectedModifierOffset {
- get {
- return protectedModifierOffset;
- }
- }
-
- public int PrivateModifierOffset {
- get {
- return privateModifierOffset;
- }
- }
- int GetModifierOffset(ModifierEnum modifier)
+ public string GetIcon (IProperty method)
{
- if ((modifier & ModifierEnum.Public) == ModifierEnum.Public) {
- return 0;
- }
- if ((modifier & ModifierEnum.Protected) == ModifierEnum.Protected) {
- return protectedModifierOffset;
- }
- if ((modifier & ModifierEnum.Internal) == ModifierEnum.Internal) {
- return internalModifierOffset;
- }
- return privateModifierOffset;
+ return GetWithModifiers (method.Modifiers, Stock.Property, Stock.ProtectedProperty, Stock.InternalProperty, Stock.PrivateProperty);
}
- public int GetIcon(IMethod method)
+ public string GetIcon (IField field)
{
- return methodIndex + GetModifierOffset(method.Modifiers);
+ if (field.IsLiteral)
+ return Stock.Literal;
+
+ return GetWithModifiers (field.Modifiers, Stock.Field, Stock.ProtectedField, Stock.InternalField, Stock.PrivateField);
}
- public int GetIcon(IProperty method)
+ public string GetIcon (IEvent evt)
{
- return propertyIndex + GetModifierOffset(method.Modifiers);
+ return GetWithModifiers (evt.Modifiers, Stock.Event, Stock.ProtectedEvent, Stock.InternalEvent, Stock.PrivateEvent);
}
- public int GetIcon(IField field)
+ public string GetIcon (IClass c)
{
- if (field.IsLiteral) {
- return literalIndex;
+ switch (c.ClassType) {
+ case ClassType.Delegate:
+ return GetWithModifiers (c.Modifiers, Stock.Delegate, Stock.ProtectedDelegate, Stock.InternalDelegate, Stock.PrivateDelegate);
+ case ClassType.Enum:
+ return GetWithModifiers (c.Modifiers, Stock.Enum, Stock.ProtectedEnum, Stock.InternalEnum, Stock.PrivateEnum);
+ case ClassType.Struct:
+ return GetWithModifiers (c.Modifiers, Stock.Struct, Stock.ProtectedStruct, Stock.InternalStruct, Stock.PrivateStruct);
+ case ClassType.Interface:
+ return GetWithModifiers (c.Modifiers, Stock.Interface, Stock.ProtectedInterface, Stock.InternalInterface, Stock.PrivateInterface);
+ default:
+ return GetWithModifiers (c.Modifiers, Stock.Class, Stock.ProtectedClass, Stock.InternalClass, Stock.PrivateClass);
}
- return fieldIndex + GetModifierOffset(field.Modifiers);
}
- public int GetIcon(IEvent evt)
+ string GetWithModifiers (MethodBase mb, string mod_public, string mod_protected, string mod_internal, string mod_private)
{
- return eventIndex + GetModifierOffset(evt.Modifiers);
+ if (mb.IsAssembly)
+ return mod_internal;
+
+ if (mb.IsPrivate)
+ return mod_private;
+
+ if (!(mb.IsPrivate || mb.IsPublic))
+ return mod_protected;
+
+ return mod_public;
}
- public int GetIcon(IClass c)
+ public string GetIcon (MethodBase m)
{
- int imageIndex = classIndex;
- switch (c.ClassType) {
- case ClassType.Delegate:
- imageIndex = delegateIndex;
- break;
- case ClassType.Enum:
- imageIndex = enumIndex;
- break;
- case ClassType.Struct:
- imageIndex = structIndex;
- break;
- case ClassType.Interface:
- imageIndex = interfaceIndex;
- break;
- }
- return imageIndex + GetModifierOffset(c.Modifiers);
+ return GetWithModifiers (m, Stock.Method, Stock.ProtectedMethod, Stock.InternalMethod, Stock.PrivateMethod);
}
-
- public int GetIcon(MethodBase methodinfo)
+ public string GetIcon (PropertyInfo propertyinfo)
{
- if (methodinfo.IsAssembly) {
- return methodIndex + internalModifierOffset;
- }
- if (methodinfo.IsPrivate) {
- return methodIndex + privateModifierOffset;
- }
- if (!(methodinfo.IsPrivate || methodinfo.IsPublic)) {
- return methodIndex + protectedModifierOffset;
- }
+ MethodBase m;
+ if ((propertyinfo.CanRead && (m = propertyinfo.GetGetMethod (true)) != null) ||
+ (propertyinfo.CanWrite && (m = propertyinfo.GetSetMethod (true)) != null))
+ return GetWithModifiers (m, Stock.Property, Stock.ProtectedProperty, Stock.InternalProperty, Stock.PrivateProperty);
- return methodIndex;
+ return Stock.Property;
}
- public int GetIcon(PropertyInfo propertyinfo)
+ public string GetIcon (FieldInfo fieldinfo)
{
- if (propertyinfo.CanRead && propertyinfo.GetGetMethod(true) != null) {
- return propertyIndex + GetIcon(propertyinfo.GetGetMethod(true)) - methodIndex;
- }
- if (propertyinfo.CanWrite && propertyinfo.GetSetMethod(true) != null) {
- return propertyIndex + GetIcon(propertyinfo.GetSetMethod(true)) - methodIndex;
- }
- return propertyIndex;
- }
-
- public int GetIcon(FieldInfo fieldinfo)
- {
- if (fieldinfo.IsLiteral) {
- return 13;
- }
+ if (fieldinfo.IsLiteral)
+ return Stock.Literal;
- if (fieldinfo.IsAssembly) {
- return fieldIndex + internalModifierOffset;
- }
+ if (fieldinfo.IsAssembly)
+ return Stock.InternalField;
- if (fieldinfo.IsPrivate) {
- return fieldIndex + privateModifierOffset;
- }
+ if (fieldinfo.IsPrivate)
+ return Stock.PrivateField;
- if (!(fieldinfo.IsPrivate || fieldinfo.IsPublic)) {
- return fieldIndex + protectedModifierOffset;
- }
+ if (!(fieldinfo.IsPrivate || fieldinfo.IsPublic))
+ return Stock.ProtectedField;
- return fieldIndex;
+ return Stock.Field;
}
- public int GetIcon(EventInfo eventinfo)
+ public string GetIcon(EventInfo eventinfo)
{
- if (eventinfo.GetAddMethod(true) != null) {
- return eventIndex + GetIcon(eventinfo.GetAddMethod(true)) - methodIndex;
- }
- return eventIndex;
- }
-
- public int GetIcon(System.Type type)
- {
- int BASE = classIndex;
+ if (eventinfo.GetAddMethod (true) != null)
+ return GetWithModifiers (eventinfo.GetAddMethod (true), Stock.Event, Stock.ProtectedEvent, Stock.InternalEvent, Stock.PrivateEvent);
- if (type.IsValueType) {
- BASE = structIndex;
- }
- if (type.IsEnum) {
- BASE = enumIndex;
- }
- if (type.IsInterface) {
- BASE = interfaceIndex;
- }
- if (type.IsSubclassOf(typeof(System.Delegate))) {
- BASE = delegateIndex;
- }
-
- if (type.IsNestedPrivate) {
- return BASE + 3;
- }
-
- if (type.IsNotPublic || type.IsNestedAssembly) {
- return BASE + 1;
- }
-
- if (type.IsNestedFamily) {
- return BASE + 2;
- }
- return BASE;
+ return Stock.Event;
}
- void LoadImageList()
+ public string GetIcon(System.Type type)
{
- imglist = new PixbufList();
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Assembly"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.OpenAssembly"));
+ ModifierEnum mod;
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Library"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.NameSpace"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.SubTypes"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.SuperTypes"));
+ if (type.IsNestedPrivate)
+ mod = ModifierEnum.Private;
+ else if (type.IsNotPublic || type.IsNestedAssembly)
+ mod = ModifierEnum.Internal;
+ else if (type.IsNestedFamily)
+ mod = ModifierEnum.Protected;
+ else
+ mod = ModifierEnum.Public;
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
+ if (type.IsValueType)
+ return GetWithModifiers (mod, Stock.Struct, Stock.ProtectedStruct, Stock.InternalStruct, Stock.PrivateStruct);
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Reference"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ClosedReferenceFolder"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.OpenReferenceFolder"));
+ if (type.IsEnum)
+ return GetWithModifiers (mod, Stock.Enum, Stock.ProtectedEnum, Stock.InternalEnum, Stock.PrivateEnum);
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ResourceFileIcon"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Event"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Literal"));
+ if (type.IsInterface)
+ return GetWithModifiers (mod, Stock.Interface, Stock.ProtectedInterface, Stock.InternalInterface, Stock.PrivateInterface);
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Class")); //14
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalClass"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedClass"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateClass"));
+ if (type.IsSubclassOf (typeof (System.Delegate)))
+ return GetWithModifiers (mod, Stock.Delegate, Stock.ProtectedDelegate, Stock.InternalDelegate, Stock.PrivateDelegate);
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Struct"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalStruct"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedStruct"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateStruct"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Interface"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalInterface"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedInterface"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateInterface"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Enum"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalEnum"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedEnum"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateEnum"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Method"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalMethod"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedMethod"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateMethod"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Property"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalProperty"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedProperty"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateProperty"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Field"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalField"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedField"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateField"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Delegate"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalDelegate"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedDelegate"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateDelegate"));
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.CombineIcon")); // 46
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Literal")); // 47
-
- imglist.Add(resourceService.GetBitmap("Icons.16x16.Event"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.InternalEvent"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.ProtectedEvent"));
- imglist.Add(resourceService.GetBitmap("Icons.16x16.PrivateEvent"));
+ return GetWithModifiers (mod, Stock.Class, Stock.ProtectedClass, Stock.InternalClass, Stock.PrivateClass);
}
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Services/IconService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/IconService.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Services/IconService.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -21,164 +21,67 @@
using ICSharpCode.Core.Services;
using ICSharpCode.Core.AddIns;
using ICSharpCode.Core.AddIns.Codons;
+using Stock = MonoDevelop.Gui.Stock;
-namespace ICSharpCode.Core.Services
-{
- public class IconService : AbstractService
- {
- //ImageList imagelist;
- ArrayList imagelist = new ArrayList();
- Hashtable extensionHashtable = new Hashtable();
- Hashtable projectFileHashtable = new Hashtable();
- Hashtable customIcons = new Hashtable();
+namespace ICSharpCode.Core.Services {
+ public class IconService : AbstractService {
+ Hashtable extensionHashtable = new Hashtable ();
+ Hashtable projectFileHashtable = new Hashtable ();
- readonly static char[] separators = {Path.DirectorySeparatorChar, Path.VolumeSeparatorChar};
-
- public ArrayList ImageList {
- get {
- lock (imagelist) {
- return imagelist;
- }
- }
- }
-
-
- int initalsize = 0;
-
- public IconService()
- {
- //imagelist = new ImageList();
- //imagelist.ColorDepth = ColorDepth.Depth32Bit;
- }
-
- void LoadThread()
- {
- InitializeIcons(AddInTreeSingleton.AddInTree.GetTreeNode("/Workspace/Icons"));
- }
-
public override void InitializeService()
{
base.InitializeService();
- Thread myThread = new Thread(new ThreadStart(LoadThread));
- myThread.IsBackground = true;
- myThread.Priority = ThreadPriority.Normal;
- myThread.Start();
+ InitializeIcons(AddInTreeSingleton.AddInTree.GetTreeNode("/Workspace/Icons"));
}
public override void UnloadService()
{
base.UnloadService();
- //imagelist.Dispose();
}
- public Gdk.Pixbuf GetBitmap(string name)
+ public string GetImageForProjectType (string projectType)
{
- if (customIcons[name] != null) {
- return (Gdk.Pixbuf)customIcons[name];
- }
+ if (projectFileHashtable [projectType] != null)
+ return (string) projectFileHashtable [projectType];
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- if (resourceService.GetBitmap(name) != null) {
- return resourceService.GetBitmap(name);
- }
-
- return resourceService.GetBitmap("Icons.16x16.MiscFiles");
+ return (string) extensionHashtable [".PRJX"];
}
- public Gdk.Pixbuf GetIcon(string name)
+ public string GetImageForFile (string fileName)
{
- Gdk.Pixbuf bitmap = GetBitmap(name);
- return bitmap;
- //return Icon.FromHandle(bitmap.GetHicon());
+ string extension = Path.GetExtension (fileName).ToUpper ();
+
+ if (extensionHashtable.Contains (extension))
+ return (string) extensionHashtable [extension];
+
+ return Stock.MiscFiles;
}
-
-
- public Gdk.Pixbuf GetImageForProjectType(string projectType)
- {
- lock (imagelist) {
- int index = GetImageIndexForProjectType(projectType);
- if (index >= 0) {
- //return imagelist.Images[index];
- return (Gdk.Pixbuf)imagelist[index];
- }
- }
- return null;
- }
-
- public int GetImageIndexForProjectType(string projectType)
- {
- lock (imagelist) {
- if (projectFileHashtable[projectType] != null) {
- return (int)projectFileHashtable[projectType];
- }
- return (int)extensionHashtable[".PRJX"];
- }
- }
-
- public Gdk.Pixbuf GetImageForFile(string fileName)
- {
- lock (imagelist) {
- int index = GetImageIndexForFile(fileName);
- if (index >= 0) {
- //return imagelist.Images[index];
- return (Gdk.Pixbuf)imagelist[index];
- }
- return null;
- }
- }
-
- public int GetImageIndexForFile(string fileName)
- {
-
- lock (imagelist) {
- string extension = Path.GetExtension(fileName).ToUpper();
- if (extensionHashtable[extension] != null) {
- return (int)extensionHashtable[extension];
- }
- return initalsize;
- }
- }
-
- void InitializeIcons(IAddInTreeNode treeNode)
- {
- //imagelist.ColorDepth = ColorDepth.Depth32Bit;
- initalsize = imagelist.Count;
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- lock (imagelist) {
- imagelist.Add(resourceService.GetBitmap("Icons.16x16.MiscFiles"));
+ void InitializeIcons (IAddInTreeNode treeNode)
+ {
+ extensionHashtable[".PRJX"] = Stock.SolutionIcon;
+ extensionHashtable[".CMBX"] = Stock.CombineIcon;
+
+ IconCodon[] icons = (IconCodon[])treeNode.BuildChildItems(null).ToArray(typeof(IconCodon));
+ for (int i = 0; i < icons.Length; ++i) {
+ IconCodon iconCodon = icons[i];
+ string image;
+ if (iconCodon.Location != null)
+ throw new Exception ("This should be using stock icons");
+ else if (iconCodon.Resource != null)
+ image = iconCodon.Resource;
+ else
+ image = iconCodon.ID;
- extensionHashtable[".PRJX"] = imagelist.Count;
- imagelist.Add(resourceService.GetBitmap("Icons.16x16.SolutionIcon"));
+ image = ResourceService.GetStockId (image);
- extensionHashtable[".CMBX"] = imagelist.Count;
- imagelist.Add(resourceService.GetBitmap("Icons.16x16.CombineIcon"));
-
- IconCodon[] icons = (IconCodon[])treeNode.BuildChildItems(null).ToArray(typeof(IconCodon));
- for (int i = 0; i < icons.Length; ++i) {
- IconCodon iconCodon = icons[i];
- Gdk.Pixbuf image;
- if (iconCodon.Location != null) {
- image = new Gdk.Pixbuf(iconCodon.Location);
- customIcons[iconCodon.ID] = image;
- } else if (iconCodon.Resource != null) {
- image = GetBitmap(iconCodon.Resource);
- } else {
- image = GetBitmap(iconCodon.ID);
- }
- imagelist.Add(image);
-
- if (iconCodon.Extensions != null) {
- foreach (string ext in iconCodon.Extensions) {
- extensionHashtable[ext.ToUpper()] = imagelist.Count - 1;
- }
- }
- if (iconCodon.Language != null) {
- projectFileHashtable[iconCodon.Language] = imagelist.Count - 1;
- }
+ if (iconCodon.Extensions != null) {
+ foreach (string ext in iconCodon.Extensions)
+ extensionHashtable [ext.ToUpper()] = image;
}
+ if (iconCodon.Language != null)
+ projectFileHashtable [iconCodon.Language] = image;
}
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Services/ResourceService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ResourceService.cs 2004-02-13 06:48:43 UTC (rev 877)
+++ trunk/MonoDevelop/src/Main/Base/Services/ResourceService.cs 2004-02-13 20:04:47 UTC (rev 878)
@@ -364,7 +364,14 @@
public static string GetStockId (string filename)
{
- return (string) stockMappings [filename];
+ string s = (string) stockMappings [filename];
+
+ if (s != null)
+ return s;
+
+ Console.WriteLine ("WARNING Could not find stock {0}", filename);
+
+ return filename;
}
}
}
More information about the Monodevelop-patches-list
mailing list