Skip to content

Instantly share code, notes, and snippets.

@Panquesito7
Last active Feb 2, 2021
Embed
What would you like to do?
Tic Tac Toe Main-Core (C++, CLI, CLR)
#include <iostream>
#pragma once
namespace TicTacToe {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Resumen de TicTacToe
/// </summary>
public ref class TicTacToe : public System::Windows::Forms::Form
{
public:
TicTacToe(void)
{
InitializeComponent();
//
//TODO: agregar c�digo de constructor aqu�
//
}
protected:
/// <summary>
/// Limpiar los recursos que se est�n usando.
/// </summary>
~TicTacToe()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button9;
private: System::Windows::Forms::Button^ button8;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::Button^ button7;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button10;
private: System::Windows::Forms::Button^ button11;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::MenuStrip^ menuStrip1;
private: System::Windows::Forms::ToolStripMenuItem^ helpToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ aboutToolStripMenuItem;
protected:
protected:
protected:
protected:
private:
/// <summary>
/// Variable del dise�ador necesaria.
/// </summary>
System::ComponentModel::Container^ components;
#pragma region Windows Form Designer generated code
/// <summary>
/// M�todo necesario para admitir el Dise�ador. No se puede modificar
/// el contenido de este m�todo con el editor de c�digo.
/// </summary>
void InitializeComponent(void)
{
this->label1 = (gcnew System::Windows::Forms::Label());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button9 = (gcnew System::Windows::Forms::Button());
this->button8 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->button7 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button10 = (gcnew System::Windows::Forms::Button());
this->button11 = (gcnew System::Windows::Forms::Button());
this->label2 = (gcnew System::Windows::Forms::Label());
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->menuStrip1->SuspendLayout();
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label1->Location = System::Drawing::Point(59, 9);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(169, 31);
this->label1->TabIndex = 0;
this->label1->Text = L"Tic Tac Toe";
this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
this->label1->Click += gcnew System::EventHandler(this, &TicTacToe::label1_Click);
//
// button1
//
this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->button1->ForeColor = System::Drawing::SystemColors::ControlText;
this->button1->Location = System::Drawing::Point(80, 58);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(112, 30);
this->button1->TabIndex = 1;
this->button1->Text = L"Start game!";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &TicTacToe::button1_Click);
//
// button2
//
this->button2->Location = System::Drawing::Point(95, 65);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(75, 23);
this->button2->TabIndex = 8;
//
// button9
//
this->button9->Location = System::Drawing::Point(95, 65);
this->button9->Name = L"button9";
this->button9->Size = System::Drawing::Size(75, 23);
this->button9->TabIndex = 1;
//
// button8
//
this->button8->Location = System::Drawing::Point(95, 65);
this->button8->Name = L"button8";
this->button8->Size = System::Drawing::Size(75, 23);
this->button8->TabIndex = 2;
//
// button5
//
this->button5->Location = System::Drawing::Point(95, 65);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(75, 23);
this->button5->TabIndex = 5;
//
// button6
//
this->button6->Location = System::Drawing::Point(95, 65);
this->button6->Name = L"button6";
this->button6->Size = System::Drawing::Size(75, 23);
this->button6->TabIndex = 4;
//
// button7
//
this->button7->Location = System::Drawing::Point(95, 65);
this->button7->Name = L"button7";
this->button7->Size = System::Drawing::Size(75, 23);
this->button7->TabIndex = 3;
//
// button4
//
this->button4->Location = System::Drawing::Point(95, 65);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(75, 23);
this->button4->TabIndex = 6;
//
// button3
//
this->button3->Location = System::Drawing::Point(95, 65);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(75, 23);
this->button3->TabIndex = 7;
//
// button10
//
this->button10->Location = System::Drawing::Point(95, 65);
this->button10->Name = L"button10";
this->button10->Size = System::Drawing::Size(75, 23);
this->button10->TabIndex = 0;
//
// button11
//
this->button11->Location = System::Drawing::Point(95, 58);
this->button11->Name = L"button11";
this->button11->Size = System::Drawing::Size(88, 31);
this->button11->TabIndex = 9;
this->button11->UseVisualStyleBackColor = true;
this->button11->Click += gcnew System::EventHandler(this, &TicTacToe::restart_game);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->label2->Location = System::Drawing::Point(12, 161);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(11, 15);
this->label2->TabIndex = 10;
this->label2->Text = L" ";
this->label2->Click += gcnew System::EventHandler(this, &TicTacToe::label2_Click);
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->helpToolStripMenuItem });
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(284, 24);
this->menuStrip1->TabIndex = 11;
this->menuStrip1->Text = L"menuStrip1";
//
// helpToolStripMenuItem
//
this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->aboutToolStripMenuItem });
this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem";
this->helpToolStripMenuItem->Size = System::Drawing::Size(44, 20);
this->helpToolStripMenuItem->Text = L"Help";
//
// aboutToolStripMenuItem
//
this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
this->aboutToolStripMenuItem->Size = System::Drawing::Size(107, 22);
this->aboutToolStripMenuItem->Text = L"About";
this->aboutToolStripMenuItem->Click += gcnew System::EventHandler(this, &TicTacToe::aboutToolStripMenuItem_Click);
//
// TicTacToe
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 194);
this->Controls->Add(this->label2);
this->Controls->Add(this->button1);
this->Controls->Add(this->button9);
this->Controls->Add(this->button8);
this->Controls->Add(this->button7);
this->Controls->Add(this->button6);
this->Controls->Add(this->button5);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->label1);
this->Controls->Add(this->button10);
this->Controls->Add(this->button11);
this->Controls->Add(this->menuStrip1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
this->MainMenuStrip = this->menuStrip1;
this->Name = L"TicTacToe";
this->Text = L"Tic Tac Toe";
this->Load += gcnew System::EventHandler(this, &TicTacToe::TicTacToe_Load);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment