示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(ControlBase parent)
            : base(parent)
        {
            // Make sure that the tree control has only one root node.
            if (m_TreeControl == null && parent is TreeControl)
            {
                m_TreeControl = parent as TreeControl;
                m_Root        = true;
            }
            else
            {
                m_ToggleButton          = new TreeToggleButton(this);
                m_ToggleButton.Toggled += OnToggleButtonPress;

                m_Title = new TreeNodeLabel(this);
                m_Title.DoubleClicked += OnDoubleClickName;
                m_Title.Clicked       += OnClickName;
            }

            m_InnerPanel = new Layout.VerticalLayout(this);
            m_InnerPanel.Collapse(!m_Root, false); // Root node is always expanded

            m_Selected   = false;
            m_Selectable = true;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Properties"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Properties(ControlBase parent)
            : base(parent)
        {
            m_SplitterBar          = new SplitterBar(this);
            m_SplitterBar.Width    = 3;
            m_SplitterBar.Cursor   = Cursor.SizeWE;
            m_SplitterBar.Dragged += OnSplitterMoved;
            m_SplitterBar.ShouldDrawBackground = false;

            m_LabelWidth = DefaultLabelWidth;

            m_InnerPanel = new Layout.VerticalLayout(this);
        }