Esempio n. 1
0
        void OutputPictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            var x = (int)Math.Round((e.Location.X - UtilLeft) / CellWidth);
            var y = (int)Math.Round((e.Location.Y - UtilTop) / CellHeight);

            _vm.PickAt(x, y);
            using (var g = OutputPictureBox.CreateGraphics()) Render(g);
        }
Esempio n. 2
0
        internal View(ViewModel vm)
        {
            _vm = vm;
            InitializeComponent();

            OutputPictureBox.Paint     += OutputPictureBox_Paint;
            OutputPictureBox.MouseDown += OutputPictureBox_MouseDown;
            Resize += (s, e) => OutputPictureBox.Invalidate();
        }
Esempio n. 3
0
 private void ResetButton_Click(object sender, EventArgs e)
 {
     _vm.Reset();
     OutputPictureBox.Invalidate();
 }
Esempio n. 4
0
 private void IterateButton_Click(object sender, EventArgs e)
 {
     _vm.Iterate();
     OutputPictureBox.Invalidate();
 }
Esempio n. 5
0
 private void RunButton_Click(object sender, EventArgs e)
 {
     _vm.Complete();
     OutputPictureBox.Invalidate();
 }