Ejemplo n.º 1
0
 protected void OnColorChanged(ColorChangeArgs e)
 {
     currentColor = e.NewColor;
     if (ColorChanged != null)
     {
         ColorChanged(this, e);
     }
 }
Ejemplo n.º 2
0
        void webColorsList_Click(object sender, System.EventArgs e)
        {
            Color           color = Color.FromName(webColorsList.Text);
            ColorChangeArgs ca    = new ColorChangeArgs(color, "WebTab");

            OnColorChanged(ca);
            exitLoop = true;
            Visible  = false;
        }
Ejemplo n.º 3
0
        void systemColorsList_Click(object sender, System.EventArgs e)
        {
            Color color = Color.FromName(systemColorsList.Text);

            currentColor = color;
            ColorChangeArgs ca = new ColorChangeArgs(color, "SystemTab");

            OnColorChanged(ca);
            exitLoop = true;
            Visible  = false;
        }
Ejemplo n.º 4
0
        void customColorsPage_Click(object sender, System.EventArgs e)
        {
            // Get current mouse position
            Point screenMousePos = Control.MousePosition;
            // Convert mouse position to client coordinates
            Point clientMousePos = customColorsPage.PointToClient(screenMousePos);

            if (rightButtonDown == true)
            {
                // Check if we need to show the custom color color picker dialog
                int index = -1;
                if (IsSpareColor(clientMousePos, ref index))
                {
                    CustomColorDlg dlg = new CustomColorDlg();
                    dlg.CurrentColor = customColors[index];
                    if (dlg.ShowDialog(this) == DialogResult.OK)
                    {
                        customColors[index] = dlg.CurrentColor;
                        ColorChangeArgs ca = new ColorChangeArgs(dlg.CurrentColor, "CustomTab");
                        OnColorChanged(ca);
                    }
                }
                rightButtonDown = false;
                return;
            }

            Graphics g            = customColorsPage.CreateGraphics();
            Color    clickedColor = ColorUtil.ColorFromPoint(g, clientMousePos.X, clientMousePos.Y);

            g.Dispose();

            Color color = FindCustomColor(clientMousePos);

            if (color != Color.Empty)
            {
                ColorChangeArgs ca = new ColorChangeArgs(color, "CustomTab");
                OnColorChanged(ca);
                // Hide the dropdown
                exitLoop = true;
                Visible  = false;
            }
        }
Ejemplo n.º 5
0
 void ColorChanged(object sender, ColorChangeArgs ea)
 {
     currentColor = ea.NewColor;
     InitializeColorTextBoxString(ea.NewColor, ea.SenderName);
 }