Пример #1
0
        // public string Text
        // {
        //     get
        //     {
        //         return _label.Text;
        //     }
        //     set
        //     {
        //         _label.Text = value;
        //     }
        // }
        // public string TitleText
        // {
        //     get
        //     {
        //         return _label.Text;
        //     }
        //     set
        //     {
        //         _label.Text = value;
        //     }
        // }
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="GroupBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Notification(ControlBase parent) : base(parent)
        {
            Dock = Dock.Bottom;
            Invalidate();
            IsHidden = true;
            SetSize(200, 100);

            m_TitleBar = new ControlBase(null)
            {
                Height            = 24,
                Dock              = Dock.Top,
                Margin            = new Margin(0, 0, 0, 6),
                MouseInputEnabled = false
            };
            PrivateChildren.Add(m_TitleBar);
            _title = new Label(m_TitleBar)
            {
                Dock   = Dock.Left,
                Text   = "Notification",
                Margin = new Margin(6, 3, 0, 0),
            };
            _label = new RichLabel(this)
            {
                Dock = Dock.Fill, AutoSizeToContents = true
            };
            //Margin = new Margin(5, 5, 5, 5);
            Clicked += (o, e) =>
            {
                CloseNotification();
            };
            m_Panel.Clicked += (o, e) =>
            {
                CloseNotification();
            };
        }
Пример #2
0
 public Container(ControlBase parent) : base(parent)
 {
     m_Panel      = new ContainerPanel(null);
     m_Panel.Dock = Dock.Fill;
     PrivateChildren.Add(m_Panel);
     this.BoundsOutlineColor = Color.Cyan;
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(ControlBase parent)
            : base(parent)
        {
            m_Scroll       = new ScrollBarButton[2];
            m_ScrollOffset = 0;

            m_TabStrip = new TabStrip(null);
            m_TabStrip.StripPosition = Dock.Top;

            // Make this some special control?
            m_Scroll[0] = new ScrollBarButton(null);
            m_Scroll[0].SetDirectionLeft();
            m_Scroll[0].Clicked += ScrollPressedLeft;
            m_Scroll[0].SetSize(14, 16);

            m_Scroll[1] = new ScrollBarButton(null);
            m_Scroll[1].SetDirectionRight();
            m_Scroll[1].Clicked += ScrollPressedRight;
            m_Scroll[1].SetSize(14, 16);

            PrivateChildren.Add(m_TabStrip);
            PrivateChildren.Add(m_Scroll[0]);
            PrivateChildren.Add(m_Scroll[1]);

            IsTabable = false;
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(ControlBase parent)
            : base(parent)
        {
            //todo scrollbars currently hide borders of our owner
            m_VerticalScrollBar = new VerticalScrollBar(null)
            {
                Dock        = Dock.Right,
                NudgeAmount = 30,
            };
            m_VerticalScrollBar.BarMoved += VBarMoved;
            m_CanScrollV = true;

            m_HorizontalScrollBar = new HorizontalScrollBar(null)
            {
                Dock        = Dock.Bottom,
                NudgeAmount = 30,
            };
            m_HorizontalScrollBar.BarMoved += HBarMoved;
            m_CanScrollH = true;
            PrivateChildren.Add(m_VerticalScrollBar);
            PrivateChildren.Add(m_HorizontalScrollBar);
            m_Panel.Dock = Dock.None;
            SendChildToBack(m_Panel);
            m_Panel.AutoSizeToContents = true;
            m_AutoHideBars             = true;
            m_HorizontalScrollBar.Hide();
            m_VerticalScrollBar.Hide();
        }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public GroupBox(ControlBase parent) : base(parent)
 {
     m_Label                    = new Label(null);
     m_Label.TextPadding        = new Padding(10, 0, 10, 0);
     m_Label.Alignment          = Pos.Top | Pos.Left;
     m_Label.AutoSizeToContents = true;
     PrivateChildren.Add(m_Label);
     m_Panel.AutoSizeToContents = true;
     Invalidate();
     //Margin = new Margin(5, 5, 5, 5);
 }
Пример #6
0
 // todo: rename?
 /// <summary>
 /// Initializes a new instance of the <see cref="PropertyTable"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public PropertyTable(ControlBase parent, int StartingBarPosition = 80)
     : base(parent)
 {
     Width         = StartingBarPosition + 50;
     m_SplitterBar = new SplitterBar(null);
     m_SplitterBar.SetPosition(StartingBarPosition, 0);
     m_SplitterBar.Cursor   = Cursors.SizeWE;
     m_SplitterBar.Dragged += OnSplitterMoved;
     m_SplitterBar.ShouldDrawBackground = false;
     PrivateChildren.Add(m_SplitterBar);
     m_Panel.AutoSizeToContents = true;
 }
Пример #7
0
        /// <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(null);
            m_HeaderButton.Text               = "Category Title"; // [omeg] todo: i18n
            m_HeaderButton.Dock               = Dock.Top;
            m_HeaderButton.Toggled           += OnHeaderToggle;
            m_HeaderButton.AutoSizeToContents = true;
            PrivateChildren.Add(m_HeaderButton);
            m_HeaderButton.SendToBack();

            m_List = parent;

            AutoSizeToContents         = true;
            m_Panel.Dock               = Dock.Fill;
            m_Panel.AutoSizeToContents = true;
            this.Dock = Dock.Top;
            Margin    = new Margin(2, 2, 2, 2);
        }