本文整理汇总了C#中Gwen.Control.GUIControl类的典型用法代码示例。如果您正苦于以下问题:C# GUIControl类的具体用法?C# GUIControl怎么用?C# GUIControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIControl类属于Gwen.Control命名空间,在下文中一共展示了GUIControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrollControl
/// <summary>
/// Initializes a new instance of the <see cref="ScrollControl"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public ScrollControl(ZGE.Components.ZComponent parent)
: base(parent)
{
MouseInputEnabled = true;
m_VerticalScrollBar = new VerticalScrollBar(this);
m_VerticalScrollBar.Dock = Pos.Right;
m_VerticalScrollBar.BarMoved += VBarMoved;
m_CanScrollV = true;
m_VerticalScrollBar.NudgeAmount = 30;
m_HorizontalScrollBar = new HorizontalScrollBar(this);
m_HorizontalScrollBar.Dock = Pos.Bottom;
m_HorizontalScrollBar.BarMoved += HBarMoved;
m_CanScrollH = true;
m_HorizontalScrollBar.NudgeAmount = 30;
m_InnerPanel = new GUIControl(this);
m_InnerPanel.SetPosition(0, 0);
m_InnerPanel.Margin = Margin.Five;
m_InnerPanel.SendToBack();
m_InnerPanel.MouseInputEnabled = false;
m_AutoHideBars = false;
}
示例2: Add
public static void Add(GUIControl control, Animation animation)
{
animation.m_Control = control;
if (!m_Animations.ContainsKey(control))
m_Animations[control] = new List<Animation>();
m_Animations[control].Add(animation);
}
示例3: CenterVertically
/// <summary>
/// Centers the control vertically inside its parent.
/// </summary>
/// <param name="control"></param>
public static void CenterVertically(GUIControl control)
{
GUIControl parent = control.ParentControl;
if (null == parent) return;
control.SetPosition(control.X, (parent.Height - control.Height) / 2);
}
示例4: Enable
/// <summary>
/// Enables tooltip display for the specified control.
/// </summary>
/// <param name="control">Target control.</param>
public static void Enable(GUIControl control)
{
if (null == control.ToolTip)
return;
g_ToolTip = control;
}
示例5: Disable
/// <summary>
/// Disables tooltip display for the specified control.
/// </summary>
/// <param name="control">Target control.</param>
public static void Disable(GUIControl control)
{
if (g_ToolTip == control)
{
g_ToolTip = null;
}
}
示例6: AlignLeft
/// <summary>
/// Moves the control to the left of its parent.
/// </summary>
/// <param name="control"></param>
public static void AlignLeft(GUIControl control)
{
GUIControl parent = control.ParentControl;
if (null == parent) return;
control.SetPosition(parent.Padding.Left, control.Y);
}
示例7: Cancel
public static void Cancel(GUIControl control)
{
if (m_Animations.ContainsKey(control))
{
m_Animations[control].Clear();
m_Animations.Remove(control);
}
}
示例8: RadioButtonGroup
/// <summary>
/// Initializes a new instance of the <see cref="RadioButtonGroup"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
/// <param name="label">Label for the outlining GroupBox.</param>
public RadioButtonGroup(GUIControl parent, String label)
: base(parent)
{
IsTabable = false;
KeyboardInputEnabled = true;
Text = label;
AutoSizeToContents = true;
}
示例9: CenterHorizontally
/// <summary>
/// Centers the control horizontally inside its parent.
/// </summary>
/// <param name="control"></param>
public static void CenterHorizontally(GUIControl control)
{
GUIControl parent = control.ParentControl;
if (null == parent) return;
control.SetPosition(parent.Padding.Left + (((parent.Width - parent.Padding.Left - parent.Padding.Right) - control.Width) / 2), control.Y);
}
示例10: AlignRight
/// <summary>
/// Moves the control to the right of its parent.
/// </summary>
/// <param name="control"></param>
public static void AlignRight(GUIControl control)
{
GUIControl parent = control.ParentControl;
if (null == parent) return;
control.SetPosition(parent.Width - control.Width - parent.Padding.Right, control.Y);
}
示例11: OpenMsgbox
void OpenMsgbox(GUIControl control)
{
MessageBox window = new MessageBox(GetCanvas(),
String.Format("Window {0} MessageBox window = new MessageBox(GetCanvas(), String.Format( MessageBox window = new MessageBox(GetCanvas(), String.Format(", m_WindowCount), "");
window.SetPosition(rand.Next(700), rand.Next(400));
m_WindowCount++;
}
示例12: Center
/// <summary>
/// Centers the control inside its parent.
/// </summary>
/// <param name="control">Control to center.</param>
public static void Center(GUIControl control)
{
GUIControl parent = control.ParentControl;
if (parent == null)
return;
control.SetPosition(
parent.Padding.Left + (((parent.Width - parent.Padding.Left - parent.Padding.Right) - control.Width)/2),
(parent.Height - control.Height)/2);
}
示例13: ColorChanged
void ColorChanged(GUIControl control)
{
IColorPicker picker = control as IColorPicker;
Color c = picker.SelectedColor;
HSV hsv = c.ToHSV();
String text = String.Format("Color changed: RGB: {0:X2}{1:X2}{2:X2} HSV: {3:F1} {4:F2} {5:F2}",
c.R, c.G, c.B, hsv.h, hsv.s, hsv.v);
UnitPrint(text);
}
示例14: OpenWindow
void OpenWindow(GUIControl control)
{
Control.WindowControl window = new Control.WindowControl(GetCanvas(),"",false);
window.Caption = String.Format("Window {0}", m_WindowCount);
window.SetSize(rand.Next(200, 400), rand.Next(200, 400));
window.SetPosition(rand.Next(700), rand.Next(400));
m_WindowCount++;
}
示例15: UpdateHoveredControl
private static void UpdateHoveredControl(GUIControl control, int x, int y)
{
//
// We use this global variable to represent our hovered control
// That way, if the new hovered control gets deleted in one of the
// Hover callbacks, we won't be left with a hanging pointer.
// This isn't ideal - but it's minimal.
//
m_NewHoveredControl = control;
// Nothing to change..
if (HoveredControl == m_NewHoveredControl)
return;
// We changed - tell the old hovered control that it's no longer hovered.
if (HoveredControl != null && HoveredControl != m_NewHoveredControl)
HoveredControl.DragAndDrop_HoverLeave(CurrentPackage);
// If we're hovering where the control came from, just forget it.
// By changing it to null here we're not going to show any error cursors
// it will just do nothing if you drop it.
if (m_NewHoveredControl == SourceControl)
m_NewHoveredControl = null;
// Check to see if the new potential control can accept this type of package.
// If not, ignore it and show an error cursor.
while (m_NewHoveredControl != null && !m_NewHoveredControl.DragAndDrop_CanAcceptPackage(CurrentPackage))
{
// We can't drop on this control, so lets try to drop
// onto its parent..
m_NewHoveredControl = m_NewHoveredControl.ParentControl;
// Its parents are dead. We can't drop it here.
// Show the NO WAY cursor.
if (m_NewHoveredControl == null)
{
Platform.Neutral.SetCursor(Cursors.No);
}
}
// Become out new hovered control
HoveredControl = m_NewHoveredControl;
// If we exist, tell us that we've started hovering.
if (HoveredControl != null)
{
HoveredControl.DragAndDrop_HoverEnter(CurrentPackage, x, y);
}
m_NewHoveredControl = null;
}