Subversion Repositories spk

Rev

Rev 1 | Blame | Compare with Previous | 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 "Options.h"

namespace Creator {

        enum {FORMTYPE_BASE, FORMTYPE_SINGLE, FORMTYPE_MULTI};
        /// <summary>
        /// Summary for BaseForm1
        ///
        /// 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 BaseForm : public System::Windows::Forms::Form
        {
        public:
                BaseForm(System::Windows::Forms::Form ^parent, System::Windows::Forms::TabControl ^ctrl, System::Windows::Forms::TabPage ^page, System::Windows::Forms::ToolStripMenuItem ^tool, CPackages *p, Windows::Forms::ImageList ^imagelist, SSettings *set)
                {
                        InitializeComponent();

                        m_bClosing = false;
                        m_bLoading = true;
                        m_pSettings = set;
                        m_iFormType = FORMTYPE_BASE;
                        imageList1 = imagelist;
                        m_pP = p;
                        this->MdiParent = parent;
                        m_pTabCtrl = ctrl;
                        m_pTabPage = page;

                        this->Activated += gcnew System::EventHandler(this, &BaseForm::BaseForm_Activated);

                        m_pMenuItem = tool;
                        m_pMenuItem->Click += gcnew System::EventHandler(this, &BaseForm::Event_Menu);
                }

                void CloseForm();
                bool IsClosing() { return m_bClosing; }

                void SetImageLists(Windows::Forms::ImageList ^smallList, ImageList ^largeList, ImageList ^gameList)
                {
                        imageListSmall = smallList;
                        imageListLarge = largeList;
                        imageListGames = gameList;
                }

                System::Windows::Forms::TabControl ^TabControl() { return m_pTabCtrl; }
                System::Windows::Forms::TabPage ^TabPage() { return m_pTabPage; }

                int GetFormType() { return m_iFormType; }
                virtual void Save() {}
                virtual void SaveAs() {}
                bool BaseForm::CheckFilename(System::String ^filename)
                {
                        if ( filename == m_sFilename )
                                return true;
                        return false;
                }
        protected:
                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                ~BaseForm()
                {
                        if (components)
                        {
                                delete components;
                        }
                        delete m_pMenuItem;
                }

                System::Windows::Forms::TabControl                      ^m_pTabCtrl;
                System::Windows::Forms::TabPage                         ^m_pTabPage;
                System::Windows::Forms::ToolStripMenuItem       ^m_pMenuItem;
                Windows::Forms::ImageList                                       ^imageList1;
                //System::Collections::Hashtable                                ^textList;
                CPackages                                                                       *m_pP;
                System::String                                                          ^m_sFilename;
                int                                                                                      m_iFormType;
                SSettings                                                                       *m_pSettings;
                bool    m_bLoading;
                bool    m_bClosing;
                System::Windows::Forms::ImageList                       ^imageListSmall;
                System::Windows::Forms::ImageList                       ^imageListLarge;
                System::Windows::Forms::ImageList                       ^imageListGames;
                ListViewItem ^m_pSelectedItem;

        private:
                System::Void BaseForm::BaseForm_Activated(System::Object^  sender, System::EventArgs^  e);
                System::Void Event_Menu(System::Object^  sender, System::EventArgs^  e) 
                {
                         this->Select();
                         m_pTabCtrl->SelectedTab = m_pTabPage;
                 }
                /// <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();
                        // 
                        // BaseForm
                        // 
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->ClientSize = System::Drawing::Size(284, 262);
                        this->Name = L"BaseForm";
                        this->Text = L"BaseForm1";
                        this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &BaseForm::BaseForm_FormClosed);
                        this->ResumeLayout(false);

                }
#pragma endregion
        private: System::Void BaseForm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e) {
                                 m_bClosing = true;
                                 CloseForm();
                         }
};
}