~ubuntu-branches/ubuntu/precise/xcircuit/precise

« back to all changes in this revision

Viewing changes to xccom2/colorchooser2.cs

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2006-05-22 10:08:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060522100825-mk2nt6epw2dvvfaa
Tags: 3.6.24-1
* QA Upload 
* New Upstream Version (Closes: #266080, #262321)
* Update debian/copyright
* debian/{menu, install}:
  + install pixmaps to /usr/share/pixmaps/xcircuit/
* Conforms with new Standards version 3.7.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using System.Windows.Forms;
3
 
 
4
 
namespace XCircuiTest
5
 
{
6
 
        public class ColorChooser
7
 
        {
8
 
                private static System.Drawing.Color color = System.Drawing.Color.Black;
9
 
 
10
 
                private static void OnChooseColor(object sender, EventArgs args)
11
 
                {
12
 
                        ColorDialog dlg = new ColorDialog();
13
 
                        dlg.FullOpen = true;
14
 
                        dlg.Color = color;
15
 
                        if (dlg.ShowDialog() == DialogResult.OK)
16
 
                        {
17
 
                                XCircuit.Application.AddColor(dlg.Color);
18
 
                                color = dlg.Color;
19
 
                        }
20
 
                }
21
 
 
22
 
                public static void XC_init()
23
 
                {
24
 
                        XCircuit.MenuItem item = XCircuit.MenuItem.GetMenuItem("Add New Color");
25
 
                        item.Reset();
26
 
                        item.Click += new EventHandler(OnChooseColor);
27
 
                }
28
 
        }
29
 
}