Exemplo n.º 1
0
            private void RefreshValue()
            {
                try
                {
                    m_refreshing = true;

                    object value = m_context.GetValue();
                    if (value == null)
                    {
                        Enabled = false;
                    }
                    else
                    {
                        UrhoBackend.MathVector val = value as UrhoBackend.MathVector;
                        if (val != null)
                        {
                            base.Value = val;
                        }
                        else
                        {
                            if (m_context.Descriptor.Converter.CanConvertTo(this.m_numericType))
                            {
                                base.Value = m_context.Descriptor.Converter.ConvertTo(value, m_numericType) as UrhoBackend.MathVector;
                            }
                        }
                        Enabled = !m_context.IsReadOnly;
                    }
                }
                finally
                {
                    m_refreshing = false;
                }
            }
Exemplo n.º 2
0
        private void textBox_ValueEdited(object sender, EventArgs e)
        {
            NumericTextBox textbox = (NumericTextBox)sender;

            m_component = Controls.IndexOf(textbox);
            UrhoBackend.MathVector value = Value as UrhoBackend.MathVector;
            m_editing = true;

            OnValueChanged(EventArgs.Empty);

            m_lastChange = value;
            if (!ContainsFocus && m_editing)
            {
                OnValueEdited(EventArgs.Empty);
                m_lastEdit = value;
                m_editing  = false;
            }
        }