Example #1
0
        public bool DoneEditing(ToolboxForm toolbox)
        {
            if (!_boardControl.EditingMode)
                return false;

            var filename = _saveBoard();
            if (filename == null)
            {
                MessageBox.Show("You must save your Board before continuing!", "!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return false;
            }

            _currentBoard = BoardIO.ReadFile(filename);
            _refreshControls();

            Menu.MenuItems["boardMenu"].Enabled = true;
            Menu.MenuItems["solveMenu"].Enabled = true;

            _boardControl.Toolbox = null;
            _boardControl.EditingMode = false;

            if (!toolbox.IsDisposed)
                toolbox.Close();

            return true;
        }
Example #2
0
        private void _createBoard(object s, EventArgs e)
        {
            var createDlg = new CreateDialog();
            createDlg.ShowDialog();

            if (createDlg.Board == null)
                return;

            var toolbox = new ToolboxForm(this);
            toolbox.Location = new Point(Location.X + Width, Location.Y);
            toolbox.Show();

            _currentBoard = createDlg.Board;
            _refreshControls();
            InfoBox.Instance.StopTimer();

            Menu.MenuItems["boardMenu"].Enabled = false;
            Menu.MenuItems["solveMenu"].Enabled = false;
            _boardControl.Toolbox = toolbox;
            _boardControl.EditingMode = true;
        }
Example #3
0
        private void _editBoard(object s, EventArgs e)
        {
            var toolbox = new ToolboxForm(this);
            toolbox.Location = new Point(Location.X + Width, Location.Y);
            toolbox.Show();

            _refreshControls();
            InfoBox.Instance.StopTimer();

            Menu.MenuItems["boardMenu"].Enabled = false;
            Menu.MenuItems["solveMenu"].Enabled = false;
            _boardControl.Toolbox = toolbox;
            _boardControl.EditingMode = true;
        }