private void InitControls()
		{
			palettePanel = new PalettePanel();
			LayoutHelper.Below(toolStrip).Left(this).Bottom(this).Width(palettePanel.Width).Apply(palettePanel);
			palettePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;

			palettePanel.SettingChanged += new EventHandler(PalettePanel_OnSettingChanged);
			palettePanel.SizeChanged += new EventHandler(PalettePanel_OnSizeChanged);

			this.Controls.Add(palettePanel);

			if(collection != null)
			{
				if(collection.ColorPalette != null)
					palettePanel.Set(collection.ColorPalette);
				else if(collection.Config.PaletteFileName != null)
					palettePanel.Set(collection.Config.PaletteFileName);
			}

			flowPanel = new FlowLayoutPanel();
			flowPanel.AutoScroll = true;
			flowPanel.BorderStyle = BorderStyle.FixedSingle;
			LayoutHelper.RightOf(palettePanel).Right(this).MatchTop(palettePanel).Bottom(this).Apply(flowPanel);
			flowPanel.Anchor = LayoutHelper.AnchorAll;
			this.Controls.Add(flowPanel);
		}
        private void InitPalette()
        {
            palettePanel = new PalettePanel(Setting_SwatchesPerRow);
            LayoutHelper.Below(toolStrip).Left(this).Bottom(this).Width(palettePanel.Width).Apply(palettePanel);
            palettePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;

            palettePanel.SettingChanged += new EventHandler(PalettePanel_OnSettingChanged);
            palettePanel.SizeChanged    += new EventHandler(PalettePanel_OnSizeChanged);

            this.Controls.Add(palettePanel);

            palettePanel.Set(Default_PaletteFileName);
        }
		private void Form_OnNewPalette(object sender, EventArgs e)
		{
			using(EditPaletteDialog form = new EditPaletteDialog())
			{
				form.StartPosition = FormStartPosition.Manual;
				form.Location = new Point(this.Location.X + 30, this.Location.Y + 30);
				if(form.ShowDialog() != DialogResult.OK)
					return;
				if(form.FullFilename == null)
					return;
				palettePanel.Set(form.FullFilename);
				if(collection != null)
				{
					collection.UpdatePaletteOption(palettePanel.ColorPalette, palettePanel.PaletteFileName);
				}
			}
		}