Subversion Repositories spk

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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:
36 cycrow 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, SSettings *set)
1 cycrow 28
		{
29
			InitializeComponent();
30
 
31
			m_bClosing = false;
32
			m_bLoading = true;
33
			m_pSettings = set;
34
			m_iFormType = FORMTYPE_BASE;
35
			imageList1 = imagelist;
36
			m_pP = p;
37
			this->MdiParent = parent;
38
			m_pTabCtrl = ctrl;
39
			m_pTabPage = page;
40
 
41
			this->Activated += gcnew System::EventHandler(this, &BaseForm::BaseForm_Activated);
42
 
43
			m_pMenuItem = tool;
44
			m_pMenuItem->Click += gcnew System::EventHandler(this, &BaseForm::Event_Menu);
45
		}
46
 
47
		void CloseForm();
48
		bool IsClosing() { return m_bClosing; }
49
 
50
		void SetImageLists(Windows::Forms::ImageList ^smallList, ImageList ^largeList, ImageList ^gameList)
51
		{
52
			imageListSmall = smallList;
53
			imageListLarge = largeList;
54
			imageListGames = gameList;
55
		}
56
 
57
		System::Windows::Forms::TabControl ^TabControl() { return m_pTabCtrl; }
58
		System::Windows::Forms::TabPage ^TabPage() { return m_pTabPage; }
59
 
60
		int GetFormType() { return m_iFormType; }
61
		virtual void Save() {}
62
		virtual void SaveAs() {}
63
		bool BaseForm::CheckFilename(System::String ^filename)
64
		{
65
			if ( filename == m_sFilename )
66
				return true;
67
			return false;
68
		}
69
	protected:
70
		/// <summary>
71
		/// Clean up any resources being used.
72
		/// </summary>
73
		~BaseForm()
74
		{
75
			if (components)
76
			{
77
				delete components;
78
			}
79
			delete m_pMenuItem;
80
		}
81
 
82
		System::Windows::Forms::TabControl			^m_pTabCtrl;
83
		System::Windows::Forms::TabPage				^m_pTabPage;
84
		System::Windows::Forms::ToolStripMenuItem	^m_pMenuItem;
85
		Windows::Forms::ImageList					^imageList1;
36 cycrow 86
		//System::Collections::Hashtable				^textList;
1 cycrow 87
		CPackages									*m_pP;
88
		System::String								^m_sFilename;
89
		int											 m_iFormType;
90
		SSettings									*m_pSettings;
91
		bool	m_bLoading;
92
		bool	m_bClosing;
93
		System::Windows::Forms::ImageList			^imageListSmall;
94
		System::Windows::Forms::ImageList			^imageListLarge;
95
		System::Windows::Forms::ImageList			^imageListGames;
96
		ListViewItem ^m_pSelectedItem;
97
 
98
	private:
99
		System::Void BaseForm::BaseForm_Activated(System::Object^  sender, System::EventArgs^  e);
100
		System::Void Event_Menu(System::Object^  sender, System::EventArgs^  e) 
101
		{
102
			 this->Select();
103
   			 m_pTabCtrl->SelectedTab = m_pTabPage;
104
 		 }
105
		/// <summary>
106
		/// Required designer variable.
107
		/// </summary>
108
		System::ComponentModel::Container ^components;
109
 
110
#pragma region Windows Form Designer generated code
111
		/// <summary>
112
		/// Required method for Designer support - do not modify
113
		/// the contents of this method with the code editor.
114
		/// </summary>
115
		void InitializeComponent(void)
116
		{
117
			this->SuspendLayout();
118
			// 
119
			// BaseForm
120
			// 
121
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
122
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
123
			this->ClientSize = System::Drawing::Size(284, 262);
124
			this->Name = L"BaseForm";
125
			this->Text = L"BaseForm1";
126
			this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &BaseForm::BaseForm_FormClosed);
127
			this->ResumeLayout(false);
128
 
129
		}
130
#pragma endregion
131
	private: System::Void BaseForm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e) {
132
				 m_bClosing = true;
133
				 CloseForm();
134
			 }
135
};
136
}