/* * Opens the Palette Editor form to modify the selected palette. */ private void editPaletteButton_Click(object sender, EventArgs e) { PaletteEditor editor = new PaletteEditor(); int selectedPaletteNumber = palettesListBox.SelectedIndex; editor.loadPalette(palettes[selectedPaletteNumber]); if (editor.ShowDialog() == DialogResult.OK) { palettes[selectedPaletteNumber] = editor.returnPalette(); } }
/* * Creates a new palette with the user's selected name to the list for selection and editing. */ private void newPaletteButton_Click(object sender, EventArgs e) { PaletteEditor editor = new PaletteEditor(); editor.loadPalette(defaultPalette); if (editor.ShowDialog() == DialogResult.OK) { InputBox nameBox = new InputBox(); nameBox.Text = "Enter Palette Name:"; string paletteName = "New Palette"; if (nameBox.ShowDialog() == DialogResult.OK) { paletteName = nameBox.inputTextBox.Text; } addPalette(paletteName, editor.returnPalette()); } }