This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
gwen-dotnet/Gwen/Control/TabTitleBar.cs
Gered 10e057953e initial commit
Contains changes from "gwen-dotnet" removing dependancies on Windows,
which ultimately means certain features (e.g. file load/save dialogs)
do not work. Those classes still exist, but the code has been commented
out.
2013-03-28 18:47:01 -04:00

42 lines
1.1 KiB
C#

using System;
using Gwen.DragDrop;
namespace Gwen.Control
{
/// <summary>
/// Titlebar for DockedTabControl.
/// </summary>
public class TabTitleBar : Label
{
public TabTitleBar(Base parent) : base(parent)
{
MouseInputEnabled = true;
TextPadding = new Padding(5, 2, 5, 2);
Padding = new Padding(1, 2, 1, 2);
DragAndDrop_SetPackage(true, "TabWindowMove");
}
/// <summary>
/// Renders the control using specified skin.
/// </summary>
/// <param name="skin">Skin to use.</param>
protected override void Render(Skin.Base skin)
{
skin.DrawTabTitleBar(this);
}
public override void DragAndDrop_StartDragging(Package package, int x, int y)
{
DragAndDrop.SourceControl = Parent;
DragAndDrop.SourceControl.DragAndDrop_StartDragging(package, x, y);
}
public void UpdateFromTab(TabButton button)
{
Text = button.Text;
SizeToContents();
}
}
}