Beispiel #1
0
 private void UpdateScreen()
 {
     if (lbObjects.SelectedIndex >= 0)
     {
         pictureBox.Image = ZXColor.CreateUpdatedScreen((string)lbObjects.Items[lbObjects.SelectedIndex]);
     }
 }
Beispiel #2
0
 private void btnZxSplit_Click(object sender, EventArgs e)
 {
     Text = "ZXColor - working...";
     Application.DoEvents();
     ZXColor.PerformSplit(getScaleFactor());
     Text = "ZXColor";
 }
Beispiel #3
0
 private void pictureBox_MouseClick(object sender, MouseEventArgs e)
 {
     if (lbObjects.SelectedIndex >= 0)
     {
         ZXColor.ToggleCell(e.X / ZXColor.CellSize, e.Y / ZXColor.CellSize, e.Button == MouseButtons.Left, e.Button == MouseButtons.Middle, (string)lbObjects.Items[lbObjects.SelectedIndex]);
         UpdateScreen();
     }
 }
Beispiel #4
0
 private void btnDelObject_Click(object sender, EventArgs e)
 {
     if (lbObjects.SelectedIndex >= 0)
     {
         ZXColor.DeleteObject((string)lbObjects.Items[lbObjects.SelectedIndex]);
         lbObjects.Items.RemoveAt(lbObjects.SelectedIndex);
     }
 }
Beispiel #5
0
 private void btnAddObject_Click(object sender, EventArgs e)
 {
     if (!lbObjects.Items.Contains(tbEditObject.Text))
     {
         lbObjects.Items.Add(tbEditObject.Text);
         ZXColor.CreateObject(tbEditObject.Text);
     }
 }
Beispiel #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog openFileDialog = new SaveFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                ZXColor.SaveObjects(openFileDialog.FileName);
            }
        }
Beispiel #7
0
        private void btnLoadImage_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                pictureBox.Image = ZXColor.LoadAndRescaleImage(openFileDialog.FileName, getScaleFactor());
            }
        }
Beispiel #8
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                string[] items = ZXColor.LoadObjects(openFileDialog.FileName);
                lbObjects.Items.AddRange(items);
            }
        }
Beispiel #9
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     lbObjects.Items.Clear();
     ZXColor.ClearObjects();
 }