Button control.
Inheritance: Label
コード例 #1
0
ファイル: GUITests.cs プロジェクト: FloodProject/flood
        public void TestButton()
        {
            var control = new Button(canvas);
            control.Text = "Button";

            GUI.Test(control, "button1");
        }
コード例 #2
0
ファイル: GUITests.cs プロジェクト: chartly/flood
        public void TestButton()
        {
            using (var canvas = new Canvas(GUI.Skin))
            {
                var control = new Button(canvas);
                control.Text = "Button";

                GUI.AssertUnchanged(canvas, "button1");
            }
        }
コード例 #3
0
ファイル: CollapsibleCategory.cs プロジェクト: tritao/flood
        /// <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);
        }
コード例 #4
0
ファイル: Tools.cs プロジェクト: tritao/flood
        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;
        }
コード例 #5
0
ファイル: MessageBox.cs プロジェクト: tritao/flood
        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);
        }
コード例 #6
0
ファイル: TreeNode.cs プロジェクト: FloodProject/flood
        /// <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;
        }
コード例 #7
0
ファイル: GUITests.cs プロジェクト: FloodProject/flood
        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");
        }