コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeControl(Base parent)
            : base(parent)
        {
            m_TreeControl = this;

            RemoveChild(m_ToggleButton, true);
            m_ToggleButton = null;
            RemoveChild(m_Title, true);
            m_Title = null;
            RemoveChild(m_InnerPanel, true);
            m_InnerPanel = null;

            m_MultiSelect = false;

            m_ScrollControl = new ScrollControl(this);
            m_ScrollControl.Dock = Pos.Fill;
            m_ScrollControl.EnableScroll(false, true);
            m_ScrollControl.AutoHideBars = true;
            m_ScrollControl.Margin = Margin.One;

            m_InnerPanel = m_ScrollControl;

            m_ScrollControl.SetInnerSize(1000, 1000); // todo: why such arbitrary numbers?

			Dock = Pos.None;
        }
コード例 #2
0
ファイル: TutorialMenu.cs プロジェクト: AreonDev/NoWayOut
        public TutorialMenu (Application application, Base parent)
        {
            this.application = application;
            this.parent = parent;

            window = new WindowControl (parent);
            window.DisableResizing();
            window.Title = Localizer.Instance.GetValueForName("tutorial");
            window.IsMoveable = false;
            window.Hide();
            window.Height = parent.Height - (int) (parent.Height * 0.35);
            window.Y = (int) (parent.Height * 0.35) - 20;
            window.Width = parent.Width - 320;
            window.X = 280;

            scrollFrame = new ScrollControl (window);
            scrollFrame.AutoHideBars = true;
            scrollFrame.EnableScroll (false, true);
            scrollFrame.Width = window.Width - 12;
            scrollFrame.Height = window.Height - 32;

            updateTutorialText(Localizer.Instance.GetValueForName("tutorial_text"));

            ValidMessages = new[] { (int) MessageId.WindowResize, (int) MessageId.UpdateLocale };
            application.MessageManager += this;
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public MultilineTextBox(Base parent)
            : base(parent)
        {
            AutoSizeToContents = false;
            SetSize(200, 20);

            MouseInputEnabled = true;
            KeyboardInputEnabled = true;

            Alignment = Pos.Left | Pos.Top;
            TextPadding = new Padding(4, 2, 4, 2);

            m_CursorPos = new Point(0, 0);
            m_CursorEnd = new Point(0, 0);
            m_SelectAll = false;

            TextColor = Color.FromArgb(255, 50, 50, 50); // TODO: From Skin

            IsTabable = false;
            AcceptTabs = true;

            m_ScrollControl = new ScrollControl(this);
            m_ScrollControl.Dock = Pos.Fill;
            m_ScrollControl.EnableScroll(true, true);
            m_ScrollControl.AutoHideBars = true;
            m_ScrollControl.Margin = Margin.One;
            m_InnerPanel = m_ScrollControl;
            m_Text.Parent = m_InnerPanel;
            m_ScrollControl.InnerPanel.BoundsChanged += ScrollChanged;

            m_TextLines.Add(String.Empty);

            // [halfofastaple] TODO Figure out where these numbers come from. See if we can remove the magic numbers.
            //	This should be as simple as 'm_ScrollControl.AutoSizeToContents = true' or 'm_ScrollControl.NoBounds()'
            m_ScrollControl.SetInnerSize(1000, 1000);

            AddAccelerator("Ctrl + C", OnCopy);
            AddAccelerator("Ctrl + X", OnCut);
            AddAccelerator("Ctrl + V", OnPaste);
            AddAccelerator("Ctrl + A", OnSelectAll);
        }