/// <summary>
        /// Adds a new property row.
        /// </summary>
        /// <param name="label">Property name.</param>
        /// <param name="prop">Property control.</param>
        /// <param name="value">Initial value.</param>
        /// <returns>Newly created row.</returns>
        public PropertyRow Add(string label, Property.PropertyBase prop, string value = "")
        {
            PropertyRow row = new PropertyRow(this, prop);

            row.Dock          = Pos.Top;
            row.Label         = label;
            row.ValueChanged += OnRowValueChanged;

            prop.SetValue(value, true);

            m_SplitterBar.BringToFront();
            return(row);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyRow"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        /// <param name="prop">Property control associated with this row.</param>
        public PropertyRow(ControlBase parent, Property.PropertyBase prop)
            : base(parent)
        {
            PropertyRowLabel label = new PropertyRowLabel(this);

            label.Dock      = Pos.Left;
            label.Alignment = Pos.Left | Pos.Top;
            label.Margin    = new Margin(2, 2, 0, 0);
            m_Label         = label;

            m_Property               = prop;
            m_Property.Parent        = this;
            m_Property.Dock          = Pos.Fill;
            m_Property.ValueChanged += OnValueChanged;
        }