| 1 | cycrow | 1 | #pragma once
 | 
        
           |  |  | 2 |   | 
        
           |  |  | 3 | using namespace System;
 | 
        
           |  |  | 4 | using namespace System::ComponentModel;
 | 
        
           |  |  | 5 | using namespace System::Collections;
 | 
        
           |  |  | 6 | using namespace System::Windows::Forms;
 | 
        
           |  |  | 7 | using namespace System::Data;
 | 
        
           |  |  | 8 | using namespace System::Drawing;
 | 
        
           |  |  | 9 |   | 
        
           |  |  | 10 | #include "Options.h"
 | 
        
           |  |  | 11 |   | 
        
           |  |  | 12 | namespace Creator {
 | 
        
           |  |  | 13 |   | 
        
           |  |  | 14 | 	enum {FORMTYPE_BASE, FORMTYPE_SINGLE, FORMTYPE_MULTI};
 | 
        
           |  |  | 15 | 	/// <summary>
 | 
        
           |  |  | 16 | 	/// Summary for BaseForm1
 | 
        
           |  |  | 17 | 	///
 | 
        
           |  |  | 18 | 	/// WARNING: If you change the name of this class, you will need to change the
 | 
        
           |  |  | 19 | 	///          'Resource File Name' property for the managed resource compiler tool
 | 
        
           |  |  | 20 | 	///          associated with all .resx files this class depends on.  Otherwise,
 | 
        
           |  |  | 21 | 	///          the designers will not be able to interact properly with localized
 | 
        
           |  |  | 22 | 	///          resources associated with this form.
 | 
        
           |  |  | 23 | 	/// </summary>
 | 
        
           |  |  | 24 | 	public ref class BaseForm : public System::Windows::Forms::Form
 | 
        
           |  |  | 25 | 	{
 | 
        
           |  |  | 26 | 	public:
 | 
        
           |  |  | 27 | 		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, Collections::Hashtable ^hash, SSettings *set)
 | 
        
           |  |  | 28 | 		{
 | 
        
           |  |  | 29 | 			InitializeComponent();
 | 
        
           |  |  | 30 |   | 
        
           |  |  | 31 | 			m_bClosing = false;
 | 
        
           |  |  | 32 | 			m_bLoading = true;
 | 
        
           |  |  | 33 | 			m_pSettings = set;
 | 
        
           |  |  | 34 | 			m_iFormType = FORMTYPE_BASE;
 | 
        
           |  |  | 35 | 			textList = hash;
 | 
        
           |  |  | 36 | 			imageList1 = imagelist;
 | 
        
           |  |  | 37 | 			m_pP = p;
 | 
        
           |  |  | 38 | 			this->MdiParent = parent;
 | 
        
           |  |  | 39 | 			m_pTabCtrl = ctrl;
 | 
        
           |  |  | 40 | 			m_pTabPage = page;
 | 
        
           |  |  | 41 |   | 
        
           |  |  | 42 | 			this->Activated += gcnew System::EventHandler(this, &BaseForm::BaseForm_Activated);
 | 
        
           |  |  | 43 |   | 
        
           |  |  | 44 | 			m_pMenuItem = tool;
 | 
        
           |  |  | 45 | 			m_pMenuItem->Click += gcnew System::EventHandler(this, &BaseForm::Event_Menu);
 | 
        
           |  |  | 46 | 		}
 | 
        
           |  |  | 47 |   | 
        
           |  |  | 48 | 		void CloseForm();
 | 
        
           |  |  | 49 | 		bool IsClosing() { return m_bClosing; }
 | 
        
           |  |  | 50 |   | 
        
           |  |  | 51 | 		void SetImageLists(Windows::Forms::ImageList ^smallList, ImageList ^largeList, ImageList ^gameList)
 | 
        
           |  |  | 52 | 		{
 | 
        
           |  |  | 53 | 			imageListSmall = smallList;
 | 
        
           |  |  | 54 | 			imageListLarge = largeList;
 | 
        
           |  |  | 55 | 			imageListGames = gameList;
 | 
        
           |  |  | 56 | 		}
 | 
        
           |  |  | 57 |   | 
        
           |  |  | 58 | 		System::Windows::Forms::TabControl ^TabControl() { return m_pTabCtrl; }
 | 
        
           |  |  | 59 | 		System::Windows::Forms::TabPage ^TabPage() { return m_pTabPage; }
 | 
        
           |  |  | 60 |   | 
        
           |  |  | 61 | 		int GetFormType() { return m_iFormType; }
 | 
        
           |  |  | 62 | 		virtual void Save() {}
 | 
        
           |  |  | 63 | 		virtual void SaveAs() {}
 | 
        
           |  |  | 64 | 		bool BaseForm::CheckFilename(System::String ^filename)
 | 
        
           |  |  | 65 | 		{
 | 
        
           |  |  | 66 | 			if ( filename == m_sFilename )
 | 
        
           |  |  | 67 | 				return true;
 | 
        
           |  |  | 68 | 			return false;
 | 
        
           |  |  | 69 | 		}
 | 
        
           |  |  | 70 | 	protected:
 | 
        
           |  |  | 71 | 		/// <summary>
 | 
        
           |  |  | 72 | 		/// Clean up any resources being used.
 | 
        
           |  |  | 73 | 		/// </summary>
 | 
        
           |  |  | 74 | 		~BaseForm()
 | 
        
           |  |  | 75 | 		{
 | 
        
           |  |  | 76 | 			if (components)
 | 
        
           |  |  | 77 | 			{
 | 
        
           |  |  | 78 | 				delete components;
 | 
        
           |  |  | 79 | 			}
 | 
        
           |  |  | 80 | 			delete m_pMenuItem;
 | 
        
           |  |  | 81 | 		}
 | 
        
           |  |  | 82 |   | 
        
           |  |  | 83 | 		System::Windows::Forms::TabControl			^m_pTabCtrl;
 | 
        
           |  |  | 84 | 		System::Windows::Forms::TabPage				^m_pTabPage;
 | 
        
           |  |  | 85 | 		System::Windows::Forms::ToolStripMenuItem	^m_pMenuItem;
 | 
        
           |  |  | 86 | 		Windows::Forms::ImageList					^imageList1;
 | 
        
           |  |  | 87 | 		System::Collections::Hashtable				^textList;
 | 
        
           |  |  | 88 | 		CPackages									*m_pP;
 | 
        
           |  |  | 89 | 		System::String								^m_sFilename;
 | 
        
           |  |  | 90 | 		int											 m_iFormType;
 | 
        
           |  |  | 91 | 		SSettings									*m_pSettings;
 | 
        
           |  |  | 92 | 		bool	m_bLoading;
 | 
        
           |  |  | 93 | 		bool	m_bClosing;
 | 
        
           |  |  | 94 | 		System::Windows::Forms::ImageList			^imageListSmall;
 | 
        
           |  |  | 95 | 		System::Windows::Forms::ImageList			^imageListLarge;
 | 
        
           |  |  | 96 | 		System::Windows::Forms::ImageList			^imageListGames;
 | 
        
           |  |  | 97 | 		ListViewItem ^m_pSelectedItem;
 | 
        
           |  |  | 98 |   | 
        
           |  |  | 99 | 	private:
 | 
        
           |  |  | 100 | 		System::Void BaseForm::BaseForm_Activated(System::Object^  sender, System::EventArgs^  e);
 | 
        
           |  |  | 101 | 		System::Void Event_Menu(System::Object^  sender, System::EventArgs^  e) 
 | 
        
           |  |  | 102 | 		{
 | 
        
           |  |  | 103 | 			 this->Select();
 | 
        
           |  |  | 104 |    			 m_pTabCtrl->SelectedTab = m_pTabPage;
 | 
        
           |  |  | 105 |  		 }
 | 
        
           |  |  | 106 | 		/// <summary>
 | 
        
           |  |  | 107 | 		/// Required designer variable.
 | 
        
           |  |  | 108 | 		/// </summary>
 | 
        
           |  |  | 109 | 		System::ComponentModel::Container ^components;
 | 
        
           |  |  | 110 |   | 
        
           |  |  | 111 | #pragma region Windows Form Designer generated code
 | 
        
           |  |  | 112 | 		/// <summary>
 | 
        
           |  |  | 113 | 		/// Required method for Designer support - do not modify
 | 
        
           |  |  | 114 | 		/// the contents of this method with the code editor.
 | 
        
           |  |  | 115 | 		/// </summary>
 | 
        
           |  |  | 116 | 		void InitializeComponent(void)
 | 
        
           |  |  | 117 | 		{
 | 
        
           |  |  | 118 | 			this->SuspendLayout();
 | 
        
           |  |  | 119 | 			// 
 | 
        
           |  |  | 120 | 			// BaseForm
 | 
        
           |  |  | 121 | 			// 
 | 
        
           |  |  | 122 | 			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
 | 
        
           |  |  | 123 | 			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
 | 
        
           |  |  | 124 | 			this->ClientSize = System::Drawing::Size(284, 262);
 | 
        
           |  |  | 125 | 			this->Name = L"BaseForm";
 | 
        
           |  |  | 126 | 			this->Text = L"BaseForm1";
 | 
        
           |  |  | 127 | 			this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &BaseForm::BaseForm_FormClosed);
 | 
        
           |  |  | 128 | 			this->ResumeLayout(false);
 | 
        
           |  |  | 129 |   | 
        
           |  |  | 130 | 		}
 | 
        
           |  |  | 131 | #pragma endregion
 | 
        
           |  |  | 132 | 	private: System::Void BaseForm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e) {
 | 
        
           |  |  | 133 | 				 m_bClosing = true;
 | 
        
           |  |  | 134 | 				 CloseForm();
 | 
        
           |  |  | 135 | 			 }
 | 
        
           |  |  | 136 | };
 | 
        
           |  |  | 137 | }
 |