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 "WizardStartup.h"
|
|
|
11 |
#include "WizardCore1.h"
|
|
|
12 |
|
|
|
13 |
namespace Creator {
|
|
|
14 |
|
|
|
15 |
/// <summary>
|
|
|
16 |
/// Summary for CreationWizard
|
|
|
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 CreationWizard : public System::Windows::Forms::Form
|
|
|
25 |
{
|
|
|
26 |
public:
|
|
|
27 |
CreationWizard(void)
|
|
|
28 |
{
|
|
|
29 |
InitializeComponent();
|
|
|
30 |
|
|
|
31 |
PreviousControls = gcnew Collections::Generic::List<UserControl ^>();
|
|
|
32 |
|
|
|
33 |
m_pPackage = NULL;
|
|
|
34 |
m_pControl = nullptr;
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
void EnableBack(bool e) { this->ButBack->Enabled = e; }
|
|
|
38 |
void EnableNext(bool e) { this->ButNext->Enabled = e; }
|
|
|
39 |
void CreatePackageType(int type)
|
|
|
40 |
{
|
|
|
41 |
if ( m_pPackage ) delete m_pPackage;
|
|
|
42 |
|
|
|
43 |
switch ( type )
|
|
|
44 |
{
|
|
|
45 |
case TYPE_SPK:
|
|
|
46 |
m_pPackage = new CSpkFile;
|
|
|
47 |
break;
|
|
|
48 |
case TYPE_XSP:
|
|
|
49 |
m_pPackage = new CXspFile;
|
|
|
50 |
break;
|
|
|
51 |
default:
|
|
|
52 |
m_pPackage = new CBaseFile;
|
|
|
53 |
}
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
protected:
|
|
|
57 |
/// <summary>
|
|
|
58 |
/// Clean up any resources being used.
|
|
|
59 |
/// </summary>
|
|
|
60 |
~CreationWizard()
|
|
|
61 |
{
|
|
|
62 |
if (components)
|
|
|
63 |
{
|
|
|
64 |
delete components;
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
private: System::Windows::Forms::PictureBox^ pictureBox1;
|
|
|
68 |
protected:
|
|
|
69 |
private: System::Windows::Forms::GroupBox^ groupBox1;
|
|
|
70 |
private: System::Windows::Forms::Button^ ButBack;
|
|
|
71 |
|
|
|
72 |
private: System::Windows::Forms::Button^ ButNext;
|
|
|
73 |
|
|
|
74 |
private: System::Windows::Forms::Button^ ButDone;
|
|
|
75 |
|
|
|
76 |
private: System::Windows::Forms::Button^ button1;
|
|
|
77 |
private: System::Windows::Forms::Panel^ PanelWizard;
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
private:
|
|
|
81 |
System::Windows::Forms::UserControl ^m_pControl;
|
|
|
82 |
CBaseFile *m_pPackage;
|
|
|
83 |
/// <summary>
|
|
|
84 |
/// Required designer variable.
|
|
|
85 |
/// </summary>
|
|
|
86 |
System::ComponentModel::Container ^components;
|
|
|
87 |
System::Collections::Generic::List<UserControl ^> ^PreviousControls;
|
|
|
88 |
|
|
|
89 |
#pragma region Windows Form Designer generated code
|
|
|
90 |
/// <summary>
|
|
|
91 |
/// Required method for Designer support - do not modify
|
|
|
92 |
/// the contents of this method with the code editor.
|
|
|
93 |
/// </summary>
|
|
|
94 |
void InitializeComponent(void)
|
|
|
95 |
{
|
|
|
96 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(CreationWizard::typeid));
|
|
|
97 |
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
|
|
|
98 |
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
|
|
|
99 |
this->ButBack = (gcnew System::Windows::Forms::Button());
|
|
|
100 |
this->ButNext = (gcnew System::Windows::Forms::Button());
|
|
|
101 |
this->ButDone = (gcnew System::Windows::Forms::Button());
|
|
|
102 |
this->button1 = (gcnew System::Windows::Forms::Button());
|
|
|
103 |
this->PanelWizard = (gcnew System::Windows::Forms::Panel());
|
|
|
104 |
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();
|
|
|
105 |
this->groupBox1->SuspendLayout();
|
|
|
106 |
this->SuspendLayout();
|
|
|
107 |
//
|
|
|
108 |
// pictureBox1
|
|
|
109 |
//
|
|
|
110 |
this->pictureBox1->Dock = System::Windows::Forms::DockStyle::Top;
|
|
|
111 |
this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"pictureBox1.Image")));
|
|
|
112 |
this->pictureBox1->Location = System::Drawing::Point(0, 0);
|
|
|
113 |
this->pictureBox1->Name = L"pictureBox1";
|
|
|
114 |
this->pictureBox1->Size = System::Drawing::Size(755, 110);
|
|
|
115 |
this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
|
|
|
116 |
this->pictureBox1->TabIndex = 0;
|
|
|
117 |
this->pictureBox1->TabStop = false;
|
|
|
118 |
//
|
|
|
119 |
// groupBox1
|
|
|
120 |
//
|
|
|
121 |
this->groupBox1->Controls->Add(this->ButBack);
|
|
|
122 |
this->groupBox1->Controls->Add(this->ButNext);
|
|
|
123 |
this->groupBox1->Controls->Add(this->ButDone);
|
|
|
124 |
this->groupBox1->Controls->Add(this->button1);
|
|
|
125 |
this->groupBox1->Dock = System::Windows::Forms::DockStyle::Bottom;
|
|
|
126 |
this->groupBox1->Location = System::Drawing::Point(0, 643);
|
|
|
127 |
this->groupBox1->Name = L"groupBox1";
|
|
|
128 |
this->groupBox1->Padding = System::Windows::Forms::Padding(10);
|
|
|
129 |
this->groupBox1->Size = System::Drawing::Size(755, 66);
|
|
|
130 |
this->groupBox1->TabIndex = 2;
|
|
|
131 |
this->groupBox1->TabStop = false;
|
|
|
132 |
//
|
|
|
133 |
// ButBack
|
|
|
134 |
//
|
|
|
135 |
this->ButBack->Dock = System::Windows::Forms::DockStyle::Right;
|
|
|
136 |
this->ButBack->Location = System::Drawing::Point(409, 23);
|
|
|
137 |
this->ButBack->Name = L"ButBack";
|
|
|
138 |
this->ButBack->Size = System::Drawing::Size(107, 33);
|
|
|
139 |
this->ButBack->TabIndex = 3;
|
|
|
140 |
this->ButBack->Text = L"< Back";
|
|
|
141 |
this->ButBack->UseVisualStyleBackColor = true;
|
|
|
142 |
this->ButBack->Click += gcnew System::EventHandler(this, &CreationWizard::ButBack_Click);
|
|
|
143 |
//
|
|
|
144 |
// ButNext
|
|
|
145 |
//
|
|
|
146 |
this->ButNext->Dock = System::Windows::Forms::DockStyle::Right;
|
|
|
147 |
this->ButNext->Location = System::Drawing::Point(516, 23);
|
|
|
148 |
this->ButNext->Name = L"ButNext";
|
|
|
149 |
this->ButNext->Size = System::Drawing::Size(118, 33);
|
|
|
150 |
this->ButNext->TabIndex = 2;
|
|
|
151 |
this->ButNext->Text = L"Next >";
|
|
|
152 |
this->ButNext->UseVisualStyleBackColor = true;
|
|
|
153 |
this->ButNext->Click += gcnew System::EventHandler(this, &CreationWizard::ButNext_Click);
|
|
|
154 |
//
|
|
|
155 |
// ButDone
|
|
|
156 |
//
|
|
|
157 |
this->ButDone->DialogResult = System::Windows::Forms::DialogResult::OK;
|
|
|
158 |
this->ButDone->Dock = System::Windows::Forms::DockStyle::Right;
|
|
|
159 |
this->ButDone->Location = System::Drawing::Point(634, 23);
|
|
|
160 |
this->ButDone->Name = L"ButDone";
|
|
|
161 |
this->ButDone->Size = System::Drawing::Size(111, 33);
|
|
|
162 |
this->ButDone->TabIndex = 1;
|
|
|
163 |
this->ButDone->Text = L"Done";
|
|
|
164 |
this->ButDone->UseVisualStyleBackColor = true;
|
|
|
165 |
//
|
|
|
166 |
// button1
|
|
|
167 |
//
|
|
|
168 |
this->button1->DialogResult = System::Windows::Forms::DialogResult::Cancel;
|
|
|
169 |
this->button1->Dock = System::Windows::Forms::DockStyle::Left;
|
|
|
170 |
this->button1->Location = System::Drawing::Point(10, 23);
|
|
|
171 |
this->button1->Name = L"button1";
|
|
|
172 |
this->button1->Size = System::Drawing::Size(95, 33);
|
|
|
173 |
this->button1->TabIndex = 0;
|
|
|
174 |
this->button1->Text = L"Cancel";
|
|
|
175 |
this->button1->UseVisualStyleBackColor = true;
|
|
|
176 |
//
|
|
|
177 |
// PanelWizard
|
|
|
178 |
//
|
|
|
179 |
this->PanelWizard->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
180 |
this->PanelWizard->Location = System::Drawing::Point(0, 110);
|
|
|
181 |
this->PanelWizard->Name = L"PanelWizard";
|
|
|
182 |
this->PanelWizard->Padding = System::Windows::Forms::Padding(10);
|
|
|
183 |
this->PanelWizard->Size = System::Drawing::Size(755, 533);
|
|
|
184 |
this->PanelWizard->TabIndex = 3;
|
|
|
185 |
//
|
|
|
186 |
// CreationWizard
|
|
|
187 |
//
|
|
|
188 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
|
|
189 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
|
|
190 |
this->ClientSize = System::Drawing::Size(755, 709);
|
|
|
191 |
this->Controls->Add(this->PanelWizard);
|
|
|
192 |
this->Controls->Add(this->groupBox1);
|
|
|
193 |
this->Controls->Add(this->pictureBox1);
|
|
|
194 |
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
|
|
|
195 |
this->Name = L"CreationWizard";
|
|
|
196 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
|
|
|
197 |
this->Text = L"Package Creation Wizard";
|
|
|
198 |
this->Load += gcnew System::EventHandler(this, &CreationWizard::CreationWizard_Load);
|
|
|
199 |
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->EndInit();
|
|
|
200 |
this->groupBox1->ResumeLayout(false);
|
|
|
201 |
this->ResumeLayout(false);
|
|
|
202 |
|
|
|
203 |
}
|
|
|
204 |
#pragma endregion
|
|
|
205 |
private: System::Void CreationWizard_Load(System::Object^ sender, System::EventArgs^ e) {
|
|
|
206 |
m_pControl = gcnew WizardStartup(this);
|
|
|
207 |
this->PanelWizard->Controls->Add(m_pControl);
|
|
|
208 |
m_pControl->Dock = Windows::Forms::DockStyle::Fill;
|
|
|
209 |
this->ButDone->Enabled = false;
|
|
|
210 |
this->ButBack->Enabled = false;
|
|
|
211 |
this->ButNext->Enabled = false;
|
|
|
212 |
}
|
|
|
213 |
private: System::Void ButNext_Click(System::Object^ sender, System::EventArgs^ e) {
|
|
|
214 |
Windows::Forms::UserControl ^c = cli::safe_cast<WizardCore1 ^>(m_pControl)->GetNext(m_pPackage);
|
|
|
215 |
if ( c ) {
|
|
|
216 |
PreviousControls->Add(m_pControl);
|
|
|
217 |
this->PanelWizard->Controls->Clear();
|
|
|
218 |
m_pControl = c;
|
|
|
219 |
this->PanelWizard->Controls->Add(m_pControl);
|
|
|
220 |
m_pControl->Dock = Windows::Forms::DockStyle::Fill;
|
|
|
221 |
this->ButBack->Enabled = true;
|
|
|
222 |
}
|
|
|
223 |
this->ButNext->Enabled = false;
|
|
|
224 |
}
|
|
|
225 |
private: System::Void ButBack_Click(System::Object^ sender, System::EventArgs^ e) {
|
|
|
226 |
this->PanelWizard->Controls->Clear();
|
|
|
227 |
delete m_pControl;
|
|
|
228 |
m_pControl = PreviousControls[PreviousControls->Count - 1];
|
|
|
229 |
PreviousControls->Remove(m_pControl);
|
|
|
230 |
this->PanelWizard->Controls->Add(m_pControl);
|
|
|
231 |
m_pControl->Dock = Windows::Forms::DockStyle::Fill;
|
|
|
232 |
this->ButNext->Enabled = false;
|
|
|
233 |
|
|
|
234 |
if ( !PreviousControls->Count )
|
|
|
235 |
this->ButBack->Enabled = false;
|
|
|
236 |
}
|
|
|
237 |
};
|
|
|
238 |
}
|