public DrawVertexButton(int width, int height, int positionX, int positionY, InputCountVertexForm inputCountForm
                                , MatrixGraph matrixGraph, StartForm.StartForm startForm, string buttonText = "Create vertexes")
        {
            ForeColor = Color.Black;

            this.BackColor = Color.Orange;

            Font = new System.Drawing.Font("Comic Sans MS", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            this.Text = buttonText;

            this.Size = new System.Drawing.Size(width, height);

            this.Location = new System.Drawing.Point(positionX, positionY);

            this.inputCountForm = inputCountForm;

            this.matrixGraph = matrixGraph;

            vertexDraws = new List <VertexDraw>();

            edgeDraws = new List <EdgeDraw>();

            initialGraph = new InitialGraph(vertexDraws, edgeDraws, matrixGraph);

            matrix = new List <List <CellBox> >();

            Click += new EventHandler(ButtonClick);

            this.startForm = startForm;
        }
Ejemplo n.º 2
0
        public void ButtonClick(object sender, EventArgs e)
        {
            inputCountVertexForm = new InputCountVertexForm(startForm);

            startForm.Hide();

            inputCountVertexForm.ShowDialog();

            startForm.Close();
        }
        public BackToMenuFromInputButton(MatrixGraph matrixGraph,
                                         InputCountVertexForm inputCountVertexForm, string buttonText = "Menu") : base(buttonText)
        {
            ForeColor = Color.Black;

            this.BackColor = Color.Orange;

            Font = new System.Drawing.Font("Comic Sans MS", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

            FlatStyle = System.Windows.Forms.FlatStyle.Popup;

            Text = buttonText;

            Location = new System.Drawing.Point(10, 410);

            this.inputCountVertexForm = inputCountVertexForm;

            this.matrixGraph = matrixGraph;
        }
        public void ButtonClick(object sender, EventArgs e)
        {
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                loadGraph = deserializeGraph.LoadGraph(ofd.FileName);

                matrix = converter.ConvertToListListCellBox(loadGraph);

                adjacencyList = converter.ConvertToAdjacencyList(matrix);

                DrawingLoadedEdges(matrix);
                DrawingLoadedVertexs(matrix);

                inputCountVertexForm = new InputCountVertexForm(startForm);

                drawForm = new StartForm.DrawForm(vertexDraws, edgeDraws, matrix, startForm, inputCountVertexForm, matrixGraph, adjacencyList);

                startForm.Hide();

                drawForm.ShowDialog();

                startForm.Close();
            }
        }