예제 #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;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeControl(Base parent)
            : base(parent)
        {
            AutoUpdateBounds = true;
            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;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeControl(ControlBase parent)
            : base(parent)
        {
            treeControl = this;

            RemoveChild(toggleButton, true);
            toggleButton = null;
            RemoveChild(title, true);
            title = null;
            RemoveChild(innerPanel, true);
            innerPanel = null;

            multiSelect = false;

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

            innerPanel = scrollControl;

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

            Dock = Pos.None;
        }
예제 #4
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 += new GwenEventHandler <EventArgs>(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);
        }
예제 #5
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);
        }