Ejemplo n.º 1
0
            private void OnTextFieldValueChanged(ChangeEvent <int> evt, SideChanged sideChanged)
            {
                var selectedStyle = m_SelectedElement.style;

                if (boxType == BoxType.Margin)
                {
                    switch (sideChanged)
                    {
                    case SideChanged.Left:
                        selectedStyle.marginLeft = evt.newValue;
                        break;

                    case SideChanged.Right:
                        selectedStyle.marginRight = evt.newValue;
                        break;

                    case SideChanged.Top:
                        selectedStyle.marginTop = evt.newValue;
                        break;

                    case SideChanged.Bottom:
                        selectedStyle.marginBottom = evt.newValue;
                        break;
                    }
                }
                else if (boxType == BoxType.Border)
                {
                    switch (sideChanged)
                    {
                    case SideChanged.Left:
                        selectedStyle.borderLeftWidth = evt.newValue;
                        break;

                    case SideChanged.Right:
                        selectedStyle.borderRightWidth = evt.newValue;
                        break;

                    case SideChanged.Top:
                        selectedStyle.borderTopWidth = evt.newValue;
                        break;

                    case SideChanged.Bottom:
                        selectedStyle.borderBottomWidth = evt.newValue;
                        break;
                    }
                }
                else if (boxType == BoxType.Padding)
                {
                    switch (sideChanged)
                    {
                    case SideChanged.Left:
                        selectedStyle.paddingLeft = evt.newValue;
                        break;

                    case SideChanged.Right:
                        selectedStyle.paddingRight = evt.newValue;
                        break;

                    case SideChanged.Top:
                        selectedStyle.paddingTop = evt.newValue;
                        break;

                    case SideChanged.Bottom:
                        selectedStyle.paddingBottom = evt.newValue;
                        break;
                    }
                }
            }
Ejemplo n.º 2
0
 protected void OnSideChaned()
 {
     SideChanged?.Invoke();
 }