Subversion Repositories spk

Rev

Blame | Last modification | View Log | RSS feed

#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

#include "WizardBasic1.h"
#include "WizardUpdate.h"
#include "WizardRebalance.h"
#include "WizardCore1.h"

namespace Creator {

        /// <summary>
        /// Summary for WizardStartup
        /// </summary>
#ifdef DESIGNER
        public ref class WizardStartup : public System::Windows::Forms::UserControl
#else
        public ref class WizardStartup : public Creator::WizardCore1
#endif
        {
        public:
#ifdef DESIGNER
                WizardStartup(Windows::Forms::Form ^parent)
#else
                WizardStartup(Windows::Forms::Form ^parent) : WizardCore1(parent, NULL)
#endif
                {
                        InitializeComponent();

                        m_pParent = parent;
                        this->Tag = "startup";
                }

                virtual Windows::Forms::UserControl ^GetNext(CBaseFile *package) override
                {
                        if ( this->radioButton1->Checked )
                                return gcnew WizardBasic1(m_pParent, package);
                        else if ( this->radioButton2->Checked )
                                return gcnew WizardUpdate(m_pParent, package);
                        else if ( this->radioButton3->Checked )
                                return gcnew WizardRebalance(m_pParent, package);

                        return nullptr;
                }

                void DisableOption(RadioButton ^disable, RadioButton ^skip)
                {
                        if ( disable == skip ) return;
                        disable->Checked = false;
                }
                void DisableAllOptions(RadioButton ^radio) 
                {
                        this->DisableOption(this->radioButton1, radio);
                        this->DisableOption(this->radioButton2, radio);
                        this->DisableOption(this->radioButton3, radio);
                }

                void DoChecked(RadioButton ^radio, String ^text, int type)
                {
                        if ( radio->Checked ) {
                                this->DisableAllOptions(radio);
                                this->EnableDone(radio->Checked, type);
                                this->richTextBox1->Text = text;
                        }
                }

        protected:
                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                ~WizardStartup()
                {
                        if (components)
                        {
                                delete components;
                        }
                }
        private: System::Windows::Forms::Label^  label1;
        protected: 
        private: System::Windows::Forms::Label^  label2;
        private: System::Windows::Forms::GroupBox^  groupBox1;
        private: System::Windows::Forms::GroupBox^  groupBox2;
        private: System::Windows::Forms::FlowLayoutPanel^  flowLayoutPanel1;
        private: System::Windows::Forms::RichTextBox^  richTextBox1;
        private: System::Windows::Forms::GroupBox^  groupBox3;
        private: System::Windows::Forms::RadioButton^  radioButton2;
        private: System::Windows::Forms::FlowLayoutPanel^  flowLayoutPanel2;
        private: System::Windows::Forms::RadioButton^  radioButton3;
        private: System::Windows::Forms::RadioButton^  radioButton1;

        private:
                /// <summary>
                /// Required designer variable.
                /// </summary>
                //void EnableDone(bool e, int type);

                Windows::Forms::Form ^m_pParent;

                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->label1 = (gcnew System::Windows::Forms::Label());
                        this->label2 = (gcnew System::Windows::Forms::Label());
                        this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
                        this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
                        this->flowLayoutPanel1 = (gcnew System::Windows::Forms::FlowLayoutPanel());
                        this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
                        this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
                        this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
                        this->groupBox3 = (gcnew System::Windows::Forms::GroupBox());
                        this->flowLayoutPanel2 = (gcnew System::Windows::Forms::FlowLayoutPanel());
                        this->radioButton3 = (gcnew System::Windows::Forms::RadioButton());
                        this->groupBox1->SuspendLayout();
                        this->groupBox2->SuspendLayout();
                        this->flowLayoutPanel1->SuspendLayout();
                        this->groupBox3->SuspendLayout();
                        this->flowLayoutPanel2->SuspendLayout();
                        this->SuspendLayout();
                        // 
                        // label1
                        // 
                        this->label1->Dock = System::Windows::Forms::DockStyle::Top;
                        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(0, 0);
                        this->label1->Name = L"label1";
                        this->label1->Size = System::Drawing::Size(433, 105);
                        this->label1->TabIndex = 0;
                        this->label1->Text = L"Welcome to the Package Creation Wizard";
                        this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
                        // 
                        // label2
                        // 
                        this->label2->Dock = System::Windows::Forms::DockStyle::Fill;
                        this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->label2->Location = System::Drawing::Point(0, 105);
                        this->label2->Name = L"label2";
                        this->label2->Size = System::Drawing::Size(433, 154);
                        this->label2->TabIndex = 1;
                        this->label2->Text = L"Select the option below for the type of package you wish to create and the wizard" 
                                L" will guide you through the required options\r\n";
                        this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
                        // 
                        // groupBox1
                        // 
                        this->groupBox1->Controls->Add(this->flowLayoutPanel2);
                        this->groupBox1->Dock = System::Windows::Forms::DockStyle::Bottom;
                        this->groupBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->groupBox1->Location = System::Drawing::Point(0, 320);
                        this->groupBox1->Name = L"groupBox1";
                        this->groupBox1->Size = System::Drawing::Size(433, 49);
                        this->groupBox1->TabIndex = 2;
                        this->groupBox1->TabStop = false;
                        this->groupBox1->Text = L"Ship Creation";
                        // 
                        // groupBox2
                        // 
                        this->groupBox2->Controls->Add(this->flowLayoutPanel1);
                        this->groupBox2->Dock = System::Windows::Forms::DockStyle::Bottom;
                        this->groupBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->groupBox2->Location = System::Drawing::Point(0, 259);
                        this->groupBox2->Name = L"groupBox2";
                        this->groupBox2->Size = System::Drawing::Size(433, 61);
                        this->groupBox2->TabIndex = 3;
                        this->groupBox2->TabStop = false;
                        this->groupBox2->Text = L"Package Creation";
                        // 
                        // flowLayoutPanel1
                        // 
                        this->flowLayoutPanel1->Controls->Add(this->radioButton1);
                        this->flowLayoutPanel1->Controls->Add(this->radioButton2);
                        this->flowLayoutPanel1->Dock = System::Windows::Forms::DockStyle::Fill;
                        this->flowLayoutPanel1->Location = System::Drawing::Point(3, 18);
                        this->flowLayoutPanel1->Name = L"flowLayoutPanel1";
                        this->flowLayoutPanel1->Size = System::Drawing::Size(427, 40);
                        this->flowLayoutPanel1->TabIndex = 1;
                        // 
                        // radioButton1
                        // 
                        this->radioButton1->AutoSize = true;
                        this->radioButton1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->radioButton1->Location = System::Drawing::Point(3, 3);
                        this->radioButton1->Name = L"radioButton1";
                        this->radioButton1->Size = System::Drawing::Size(118, 20);
                        this->radioButton1->TabIndex = 0;
                        this->radioButton1->TabStop = true;
                        this->radioButton1->Text = L"Basic Package";
                        this->radioButton1->UseVisualStyleBackColor = true;
                        this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &WizardStartup::radioButton1_CheckedChanged);
                        // 
                        // radioButton2
                        // 
                        this->radioButton2->AutoSize = true;
                        this->radioButton2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->radioButton2->Location = System::Drawing::Point(127, 3);
                        this->radioButton2->Name = L"radioButton2";
                        this->radioButton2->Size = System::Drawing::Size(129, 20);
                        this->radioButton2->TabIndex = 1;
                        this->radioButton2->TabStop = true;
                        this->radioButton2->Text = L"Update Package";
                        this->radioButton2->UseVisualStyleBackColor = true;
                        this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &WizardStartup::radioButton2_CheckedChanged);
                        // 
                        // richTextBox1
                        // 
                        this->richTextBox1->BackColor = System::Drawing::SystemColors::Control;
                        this->richTextBox1->Dock = System::Windows::Forms::DockStyle::Fill;
                        this->richTextBox1->Location = System::Drawing::Point(10, 23);
                        this->richTextBox1->Name = L"richTextBox1";
                        this->richTextBox1->ReadOnly = true;
                        this->richTextBox1->Size = System::Drawing::Size(413, 61);
                        this->richTextBox1->TabIndex = 4;
                        this->richTextBox1->Text = L"";
                        // 
                        // groupBox3
                        // 
                        this->groupBox3->Controls->Add(this->richTextBox1);
                        this->groupBox3->Dock = System::Windows::Forms::DockStyle::Bottom;
                        this->groupBox3->Location = System::Drawing::Point(0, 369);
                        this->groupBox3->Name = L"groupBox3";
                        this->groupBox3->Padding = System::Windows::Forms::Padding(10);
                        this->groupBox3->Size = System::Drawing::Size(433, 94);
                        this->groupBox3->TabIndex = 5;
                        this->groupBox3->TabStop = false;
                        this->groupBox3->Text = L"Description";
                        // 
                        // flowLayoutPanel2
                        // 
                        this->flowLayoutPanel2->Controls->Add(this->radioButton3);
                        this->flowLayoutPanel2->Dock = System::Windows::Forms::DockStyle::Fill;
                        this->flowLayoutPanel2->Location = System::Drawing::Point(3, 18);
                        this->flowLayoutPanel2->Name = L"flowLayoutPanel2";
                        this->flowLayoutPanel2->Size = System::Drawing::Size(427, 28);
                        this->flowLayoutPanel2->TabIndex = 0;
                        // 
                        // radioButton3
                        // 
                        this->radioButton3->AutoSize = true;
                        this->radioButton3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->radioButton3->Location = System::Drawing::Point(3, 3);
                        this->radioButton3->Name = L"radioButton3";
                        this->radioButton3->Size = System::Drawing::Size(137, 20);
                        this->radioButton3->TabIndex = 1;
                        this->radioButton3->TabStop = true;
                        this->radioButton3->Text = L"Rebalance Vanilla";
                        this->radioButton3->UseVisualStyleBackColor = true;
                        this->radioButton3->CheckedChanged += gcnew System::EventHandler(this, &WizardStartup::radioButton3_CheckedChanged);
                        // 
                        // WizardStartup
                        // 
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->Controls->Add(this->label2);
                        this->Controls->Add(this->groupBox2);
                        this->Controls->Add(this->groupBox1);
                        this->Controls->Add(this->label1);
                        this->Controls->Add(this->groupBox3);
                        this->Name = L"WizardStartup";
                        this->Size = System::Drawing::Size(433, 463);
                        this->groupBox1->ResumeLayout(false);
                        this->groupBox2->ResumeLayout(false);
                        this->flowLayoutPanel1->ResumeLayout(false);
                        this->flowLayoutPanel1->PerformLayout();
                        this->groupBox3->ResumeLayout(false);
                        this->flowLayoutPanel2->ResumeLayout(false);
                        this->flowLayoutPanel2->PerformLayout();
                        this->ResumeLayout(false);

                }
#pragma endregion
        private: System::Void radioButton1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
                         this->DoChecked(cli::safe_cast<RadioButton ^>(sender), "This allows you to create a basic script package, just enough to allow it to be installed correctly, any more advanced options can be added after the wizard if you wish", TYPE_SPK);
                 }
private: System::Void radioButton2_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
                         this->DoChecked(cli::safe_cast<RadioButton ^>(sender), "This will create an update package, these are used to update an existing package, so only needs to contain the files and data that has change so the package file can be smaller, easier to download.  You will need to start the old and current version of your package, and a new update package will be created with the differences", TYPE_SPK);
                 }
private: System::Void radioButton3_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
                         this->DoChecked(cli::safe_cast<RadioButton ^>(sender), "This will create a ship file that will replace an existing ship in the game and allow you to adjust any properties that you want", TYPE_XSP);
                 }
};
}