Ejemplo n.º 1
0
        private void Iterate(int delta)
        {
            int index = (IndexOf(CurrentColour, true) + delta + m_Colours.Count) % m_Colours.Count;

            CurrentColour = m_Colours[index];
            UserSelectedColour?.Invoke();
            Accessed?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        private void HandleClick(int index)
        {
            Color result;

            switch (index)
            {
            case MOREBUTTON:
                if (Globals.Root.CurrentConfig.ReadBoolean(Config.Windows_Colours))
                {
                    using (ColorDialog dlgcolour = new ColorDialog())
                    {
                        dlgcolour.AnyColor = true;
                        dlgcolour.Color    = CurrentColour;
                        if (dlgcolour.ShowDialog() != DialogResult.OK)
                        {
                            return;
                        }
                        result = dlgcolour.Color;
                    }
                }
                else
                {
                    if (m_Current.IsEmpty)
                    {
                        return;
                    }
                    result = frmMoreColours.Display(m_Current, GetAlternateColours(m_Current), false, this.FindForm());
                }
                if (!result.IsEmpty)
                {
                    CurrentColour = result;
                    UserSelectedColour?.Invoke();
                }
                break;

            case TRANSPARENTBUTTON:
                if (!AllowTransparent)
                {
                    return;
                }
                result = frmMoreColours.Display(m_Current, GetTransparentColours(m_Current), true, FindForm());
                if (!result.IsEmpty)
                {
                    CurrentColour = result;
                    UserSelectedColour?.Invoke();
                }
                break;

            default:
                if (index < 0)
                {
                    return;
                }
                else
                {
                    CurrentColour = m_Colours[index];
                    UserSelectedColour?.Invoke();
                }
                Accessed?.Invoke(this, EventArgs.Empty);
                break;
            }
        }