Наследование: System.EventArgs
Пример #1
0
//		void ColorPanel_MouseLeave(object sender, EventArgs e)
//		{
//			Point pos = Control.MousePosition;
//			if ( !ClientRectangle.Contains(PointToClient(pos)) )
//			{
//				DrawState = DrawState.Normal;
//				Debug.WriteLine("COLOR PANEL ON MOUSE LEAVE...");
//			}
//		}

        void OnNewColor(NewColorArgs e)
        {
            currentColor = e.NewColor;
            if (NewColor != null)
            {
                NewColor(this, e);
            }
        }
Пример #2
0
        void InitializeColorTextBoxString(Color color, string sender)
        {
            bool  useTransparent = false;
            Color knownColor     = Color.Empty;
            bool  bKnownColor    = true;

            if (sender == "CustomTab" || sender == null)
            {
                bKnownColor = ColorUtil.IsKnownColor(color, ref knownColor, useTransparent);
            }
            else
            {
                knownColor = color;
            }

            if (bKnownColor)
            {
                color = knownColor;
                // update color in dropdown part
                colorTextBox.Text = color.Name;
            }
            else
            {               // Format rgb string
                string sep = ",";
                string rgb = color.R.ToString() + sep + color.G.ToString() + sep + color.B.ToString();
                colorTextBox.Text = rgb;
            }

            colorDropDown.CurrentColor   = color;
            colorTextBox.SelectionLength = 0;
            colorTextBox.SelectionStart  = colorTextBox.Text.Length + 1;

            // Fire event to whoever is listening
            if (sender != null)
            {
                NewColorArgs nca = new NewColorArgs(color);
                OnNewColor(nca);
            }
        }
Пример #3
0
 //        void ColorPanel_MouseLeave(object sender, EventArgs e)
 //        {
 //            Point pos = Control.MousePosition;
 //            if ( !ClientRectangle.Contains(PointToClient(pos)) )
 //            {
 //                DrawState = DrawState.Normal;
 //                Debug.WriteLine("COLOR PANEL ON MOUSE LEAVE...");
 //            }
 //        }
 void OnNewColor(NewColorArgs e)
 {
     currentColor = e.NewColor;
     if ( NewColor != null )
         NewColor(this, e);
 }
Пример #4
0
        void InitializeColorTextBoxString(Color color, string sender)
        {
            bool useTransparent = false;
            Color knownColor = Color.Empty;
            bool bKnownColor = true;
            if ( sender == "CustomTab" || sender == null )
                bKnownColor = ColorUtil.IsKnownColor(color, ref knownColor, useTransparent);
            else
                knownColor = color;

            if ( bKnownColor )
            {
                color = knownColor;
                // update color in dropdown part
                colorTextBox.Text = color.Name;
            }
            else
            {   // Format rgb string
                string sep = ",";
                string rgb = color.R.ToString() + sep + color.G.ToString() + sep + color.B.ToString();
                colorTextBox.Text = rgb;

            }

            colorDropDown.CurrentColor = color;
            colorTextBox.SelectionLength = 0;
            colorTextBox.SelectionStart = colorTextBox.Text.Length + 1;

            // Fire event to whoever is listening
            if ( sender != null )
            {
                NewColorArgs nca = new NewColorArgs(color);
                OnNewColor(nca);
            }
        }