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 PalettePanel_OnSettingChanged(object sender, EventArgs e) { PalettePanel panel = (sender as PalettePanel); Setting_SwatchesPerRow = panel.SwatchesPerRow; if (panel.PaletteFileName != null) { Default_PaletteFileName = panel.PaletteFileName; } }
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); }