本文整理汇总了C#中Gwen.Control.Base类的典型用法代码示例。如果您正苦于以下问题:C# Base类的具体用法?C# Base怎么用?C# Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Base类属于Gwen.Control命名空间,在下文中一共展示了Base类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckBox
/// <summary>
/// Initializes a new instance of the <see cref="CheckBox"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public CheckBox(Base parent)
: base(parent)
{
SetSize(15, 15);
//m_Checked = true; // [omeg] why?!
//Toggle();
}
示例2: ColorSlider
/// <summary>
/// Initializes a new instance of the <see cref="ColorSlider"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public ColorSlider(Base parent)
: base(parent)
{
SetSize(32, 128);
MouseInputEnabled = true;
m_Depressed = false;
}
示例3: TabControl
/// <summary>
/// Initializes a new instance of the <see cref="TabControl"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public TabControl(Base parent)
: base(parent)
{
m_Scroll = new ScrollBarButton[2];
m_ScrollOffset = 0;
m_TabStrip = new TabStrip(this);
m_TabStrip.StripPosition = Pos.Top;
// Make this some special control?
m_Scroll[0] = new ScrollBarButton(this);
m_Scroll[0].SetDirectionLeft();
m_Scroll[0].Clicked += ScrollPressedLeft;
m_Scroll[0].SetSize(14, 16);
m_Scroll[1] = new ScrollBarButton(this);
m_Scroll[1].SetDirectionRight();
m_Scroll[1].Clicked += ScrollPressedRight;
m_Scroll[1].SetSize(14, 16);
m_InnerPanel = new TabControlInner(this);
m_InnerPanel.Dock = Pos.Fill;
m_InnerPanel.SendToBack();
IsTabable = false;
}
示例4: Enable
/// <summary>
/// Enables tooltip display for the specified control.
/// </summary>
/// <param name="control">Target control.</param>
public static void Enable(Base control)
{
if (null == control.ToolTip)
return;
g_ToolTip = control;
}
示例5: Initialize
public void Initialize()
{
WindowControl rightpanel = new WindowControl(MainCanvas.Instance);
rightpanel.Dock = Gwen.Pos.Right;
rightpanel.Width = (GraphicsManager.WindowWidth / 2) - 20;
rightpanel.IsClosable = false;
rightpanel.DisableResizing();
Base dummy = new Base(MainCanvas.Instance);
dummy.Dock = Gwen.Pos.Fill;
bottompanel = new WindowControl(dummy);
bottompanel.Dock = Gwen.Pos.Bottom;
bottompanel.Height = (GraphicsManager.WindowHeight / 2) - 20;
bottompanel.IsClosable = false;
bottompanel.DisableResizing();
Gameview = new Camera3D();
Gameview.Layer = 1;
Gameview.FieldOfView = 60;
Gameview.EnableViewport(10, 10, GraphicsManager.WindowWidth / 2, GraphicsManager.WindowHeight / 2);
Gameview.OnRender += GameRender;
if (GameInfo.Me.IsServer) {
ScriptManager.Initialize();
foreach (var p in GameInfo.Players.Values){
InitializePlayer(p);
}
}
}
示例6: OpenMsgbox
void OpenMsgbox(Base control, EventArgs args)
{
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++;
}
示例7: TreeNode
/// <summary>
/// Initializes a new instance of the <see cref="TreeNode"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public TreeNode(Base parent)
: base(parent)
{
m_ToggleButton = new TreeToggleButton(this);
m_ToggleButton.SetBounds(0, 0, 15, 15);
m_ToggleButton.Toggled += OnToggleButtonPress;
m_Title = new TreeNodeLabel(this);
m_Title.Dock = Pos.Top;
m_Title.Margin = new Margin(16, 0, 0, 0);
m_Title.DoubleClicked += OnDoubleClickName;
m_Title.Clicked += OnClickName;
m_InnerPanel = new Base(this);
m_InnerPanel.Dock = Pos.Top;
m_InnerPanel.Height = 100;
m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
m_InnerPanel.Hide();
IsRoot = parent is TreeControl;
m_Selected = false;
IsSelectable = true;
Dock = Pos.Top;
}
示例8: RadioButton
public RadioButton(Base parent)
: base(parent)
{
Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this, "Sample radio group");
rbg.SetPosition(10, 10);
rbg.AddOption("Option 1");
rbg.AddOption("Option 2");
rbg.AddOption("Option 3");
rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
//rbg.SizeToContents(); // it's auto
rbg.SelectionChanged += OnChange;
Control.LabeledRadioButton rb1 = new LabeledRadioButton(this);
rb1.Text = "Option 1";
rb1.SetPosition(300, 10);
Control.LabeledRadioButton rb2 = new LabeledRadioButton(this);
rb2.Text = "Option 2222222222222222222222222222222222";
rb2.SetPosition(300, 30);
Control.LabeledRadioButton rb3 = new LabeledRadioButton(this);
rb3.Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631";
rb3.SetPosition(300, 50);
//this.DrawDebugOutlines = true;
}
示例9: ImagePanel
public ImagePanel(Base parent)
: base(parent)
{
/* Normal */
{
Control.ImagePanel img = new Control.ImagePanel(this);
img.ImageName = "gwen.png";
img.SetPosition(10, 10);
img.SetSize(100, 100);
}
/* Missing */
{
Control.ImagePanel img = new Control.ImagePanel(this);
img.ImageName = "missingimage.png";
img.SetPosition(120, 10);
img.SetSize(100, 100);
}
/* Clicked */
{
Control.ImagePanel img = new Control.ImagePanel(this);
img.ImageName = "gwen.png";
img.SetPosition(10, 120);
img.SetSize(100, 100);
img.Clicked += Image_Clicked;
}
}
示例10: OnMouseButton
public static bool OnMouseButton(Base hoveredControl, int x, int y, bool down)
{
if (!down)
{
m_LastPressedControl = null;
// Not carrying anything, allow normal actions
if (CurrentPackage == null)
return false;
// We were carrying something, drop it.
OnDrop(x, y);
return true;
}
if (hoveredControl == null)
return false;
if (!hoveredControl.DragAndDrop_Draggable())
return false;
// Store the last clicked on control. Don't do anything yet,
// we'll check it in OnMouseMoved, and if it moves further than
// x pixels with the mouse down, we'll start to drag.
m_LastPressedPos = new Point(x, y);
m_LastPressedControl = hoveredControl;
return false;
}
示例11: OnMouseMoved
public static void OnMouseMoved(Base hoveredControl, int x, int y)
{
// Always keep these up to date, they're used to draw the dragged control.
m_MouseX = x;
m_MouseY = y;
// If we're not carrying anything, then check to see if we should
// pick up from a control that we're holding down. If not, then forget it.
if (CurrentPackage == null && !ShouldStartDraggingControl(x, y))
return;
// Swap to this new hovered control and notify them of the change.
UpdateHoveredControl(hoveredControl, x, y);
if (HoveredControl == null)
return;
// Update the hovered control every mouse move, so it can show where
// the dropped control will land etc..
HoveredControl.DragAndDrop_Hover(CurrentPackage, x, y);
// Override the cursor - since it might have been set my underlying controls
// Ideally this would show the 'being dragged' control. TODO
Platform.Neutral.SetCursor(Cursors.Default);
hoveredControl.Redraw();
}
示例12: TextBox
/// <summary>
/// Initializes a new instance of the <see cref="TextBox"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public TextBox(Base parent)
: base(parent)
{
AutoSizeToContents = false;
SetSize(200, 20);
MouseInputEnabled = true;
KeyboardInputEnabled = true;
Alignment = Pos.Left | Pos.CenterV;
TextPadding = new Padding(4, 2, 4, 2);
m_CursorPos = 0;
m_CursorEnd = 0;
m_SelectAll = false;
TextColor = Color.FromArgb(255, 50, 50, 50); // TODO: From Skin
IsTabable = true;
AddAccelerator("Ctrl + C", OnCopy);
AddAccelerator("Ctrl + X", OnCut);
AddAccelerator("Ctrl + V", OnPaste);
AddAccelerator("Ctrl + A", OnSelectAll);
}
示例13: CrossSplitter
private int m_ZoomedSection; // 0-3
#endregion Fields
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="CrossSplitter"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public CrossSplitter(Base parent)
: base(parent)
{
m_Sections = new Base[4];
m_VSplitter = new SplitterBar(this);
m_VSplitter.SetPosition(0, 128);
m_VSplitter.Dragged += OnVerticalMoved;
m_VSplitter.Cursor = Cursors.SizeNS;
m_HSplitter = new SplitterBar(this);
m_HSplitter.SetPosition(128, 0);
m_HSplitter.Dragged += OnHorizontalMoved;
m_HSplitter.Cursor = Cursors.SizeWE;
m_CSplitter = new SplitterBar(this);
m_CSplitter.SetPosition(128, 128);
m_CSplitter.Dragged += OnCenterMoved;
m_CSplitter.Cursor = Cursors.SizeAll;
m_HVal = 0.5f;
m_VVal = 0.5f;
SetPanel(0, null);
SetPanel(1, null);
SetPanel(2, null);
SetPanel(3, null);
SplitterSize = 5;
SplittersVisible = false;
m_ZoomedSection = -1;
}
示例14: MenuStrip
/// <summary>
/// Initializes a new instance of the <see cref="MenuStrip"/> class.
/// </summary>
/// <param name="parent">Parent control.</param>
public MenuStrip(Base parent)
: base(parent)
{
SetBounds(0, 0, 200, 22);
Dock = Pos.Top;
m_InnerPanel.Padding = new Padding(5, 0, 0, 0);
}
示例15: Add
public static void Add(Base control, Animation animation)
{
animation.m_Control = control;
if (!m_Animations.ContainsKey(control))
m_Animations[control] = new List<Animation>();
m_Animations[control].Add(animation);
}