Exemplo n.º 1
0
        public ToolboxForm(MainForm mainForm)
        {
            _mainForm = mainForm;
            InitializeComponent();

            _block = new Button();
            BlockPanel.Controls.Add(_block);

            CBOrientation.Items.Add("Horizontal");
            CBOrientation.Items.Add("Vertical");
            CBOrientation.SelectedIndex = 0;

            CBSize.Items.Add(2);
            CBSize.Items.Add(3);
            CBSize.SelectedIndex = 0;

            if (CBOrientation.SelectedIndex == 0)
                Orientation = Orientation.Horizontal;
            else
                Orientation = Orientation.Vertical;

            if (CBSize.SelectedIndex == 0)
                Length = 2;
            else
                Length = 3;

            _updateBlock();
        }
Exemplo n.º 2
0
        public BoardControl(MainForm mainForm, Board board)
        {
            _mainForm = mainForm;
            _board = board;
            Width = Board.BOX_SQUARE_SIZE * _board.Width + 1;
            Height = Board.BOX_SQUARE_SIZE * _board.Height + 1;

            InitializeComponent();
            Paint += new PaintEventHandler(_paint);
            _boardControlInit();

            EditingMode = false;

            MouseClick += new MouseEventHandler(_mouseClick);
        }