//
//
//
//
// $Revision$
//
/*
* Module : FormDesigner
*
* Project : FormDesigner Loading Library Control.
*
* Source code altering : A1
*
* Description : création of the Tab item displayed into the AXSideTabDesigner control.
* the control's creator initialize the toolboxitem of the tab item
*
* Denis ERCHOFF 22/01/2003
*/
// Denis ERCHOFF 22/01/2003 BEGIN A1
using System;
using System.Windows.Forms;
using System.Drawing.Design;
using System.Drawing;
using System.ComponentModel.Design;
using ICSharpCode.Core;
using ICSharpCode.FormsDesigner.Services;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.FormsDesigner.Gui
{
public class SideTabItemDesigner : SharpDevelopSideTabItem
{
///create a tabitem from a toolboxitem. It init Icon and name from the tag
public SideTabItemDesigner(ToolboxItem tag) : base(tag.DisplayName, tag)
{
CanBeRenamed = false;
this.Icon = tag.Bitmap;
ReloadToolBox();
}
///create a tabitem from a toolboxitem. It init Icon from the tag
public SideTabItemDesigner(string name, ToolboxItem tag) : base(name, tag)
{
CanBeRenamed = false;
this.Icon = tag.Bitmap;
ReloadToolBox();
}
///create a default tabitem : a pointer icon with an empty toolboxitem
public SideTabItemDesigner() : base("Pointer")
{
CanBeRenamed = false;
CanBeDeleted = false;
Bitmap pointerBitmap = new Bitmap(IconService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon"), 16, 16);
// ToolboxItem toolboxItemPointer = new ToolboxItem();
// toolboxItemPointer.Bitmap = pointerBitmap;
// toolboxItemPointer.DisplayName = "Pointer";
this.Icon = pointerBitmap;
this.Tag = null;
ReloadToolBox();
}
///it force to reload toolboxitem into the ToolboxService when the hostchange
public void ReloadToolBox()
{
if (this.Name != "Pointer") {
ToolboxProvider.ToolboxService.AddToolboxItem(this.Tag as ToolboxItem);
}
}
}
}