Subversion Repositories spk

Rev

Rev 36 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#pragma once

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


namespace Creator {

        /// <summary>
        /// Summary for LoadText
        ///
        /// WARNING: If you change the name of this class, you will need to change the
        ///          'Resource File Name' property for the managed resource compiler tool
        ///          associated with all .resx files this class depends on.  Otherwise,
        ///          the designers will not be able to interact properly with localized
        ///          resources associated with this form.
        /// </summary>
        public ref class LoadText : public System::Windows::Forms::Form
        {
        public:
                LoadText(CLinkList<SGameDir> *dirs, CPackages *p)
                {
                        InitializeComponent();

                        m_pCurrentDir = NULL;
                        m_pPackages = p;
                        m_lDirs = dirs;
                }

                void Start()
                {
                        if ( m_pCurrentDir ) this->label2->Text = SystemStringFromCyString(m_pCurrentDir->sDir);
                        this->backgroundWorker1->RunWorkerAsync();
                }

                void DoWork()
                {
                        if ( !m_pCurrentDir ) return;
                        m_pCurrentDir->pVfs->updateTexts(0);
                }

                void Next()
                {
                        m_pCurrentDir = m_lDirs->Next();
                        if ( m_pCurrentDir )
                                this->Start();
                        else
                                this->Close();
                }

        protected:
                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                ~LoadText()
                {
                        if (components)
                        {
                                delete components;
                        }
                }
        private: System::Windows::Forms::Label^  label1;
        protected: 
        private: System::Windows::Forms::Label^  label2;
        private: System::ComponentModel::BackgroundWorker^  backgroundWorker1;

        private:
                Collections::Hashtable  ^m_pTextList;
                CPackages       *m_pPackages;
                SGameDir        *m_pCurrentDir;
                CLinkList<SGameDir>     *m_lDirs;
                /// <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->label1 = (gcnew System::Windows::Forms::Label());
                        this->label2 = (gcnew System::Windows::Forms::Label());
                        this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
                        this->SuspendLayout();
                        // 
                        // label1
                        // 
                        this->label1->Dock = System::Windows::Forms::DockStyle::Top;
                        this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->label1->Location = System::Drawing::Point(10, 10);
                        this->label1->Name = L"label1";
                        this->label1->Size = System::Drawing::Size(231, 32);
                        this->label1->TabIndex = 0;
                        this->label1->Text = L"Loading Text";
                        this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
                        this->label1->UseWaitCursor = true;
                        // 
                        // label2
                        // 
                        this->label2->Dock = System::Windows::Forms::DockStyle::Fill;
                        this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point, 
                                static_cast<System::Byte>(0)));
                        this->label2->Location = System::Drawing::Point(10, 42);
                        this->label2->Name = L"label2";
                        this->label2->Size = System::Drawing::Size(231, 23);
                        this->label2->TabIndex = 1;
                        this->label2->TextAlign = System::Drawing::ContentAlignment::TopCenter;
                        this->label2->UseWaitCursor = true;
                        // 
                        // backgroundWorker1
                        // 
                        this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &LoadText::backgroundWorker1_DoWork);
                        this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &LoadText::backgroundWorker1_RunWorkerCompleted);
                        // 
                        // LoadText
                        // 
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->BackColor = System::Drawing::Color::Gray;
                        this->ClientSize = System::Drawing::Size(251, 75);
                        this->ControlBox = false;
                        this->Controls->Add(this->label2);
                        this->Controls->Add(this->label1);
                        this->Cursor = System::Windows::Forms::Cursors::WaitCursor;
                        this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
                        this->Name = L"LoadText";
                        this->Padding = System::Windows::Forms::Padding(10);
                        this->ShowInTaskbar = false;
                        this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
                        this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
                        this->Text = L"LoadText";
                        this->TopMost = true;
                        this->UseWaitCursor = true;
                        this->Load += gcnew System::EventHandler(this, &LoadText::LoadText_Load);
                        this->ResumeLayout(false);

                }
#pragma endregion
        private: System::Void backgroundWorker1_DoWork(System::Object^  sender, System::ComponentModel::DoWorkEventArgs^  e) {
                                 this->DoWork();
                         }
        private: System::Void LoadText_Load(System::Object^  sender, System::EventArgs^  e) {
                                 m_pCurrentDir = m_lDirs->First();
                                 this->Start();
                         }
        private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^  sender, System::ComponentModel::RunWorkerCompletedEventArgs^  e) {
                                 this->Next();
                         }
};
}