Mam projekt gameTicTacToe...
Mam w nim formę nazwaną start oraz pliki start.cpp i start.h...
Mam drugą formę nazwaną play oraz pliki play.cpp i play.h...
start.cpp
Ukryta treść:
#include "start.h"
#include "play.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
gameTicTacToe::start formStart;
Application::Run(%formStart);
}
#include "play.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
gameTicTacToe::start formStart;
Application::Run(%formStart);
}
Ukryta treść:
#pragma once
#include "play.h"
namespace gameTicTacToe {
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>
/// Summary for start
/// </summary>
public ref class start : public System::Windows::Forms::Form
{
public:
start(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~start()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::GroupBox^ gbChar;
private: System::Windows::Forms::RadioButton^ rbCharO;
protected:
protected:
private: System::Windows::Forms::RadioButton^ rbCharX;
private: System::Windows::Forms::Label^ lbDesc;
private: System::Windows::Forms::Button^ btStart;
private: System::Windows::Forms::Button^ btQuit;
private: System::Windows::Forms::TextBox^ tbName;
private: System::Windows::Forms::Label^ lbName;
private: System::Windows::Forms::GroupBox^ gbWhoStarts;
private: System::Windows::Forms::RadioButton^ rbPcStart;
private: System::Windows::Forms::RadioButton^ rbIStart;
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->gbChar = (gcnew System::Windows::Forms::GroupBox());
this->rbCharO = (gcnew System::Windows::Forms::RadioButton());
this->rbCharX = (gcnew System::Windows::Forms::RadioButton());
this->lbDesc = (gcnew System::Windows::Forms::Label());
this->btStart = (gcnew System::Windows::Forms::Button());
this->btQuit = (gcnew System::Windows::Forms::Button());
this->tbName = (gcnew System::Windows::Forms::TextBox());
this->lbName = (gcnew System::Windows::Forms::Label());
this->gbWhoStarts = (gcnew System::Windows::Forms::GroupBox());
this->rbPcStart = (gcnew System::Windows::Forms::RadioButton());
this->rbIStart = (gcnew System::Windows::Forms::RadioButton());
this->gbChar->SuspendLayout();
this->gbWhoStarts->SuspendLayout();
this->SuspendLayout();
//
// gbChar
//
this->gbChar->Controls->Add(this->rbCharO);
this->gbChar->Controls->Add(this->rbCharX);
this->gbChar->Location = System::Drawing::Point(105, 140);
this->gbChar->Name = L"gbChar";
this->gbChar->Size = System::Drawing::Size(185, 47);
this->gbChar->TabIndex = 0;
this->gbChar->TabStop = false;
this->gbChar->Text = L"Wybór znaku";
//
// rbCharO
//
this->rbCharO->AutoSize = true;
this->rbCharO->Location = System::Drawing::Point(97, 19);
this->rbCharO->Name = L"rbCharO";
this->rbCharO->Size = System::Drawing::Size(33, 17);
this->rbCharO->TabIndex = 1;
this->rbCharO->Text = L"O";
this->rbCharO->UseVisualStyleBackColor = true;
//
// rbCharX
//
this->rbCharX->AutoSize = true;
this->rbCharX->Checked = true;
this->rbCharX->Location = System::Drawing::Point(27, 19);
this->rbCharX->Name = L"rbCharX";
this->rbCharX->Size = System::Drawing::Size(32, 17);
this->rbCharX->TabIndex = 0;
this->rbCharX->TabStop = true;
this->rbCharX->Text = L"X";
this->rbCharX->UseVisualStyleBackColor = true;
//
// lbDesc
//
this->lbDesc->AutoSize = true;
this->lbDesc->Font = (gcnew System::Drawing::Font(L"Verdana", 36));
this->lbDesc->Location = System::Drawing::Point(23, 11);
this->lbDesc->Name = L"lbDesc";
this->lbDesc->Size = System::Drawing::Size(356, 59);
this->lbDesc->TabIndex = 1;
this->lbDesc->Text = L"Kółko krzyżyk";
//
// btStart
//
this->btStart->Location = System::Drawing::Point(105, 257);
this->btStart->Name = L"btStart";
this->btStart->Size = System::Drawing::Size(75, 36);
this->btStart->TabIndex = 2;
this->btStart->Text = L"Start";
this->btStart->UseVisualStyleBackColor = true;
this->btStart->Click += gcnew System::EventHandler(this, &start::btStart_Click);
//
// btQuit
//
this->btQuit->Location = System::Drawing::Point(215, 257);
this->btQuit->Name = L"btQuit";
this->btQuit->Size = System::Drawing::Size(75, 36);
this->btQuit->TabIndex = 3;
this->btQuit->Text = L"Zamknij";
this->btQuit->UseVisualStyleBackColor = true;
this->btQuit->Click += gcnew System::EventHandler(this, &start::btQuit_Click);
//
// tbName
//
this->tbName->Location = System::Drawing::Point(172, 105);
this->tbName->Name = L"tbName";
this->tbName->Size = System::Drawing::Size(118, 20);
this->tbName->TabIndex = 4;
//
// lbName
//
this->lbName->AutoSize = true;
this->lbName->Location = System::Drawing::Point(106, 108);
this->lbName->Name = L"lbName";
this->lbName->Size = System::Drawing::Size(60, 13);
this->lbName->TabIndex = 5;
this->lbName->Text = L"Twoje imię:";
//
// gbWhoStarts
//
this->gbWhoStarts->Controls->Add(this->rbPcStart);
this->gbWhoStarts->Controls->Add(this->rbIStart);
this->gbWhoStarts->Location = System::Drawing::Point(105, 203);
this->gbWhoStarts->Name = L"gbWhoStarts";
this->gbWhoStarts->Size = System::Drawing::Size(185, 48);
this->gbWhoStarts->TabIndex = 6;
this->gbWhoStarts->TabStop = false;
this->gbWhoStarts->Text = L"Kto zaczyna?";
//
// rbPcStart
//
this->rbPcStart->AutoSize = true;
this->rbPcStart->Location = System::Drawing::Point(97, 19);
this->rbPcStart->Name = L"rbPcStart";
this->rbPcStart->Size = System::Drawing::Size(70, 17);
this->rbPcStart->TabIndex = 1;
this->rbPcStart->Text = L"Komputer";
this->rbPcStart->UseVisualStyleBackColor = true;
//
// rbIStart
//
this->rbIStart->AutoSize = true;
this->rbIStart->Checked = true;
this->rbIStart->Location = System::Drawing::Point(27, 19);
this->rbIStart->Name = L"rbIStart";
this->rbIStart->Size = System::Drawing::Size(36, 17);
this->rbIStart->TabIndex = 0;
this->rbIStart->TabStop = true;
this->rbIStart->Text = L"Ja";
this->rbIStart->UseVisualStyleBackColor = true;
//
// start
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(400, 400);
this->Controls->Add(this->gbWhoStarts);
this->Controls->Add(this->lbName);
this->Controls->Add(this->tbName);
this->Controls->Add(this->btQuit);
this->Controls->Add(this->btStart);
this->Controls->Add(this->lbDesc);
this->Controls->Add(this->gbChar);
this->Name = L"start";
this->Text = L"Kółko krzyżyk | Krystian Klimek, 11K2";
this->Load += gcnew System::EventHandler(this, &start::start_Load);
this->gbChar->ResumeLayout(false);
this->gbChar->PerformLayout();
this->gbWhoStarts->ResumeLayout(false);
this->gbWhoStarts->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void start_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void btQuit_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
private: System::Void btStart_Click(System::Object^ sender, System::EventArgs^ e) {
if(tbName->Text!="") {
Hide();
}
else {
MessageBox::Show(
"Wpisz swoje imię, aby kontynuować.",
"Komunikat",
MessageBoxButtons::OK);
}
}
};
}
#include "play.h"
namespace gameTicTacToe {
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>
/// Summary for start
/// </summary>
public ref class start : public System::Windows::Forms::Form
{
public:
start(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~start()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::GroupBox^ gbChar;
private: System::Windows::Forms::RadioButton^ rbCharO;
protected:
protected:
private: System::Windows::Forms::RadioButton^ rbCharX;
private: System::Windows::Forms::Label^ lbDesc;
private: System::Windows::Forms::Button^ btStart;
private: System::Windows::Forms::Button^ btQuit;
private: System::Windows::Forms::TextBox^ tbName;
private: System::Windows::Forms::Label^ lbName;
private: System::Windows::Forms::GroupBox^ gbWhoStarts;
private: System::Windows::Forms::RadioButton^ rbPcStart;
private: System::Windows::Forms::RadioButton^ rbIStart;
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->gbChar = (gcnew System::Windows::Forms::GroupBox());
this->rbCharO = (gcnew System::Windows::Forms::RadioButton());
this->rbCharX = (gcnew System::Windows::Forms::RadioButton());
this->lbDesc = (gcnew System::Windows::Forms::Label());
this->btStart = (gcnew System::Windows::Forms::Button());
this->btQuit = (gcnew System::Windows::Forms::Button());
this->tbName = (gcnew System::Windows::Forms::TextBox());
this->lbName = (gcnew System::Windows::Forms::Label());
this->gbWhoStarts = (gcnew System::Windows::Forms::GroupBox());
this->rbPcStart = (gcnew System::Windows::Forms::RadioButton());
this->rbIStart = (gcnew System::Windows::Forms::RadioButton());
this->gbChar->SuspendLayout();
this->gbWhoStarts->SuspendLayout();
this->SuspendLayout();
//
// gbChar
//
this->gbChar->Controls->Add(this->rbCharO);
this->gbChar->Controls->Add(this->rbCharX);
this->gbChar->Location = System::Drawing::Point(105, 140);
this->gbChar->Name = L"gbChar";
this->gbChar->Size = System::Drawing::Size(185, 47);
this->gbChar->TabIndex = 0;
this->gbChar->TabStop = false;
this->gbChar->Text = L"Wybór znaku";
//
// rbCharO
//
this->rbCharO->AutoSize = true;
this->rbCharO->Location = System::Drawing::Point(97, 19);
this->rbCharO->Name = L"rbCharO";
this->rbCharO->Size = System::Drawing::Size(33, 17);
this->rbCharO->TabIndex = 1;
this->rbCharO->Text = L"O";
this->rbCharO->UseVisualStyleBackColor = true;
//
// rbCharX
//
this->rbCharX->AutoSize = true;
this->rbCharX->Checked = true;
this->rbCharX->Location = System::Drawing::Point(27, 19);
this->rbCharX->Name = L"rbCharX";
this->rbCharX->Size = System::Drawing::Size(32, 17);
this->rbCharX->TabIndex = 0;
this->rbCharX->TabStop = true;
this->rbCharX->Text = L"X";
this->rbCharX->UseVisualStyleBackColor = true;
//
// lbDesc
//
this->lbDesc->AutoSize = true;
this->lbDesc->Font = (gcnew System::Drawing::Font(L"Verdana", 36));
this->lbDesc->Location = System::Drawing::Point(23, 11);
this->lbDesc->Name = L"lbDesc";
this->lbDesc->Size = System::Drawing::Size(356, 59);
this->lbDesc->TabIndex = 1;
this->lbDesc->Text = L"Kółko krzyżyk";
//
// btStart
//
this->btStart->Location = System::Drawing::Point(105, 257);
this->btStart->Name = L"btStart";
this->btStart->Size = System::Drawing::Size(75, 36);
this->btStart->TabIndex = 2;
this->btStart->Text = L"Start";
this->btStart->UseVisualStyleBackColor = true;
this->btStart->Click += gcnew System::EventHandler(this, &start::btStart_Click);
//
// btQuit
//
this->btQuit->Location = System::Drawing::Point(215, 257);
this->btQuit->Name = L"btQuit";
this->btQuit->Size = System::Drawing::Size(75, 36);
this->btQuit->TabIndex = 3;
this->btQuit->Text = L"Zamknij";
this->btQuit->UseVisualStyleBackColor = true;
this->btQuit->Click += gcnew System::EventHandler(this, &start::btQuit_Click);
//
// tbName
//
this->tbName->Location = System::Drawing::Point(172, 105);
this->tbName->Name = L"tbName";
this->tbName->Size = System::Drawing::Size(118, 20);
this->tbName->TabIndex = 4;
//
// lbName
//
this->lbName->AutoSize = true;
this->lbName->Location = System::Drawing::Point(106, 108);
this->lbName->Name = L"lbName";
this->lbName->Size = System::Drawing::Size(60, 13);
this->lbName->TabIndex = 5;
this->lbName->Text = L"Twoje imię:";
//
// gbWhoStarts
//
this->gbWhoStarts->Controls->Add(this->rbPcStart);
this->gbWhoStarts->Controls->Add(this->rbIStart);
this->gbWhoStarts->Location = System::Drawing::Point(105, 203);
this->gbWhoStarts->Name = L"gbWhoStarts";
this->gbWhoStarts->Size = System::Drawing::Size(185, 48);
this->gbWhoStarts->TabIndex = 6;
this->gbWhoStarts->TabStop = false;
this->gbWhoStarts->Text = L"Kto zaczyna?";
//
// rbPcStart
//
this->rbPcStart->AutoSize = true;
this->rbPcStart->Location = System::Drawing::Point(97, 19);
this->rbPcStart->Name = L"rbPcStart";
this->rbPcStart->Size = System::Drawing::Size(70, 17);
this->rbPcStart->TabIndex = 1;
this->rbPcStart->Text = L"Komputer";
this->rbPcStart->UseVisualStyleBackColor = true;
//
// rbIStart
//
this->rbIStart->AutoSize = true;
this->rbIStart->Checked = true;
this->rbIStart->Location = System::Drawing::Point(27, 19);
this->rbIStart->Name = L"rbIStart";
this->rbIStart->Size = System::Drawing::Size(36, 17);
this->rbIStart->TabIndex = 0;
this->rbIStart->TabStop = true;
this->rbIStart->Text = L"Ja";
this->rbIStart->UseVisualStyleBackColor = true;
//
// start
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(400, 400);
this->Controls->Add(this->gbWhoStarts);
this->Controls->Add(this->lbName);
this->Controls->Add(this->tbName);
this->Controls->Add(this->btQuit);
this->Controls->Add(this->btStart);
this->Controls->Add(this->lbDesc);
this->Controls->Add(this->gbChar);
this->Name = L"start";
this->Text = L"Kółko krzyżyk | Krystian Klimek, 11K2";
this->Load += gcnew System::EventHandler(this, &start::start_Load);
this->gbChar->ResumeLayout(false);
this->gbChar->PerformLayout();
this->gbWhoStarts->ResumeLayout(false);
this->gbWhoStarts->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void start_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void btQuit_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
private: System::Void btStart_Click(System::Object^ sender, System::EventArgs^ e) {
if(tbName->Text!="") {
Hide();
}
else {
MessageBox::Show(
"Wpisz swoje imię, aby kontynuować.",
"Komunikat",
MessageBoxButtons::OK);
}
}
};
}
Ukryta treść:
#include "play.h"
#include "start.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void MainPlay(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
gameTicTacToe::play formPlay;
Application::Run(%formPlay);
}
#include "start.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void MainPlay(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
gameTicTacToe::play formPlay;
Application::Run(%formPlay);
}
Ukryta treść:
#pragma once
#include "start.h"
namespace gameTicTacToe {
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>
/// Summary for play
/// </summary>
public ref class play : public System::Windows::Forms::Form
{
public:
play(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~play()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->SuspendLayout();
//
// play
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(400, 400);
this->Name = L"play";
this->Text = L"Kółko krzyżyk | Krystian Klimek, 11K2";
this->Load += gcnew System::EventHandler(this, &play::play_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void play_Load(System::Object^ sender, System::EventArgs^ e) {
}
};
}
#include "start.h"
namespace gameTicTacToe {
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>
/// Summary for play
/// </summary>
public ref class play : public System::Windows::Forms::Form
{
public:
play(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~play()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->SuspendLayout();
//
// play
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(400, 400);
this->Name = L"play";
this->Text = L"Kółko krzyżyk | Krystian Klimek, 11K2";
this->Load += gcnew System::EventHandler(this, &play::play_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void play_Load(System::Object^ sender, System::EventArgs^ e) {
}
};
}
Proszę o pomoc, bo nie mogę sobie z tym poradzić. Z góry dzięki