本文整理汇总了C#中Gwen.Control.GUIControl类的典型用法代码示例。如果您正苦于以下问题:C# GUIControl类的具体用法?C# GUIControl怎么用?C# GUIControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIControl类属于Gwen.Control命名空间,在下文中一共展示了GUIControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:29,代码来源:ScrollControl.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:7,代码来源:Animation.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:11,代码来源:Align.cs
示例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;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:11,代码来源:ToolTip.cs
示例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;
}
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:11,代码来源:ToolTip.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:11,代码来源:Align.cs
示例7: Cancel
public static void Cancel(GUIControl control)
{
if (m_Animations.ContainsKey(control))
{
m_Animations[control].Clear();
m_Animations.Remove(control);
}
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:8,代码来源:Animation.cs
示例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;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:13,代码来源:RadioButtonGroup.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:12,代码来源:Align.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:12,代码来源:Align.cs
示例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++;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:8,代码来源:Window.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:13,代码来源:Align.cs
示例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);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:9,代码来源:ColorPickers.cs
示例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++;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:9,代码来源:Window.cs
示例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;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:51,代码来源:DragAndDrop.cs
示例16: PropertyRow
/// <summary>
/// Initializes a new instance of the <see cref="PropertyRow"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
/// <param name="prop">Property control associated with this row.</param>
public PropertyRow(GUIControl parent, Property.PropertyBase prop)
: base(parent)
{
PropertyRowLabel label = new PropertyRowLabel(this);
label.Dock = Pos.Left;
label.Alignment = Pos.Left | Pos.Top;
label.Margin = new Margin(2, 2, 0, 0);
m_Label = label;
m_Property = prop;
m_Property.ParentControl = this;
m_Property.Dock = Pos.Fill;
m_Property.ValueChanged += OnValueChanged;
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:19,代码来源:PropertyRow.cs
示例17: OnCheckChanged
/// <summary>
/// Handler for CheckChanged event.
/// </summary>
protected virtual void OnCheckChanged(GUIControl control)
{
if (m_CheckBox.IsChecked)
{
if (Checked != null)
Checked.Invoke(this);
}
else
{
if (UnChecked != null)
UnChecked.Invoke(this);
}
if (CheckChanged != null)
CheckChanged.Invoke(this);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:19,代码来源:LabeledCheckBox.cs
示例18: GroupBox
/// <summary>
/// Initializes a new instance of the <see cref="GroupBox"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public GroupBox(ZGE.Components.ZComponent parent)
: base(parent)
{
// Set to true, because it's likely that our
// children will want mouse input, and they
// can't get it without us..
MouseInputEnabled = true;
KeyboardInputEnabled = true;
TextPadding = new Padding(10, 0, 10, 0);
Alignment = Pos.Top | Pos.Left;
Invalidate();
m_InnerPanel = new GUIControl(this);
m_InnerPanel.Dock = Pos.Fill;
m_InnerPanel.Margin = new Margin(5, TextHeight+5, 5, 5);
//Margin = new Margin(5, 5, 5, 5);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:22,代码来源:GroupBox.cs
示例19: OnSelected
/// <summary>
/// Handler for Selected event.
/// </summary>
/// <param name="control">Event source.</param>
protected virtual void OnSelected(GUIControl control)
{
CategoryButton child = control as CategoryButton;
if (child == null) return;
if (m_List != null)
{
m_List.UnselectAll();
}
else
{
UnselectAll();
}
child.ToggleState = true;
if (Selected != null)
Selected.Invoke(this);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:23,代码来源:CollapsibleCategory.cs
示例20: MessageBox
/// <summary>
/// Initializes a new instance of the <see cref="MessageBox"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
/// <param name="text">Message to display.</param>
/// <param name="caption">Window caption.</param>
public MessageBox(GUIControl parent, String text, String caption)
: base(parent, caption, true)
{
DeleteOnClose = true;
m_Label = new Label(m_InnerPanel);
m_Label.Text = text;
m_Label.Margin = Margin.Five;
m_Label.Dock = Pos.Top;
m_Label.Alignment = Pos.Center;
m_Label.AutoSizeToContents = true;
m_Button = new Button(m_InnerPanel);
m_Button.Text = "OK"; // todo: parametrize buttons
m_Button.Clicked += CloseButtonPressed;
m_Button.Clicked += DismissedHandler;
m_Button.Margin = Margin.Five;
m_Button.SetSize(50, 20);
Align.Center(this);
}
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:27,代码来源:MessageBox.cs
注:本文中的Gwen.Control.GUIControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论