public void TestButton() { var control = new Button(canvas); control.Text = "Button"; GUI.Test(control, "button1"); }
public void TestButton() { using (var canvas = new Canvas(GUI.Skin)) { var control = new Button(canvas); control.Text = "Button"; GUI.AssertUnchanged(canvas, "button1"); } }
/// <summary> /// Initializes a new instance of the <see cref="CollapsibleCategory"/> class. /// </summary> /// <param name="parent">Parent control.</param> public CollapsibleCategory(CollapsibleList parent) : base(parent) { m_HeaderButton = new CategoryHeaderButton(this); m_HeaderButton.Text = "Category Title"; // [omeg] todo: i18n m_HeaderButton.Dock = Pos.Top; m_HeaderButton.Height = 20; m_HeaderButton.Toggled += OnHeaderToggle; m_List = parent; Padding = new Padding(1, 0, 1, 5); SetSize(512, 512); }
public override Control CreateControl(Control parent) { var btn = new Button(parent); btn.ShouldDrawBackground = false; var iBuffer = IconManager.GetIconData(icon, IconSize.Invalid); btn.SetImage(iBuffer,true); btn.SetSize(20, 20); btn.Clicked += c => OnClicked(); return btn; }
private readonly Label m_Label; // should be rich label with maxwidth = parent #endregion Fields #region Constructors /// <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(Control 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); }
/// <summary> /// Initializes a new instance of the <see cref="TreeNode"/> class. /// </summary> /// <param name="parent">Parent control.</param> public TreeNode(Control 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.DoubleClickedLeft += OnDoubleClickName; m_Title.Clicked += OnClickName; m_InnerPanel = new Control(this); m_InnerPanel.Dock = Pos.Top; m_InnerPanel.Height = 100; m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0); m_InnerPanel.Hide(); m_Root = false; m_Selected = false; m_Selectable = true; }
public void TestStatusBar() { var control = new StatusBar(canvas) { Text = "StatusBar" }; var but = new Button(canvas) { Text = "button" }; control.AddControl(but, true); GUI.Test(control, "StatusBar1"); }