private void FillControls() { if (m_Item != null) { ClearControls(); m_bChangedByUI = false; SliderAlpha.Value = m_Item.Alpha; CPBackground.BackColor = WrapperHelpers.ParseCGColor(m_Item.BGColor); m_bChangedByUI = true; } }
private void SetColor() { if (m_Item != null && m_bChangedByUI) { Color[] colors = new Color[StackColors.Controls.Count]; for (int i = 0; i < StackColors.Controls.Count; i++) { if (StackColors.Controls[i] is Button) { Button cp = (Button)StackColors.Controls[i]; colors[i] = cp.BackColor; } } string strGrType = ComboGradientType.SelectedItem.ToString(); string strCGGradient = WrapperHelpers.ComposeCGGradient(colors, strGrType); UndoRedoManager.UndoRedoManager.Instance().Push <HistoryItem>(m_Editor.UndoAction, new HistoryItem(m_Editor.CurrentState, ((CGBaseItem)m_Item).ID)); m_bAceptExternalUpdate = false; m_Item.TextColor = strCGGradient; m_bAceptExternalUpdate = true; } }
private void FillControls() { if (m_Item != null) { ClearControls(); m_bChangedByUI = false; ToggleShadow.Checked = m_Item.ShadowEnable; if ((bool)ToggleShadow.Checked) { EnableControls(); } else { DisableControls(); } SliderShadowAlpha.Value = (int)m_Item.ShadowAlpha; SpinnerShadowBlur.Value = (decimal)m_Item.ShadowBlur; SpinnerOffsetX.Value = (decimal)m_Item.ShadowXOffset; SpinnerOffsetY.Value = (decimal)m_Item.ShadowYOffset; CPShadowColor.BackColor = WrapperHelpers.ParseCGColor(m_Item.ShadowColor); m_bChangedByUI = true; } }
private void GetColor() { //Get gradient colors string strGradientType; string strColor = m_Item.TextColor; Color[] gradientColors = WrapperHelpers.parseCGradient(strColor, out strGradientType); ComboGradientType.SelectedItem = strGradientType; if (gradientColors != null && gradientColors.Length > 0) { for (int i = 0; i < gradientColors.Length; i++) { if (i == 0) { CPColor0.BackColor = gradientColors[0]; } else { AddColorPicker(gradientColors[i]); } } } }