// *
// * Copyright (C) 2008 Roger Alsing : http://www.RogerAlsing.com
// *
// * This library is free software; you can redistribute it and/or modify it
// * under the terms of the GNU Lesser General Public License 2.1 or later, as
// * published by the Free Software Foundation. See the included license.txt
// * or http://www.gnu.org/copyleft/lesser.html for details.
// *
// *
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace Alsing.Windows.Forms.SyntaxBox
{
[ToolboxItem(false)]
public class TabListBox : ListBox
{
///
/// For public use only.
///
///
///
protected override bool IsInputKey(Keys keyData)
{
return true;
}
///
/// For public use only.
///
///
///
protected override bool IsInputChar(char charCode)
{
return true;
}
}
///
/// Summary description for ListItem.
///
public class ListItem : IComparable
{
///
/// The insert text of a ListItem
///
public string InsertText = "";
///
/// The text of a ListItem
///
public string Text = "";
///
/// The tooltip text that should be displayed when selecting a ListItem
///
public string ToolTip = "";
///
/// The type of the ListItem (the type is used as an index to choose what icon to display)
///
public int Type;
///
/// ListItem constructor , takes text and type as parameters
///
/// The text that should be assigned to the ListItem
/// The type of the ListItem
public ListItem(string text, int type)
{
Text = text;
Type = type;
ToolTip = "";
}
///
/// ListItem constructor , takes text , type and tooltip text as parameters
///
/// The text that should be assigned to the ListItem
/// The type of the ListItem
/// The tooltip text that should be assigned to the ListItem
public ListItem(string text, int type, string tooltip)
{
Text = text;
Type = type;
ToolTip = tooltip;
}
///
/// ListItem constructor , takes text , type , tooltip text and insert text as parameters
///
/// The text that should be assigned to the ListItem
/// The type of the ListItem
/// The tooltip text that should be assigned to the ListItem
/// The text that should be inserted into the text when this item is selected
public ListItem(string text, int type, string tooltip, string inserttext)
{
Text = text;
Type = type;
ToolTip = tooltip;
InsertText = inserttext;
}
#region Implementation of IComparable
///
///
///
///
///
public int CompareTo(object obj)
{
var li = (ListItem) obj;
return Text.CompareTo(li.Text);
}
#endregion
///
///
///
///
public override string ToString()
{
return Text;
}
}
}