Exemplo n.º 1
0
 private void InitializeComponent()
 {
     this.paletteTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorPaletteTab"));
     this.commonTabPage  = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorStandardTab"));
     this.systemTabPage  = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorSystemTab"));
     base.AccessibleName = System.Drawing.Design.SR.GetString("ColorEditorAccName");
     this.tabControl     = new ColorEditorTabControl();
     this.tabControl.TabPages.Add(this.paletteTabPage);
     this.tabControl.TabPages.Add(this.commonTabPage);
     this.tabControl.TabPages.Add(this.systemTabPage);
     this.tabControl.TabStop               = false;
     this.tabControl.SelectedTab           = this.systemTabPage;
     this.tabControl.SelectedIndexChanged += new EventHandler(this.OnTabControlSelChange);
     this.tabControl.Dock         = DockStyle.Fill;
     this.tabControl.Resize      += new EventHandler(this.OnTabControlResize);
     this.lbSystem                = new ColorEditorListBox();
     this.lbSystem.DrawMode       = DrawMode.OwnerDrawFixed;
     this.lbSystem.BorderStyle    = BorderStyle.FixedSingle;
     this.lbSystem.IntegralHeight = false;
     this.lbSystem.Sorted         = false;
     this.lbSystem.Click         += new EventHandler(this.OnListClick);
     this.lbSystem.DrawItem      += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbSystem.KeyDown       += new KeyEventHandler(this.OnListKeyDown);
     this.lbSystem.Dock           = DockStyle.Fill;
     this.lbSystem.FontChanged   += new EventHandler(this.OnFontChanged);
     this.lbCommon                = new ColorEditorListBox();
     this.lbCommon.DrawMode       = DrawMode.OwnerDrawFixed;
     this.lbCommon.BorderStyle    = BorderStyle.FixedSingle;
     this.lbCommon.IntegralHeight = false;
     this.lbCommon.Sorted         = false;
     this.lbCommon.Click         += new EventHandler(this.OnListClick);
     this.lbCommon.DrawItem      += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbCommon.KeyDown       += new KeyEventHandler(this.OnListKeyDown);
     this.lbCommon.Dock           = DockStyle.Fill;
     Array.Sort(this.ColorValues, new ColorEditor.StandardColorComparer());
     Array.Sort(this.SystemColorValues, new ColorEditor.SystemColorComparer());
     this.lbCommon.Items.Clear();
     foreach (object obj2 in this.ColorValues)
     {
         this.lbCommon.Items.Add(obj2);
     }
     this.lbSystem.Items.Clear();
     foreach (object obj3 in this.SystemColorValues)
     {
         this.lbSystem.Items.Add(obj3);
     }
     this.pal         = new ColorEditor.ColorPalette(this, this.CustomColors);
     this.pal.Picked += new EventHandler(this.OnPalettePick);
     this.paletteTabPage.Controls.Add(this.pal);
     this.systemTabPage.Controls.Add(this.lbSystem);
     this.commonTabPage.Controls.Add(this.lbCommon);
     base.Controls.Add(this.tabControl);
 }
 private void InitializeComponent()
 {
     this.paletteTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorPaletteTab"));
     this.commonTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorStandardTab"));
     this.systemTabPage = new TabPage(System.Drawing.Design.SR.GetString("ColorEditorSystemTab"));
     base.AccessibleName = System.Drawing.Design.SR.GetString("ColorEditorAccName");
     this.tabControl = new ColorEditorTabControl();
     this.tabControl.TabPages.Add(this.paletteTabPage);
     this.tabControl.TabPages.Add(this.commonTabPage);
     this.tabControl.TabPages.Add(this.systemTabPage);
     this.tabControl.TabStop = false;
     this.tabControl.SelectedTab = this.systemTabPage;
     this.tabControl.SelectedIndexChanged += new EventHandler(this.OnTabControlSelChange);
     this.tabControl.Dock = DockStyle.Fill;
     this.tabControl.Resize += new EventHandler(this.OnTabControlResize);
     this.lbSystem = new ColorEditorListBox();
     this.lbSystem.DrawMode = DrawMode.OwnerDrawFixed;
     this.lbSystem.BorderStyle = BorderStyle.FixedSingle;
     this.lbSystem.IntegralHeight = false;
     this.lbSystem.Sorted = false;
     this.lbSystem.Click += new EventHandler(this.OnListClick);
     this.lbSystem.DrawItem += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbSystem.KeyDown += new KeyEventHandler(this.OnListKeyDown);
     this.lbSystem.Dock = DockStyle.Fill;
     this.lbSystem.FontChanged += new EventHandler(this.OnFontChanged);
     this.lbCommon = new ColorEditorListBox();
     this.lbCommon.DrawMode = DrawMode.OwnerDrawFixed;
     this.lbCommon.BorderStyle = BorderStyle.FixedSingle;
     this.lbCommon.IntegralHeight = false;
     this.lbCommon.Sorted = false;
     this.lbCommon.Click += new EventHandler(this.OnListClick);
     this.lbCommon.DrawItem += new DrawItemEventHandler(this.OnListDrawItem);
     this.lbCommon.KeyDown += new KeyEventHandler(this.OnListKeyDown);
     this.lbCommon.Dock = DockStyle.Fill;
     Array.Sort(this.ColorValues, new ColorEditor.StandardColorComparer());
     Array.Sort(this.SystemColorValues, new ColorEditor.SystemColorComparer());
     this.lbCommon.Items.Clear();
     foreach (object obj2 in this.ColorValues)
     {
         this.lbCommon.Items.Add(obj2);
     }
     this.lbSystem.Items.Clear();
     foreach (object obj3 in this.SystemColorValues)
     {
         this.lbSystem.Items.Add(obj3);
     }
     this.pal = new ColorEditor.ColorPalette(this, this.CustomColors);
     this.pal.Picked += new EventHandler(this.OnPalettePick);
     this.paletteTabPage.Controls.Add(this.pal);
     this.systemTabPage.Controls.Add(this.lbSystem);
     this.commonTabPage.Controls.Add(this.lbCommon);
     base.Controls.Add(this.tabControl);
 }
Exemplo n.º 3
0
 private void OnPalettePick(object sender, EventArgs e)
 {
     ColorEditor.ColorPalette palette = (ColorEditor.ColorPalette)sender;
     this.value = this.GetBestColor(palette.SelectedColor);
     this.edSvc.CloseDropDown();
 }