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 <spk.h>
|
|
|
11 |
|
|
|
12 |
namespace PluginManager {
|
|
|
13 |
|
|
|
14 |
/// <summary>
|
|
|
15 |
/// Summary for StartUp
|
|
|
16 |
///
|
|
|
17 |
/// WARNING: If you change the name of this class, you will need to change the
|
|
|
18 |
/// 'Resource File Name' property for the managed resource compiler tool
|
|
|
19 |
/// associated with all .resx files this class depends on. Otherwise,
|
|
|
20 |
/// the designers will not be able to interact properly with localized
|
|
|
21 |
/// resources associated with this form.
|
|
|
22 |
/// </summary>
|
|
|
23 |
public ref class StartUp : public System::Windows::Forms::Form
|
|
|
24 |
{
|
|
|
25 |
public:
|
196 |
cycrow |
26 |
StartUp(CPackages *p, Utils::WString *dir, bool hide, bool advanced)
|
1 |
cycrow |
27 |
{
|
|
|
28 |
InitializeComponent();
|
|
|
29 |
|
|
|
30 |
m_bLoaded = false;
|
|
|
31 |
m_pPackages = p;
|
|
|
32 |
m_bHide = hide;
|
|
|
33 |
progressBar1->Hide();
|
121 |
cycrow |
34 |
_sDir = dir;
|
1 |
cycrow |
35 |
m_iLoadStatus = 0;
|
|
|
36 |
m_iProgressMax = m_iProgressCount = 0;
|
|
|
37 |
|
|
|
38 |
backgroundWorker1->DoWork += gcnew DoWorkEventHandler( this, &StartUp::Background_DoWork );
|
|
|
39 |
backgroundWorker1->RunWorkerCompleted += gcnew RunWorkerCompletedEventHandler( this, &StartUp::Background_Finished );
|
|
|
40 |
backgroundWorker1->ProgressChanged += gcnew ProgressChangedEventHandler( this, &StartUp::Background_Progress );
|
|
|
41 |
|
|
|
42 |
this->Text = GetProgramName(advanced) + " " + GetVersionString();
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
bool LoadDirectory();
|
|
|
46 |
|
|
|
47 |
void SetProgress(const long cur, const long max)
|
|
|
48 |
{
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
ProgressBar ^GetProgress() { return progressBar1; }
|
|
|
52 |
|
|
|
53 |
void Background_DoWork(System::Object ^Sender, DoWorkEventArgs ^E);
|
|
|
54 |
void Background_Progress(System::Object ^Sender, ProgressChangedEventArgs ^E);
|
|
|
55 |
void Background_Finished(System::Object ^Sender, RunWorkerCompletedEventArgs ^E);
|
|
|
56 |
protected:
|
|
|
57 |
/// <summary>
|
|
|
58 |
/// Clean up any resources being used.
|
|
|
59 |
/// </summary>
|
|
|
60 |
~StartUp()
|
|
|
61 |
{
|
|
|
62 |
if (components)
|
|
|
63 |
{
|
|
|
64 |
delete components;
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
private: System::Windows::Forms::Label^ label1;
|
|
|
68 |
private: System::Windows::Forms::ProgressBar^ progressBar1;
|
|
|
69 |
protected:
|
|
|
70 |
CPackages *m_pPackages;
|
196 |
cycrow |
71 |
Utils::WString *_sDir;
|
1 |
cycrow |
72 |
bool m_bLoaded;
|
|
|
73 |
int m_iLoadStatus;
|
|
|
74 |
int m_iProgressMax;
|
|
|
75 |
int m_iProgressCount;
|
|
|
76 |
bool m_bHide;
|
|
|
77 |
|
|
|
78 |
private: System::Windows::Forms::Label^ label2;
|
|
|
79 |
private: System::ComponentModel::BackgroundWorker^ backgroundWorker1;
|
|
|
80 |
private: System::Windows::Forms::PictureBox^ pictureBox1;
|
|
|
81 |
protected:
|
|
|
82 |
|
|
|
83 |
private:
|
|
|
84 |
/// <summary>
|
|
|
85 |
/// Required designer variable.
|
|
|
86 |
/// </summary>
|
|
|
87 |
System::ComponentModel::Container ^components;
|
|
|
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(StartUp::typeid));
|
|
|
97 |
this->label1 = (gcnew System::Windows::Forms::Label());
|
|
|
98 |
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
|
|
|
99 |
this->label2 = (gcnew System::Windows::Forms::Label());
|
|
|
100 |
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
|
|
|
101 |
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
|
|
|
102 |
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();
|
|
|
103 |
this->SuspendLayout();
|
|
|
104 |
//
|
|
|
105 |
// label1
|
|
|
106 |
//
|
|
|
107 |
this->label1->Anchor = System::Windows::Forms::AnchorStyles::None;
|
|
|
108 |
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
|
|
109 |
static_cast<System::Byte>(0)));
|
|
|
110 |
this->label1->Location = System::Drawing::Point(11, 117);
|
|
|
111 |
this->label1->Name = L"label1";
|
|
|
112 |
this->label1->Padding = System::Windows::Forms::Padding(5);
|
|
|
113 |
this->label1->Size = System::Drawing::Size(465, 35);
|
|
|
114 |
this->label1->TabIndex = 0;
|
|
|
115 |
this->label1->Text = L"Loading Directory";
|
|
|
116 |
this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
|
|
|
117 |
this->label1->Click += gcnew System::EventHandler(this, &StartUp::label1_Click);
|
|
|
118 |
//
|
|
|
119 |
// progressBar1
|
|
|
120 |
//
|
|
|
121 |
this->progressBar1->Dock = System::Windows::Forms::DockStyle::Bottom;
|
|
|
122 |
this->progressBar1->Location = System::Drawing::Point(0, 186);
|
|
|
123 |
this->progressBar1->Name = L"progressBar1";
|
|
|
124 |
this->progressBar1->Size = System::Drawing::Size(489, 25);
|
|
|
125 |
this->progressBar1->TabIndex = 1;
|
|
|
126 |
this->progressBar1->Visible = false;
|
|
|
127 |
//
|
|
|
128 |
// label2
|
|
|
129 |
//
|
|
|
130 |
this->label2->Anchor = System::Windows::Forms::AnchorStyles::Top;
|
|
|
131 |
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
|
|
132 |
static_cast<System::Byte>(0)));
|
|
|
133 |
this->label2->Location = System::Drawing::Point(12, 157);
|
|
|
134 |
this->label2->Name = L"label2";
|
|
|
135 |
this->label2->Size = System::Drawing::Size(465, 20);
|
|
|
136 |
this->label2->TabIndex = 2;
|
|
|
137 |
this->label2->Text = L"label2";
|
|
|
138 |
this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
|
|
|
139 |
//
|
|
|
140 |
// backgroundWorker1
|
|
|
141 |
//
|
|
|
142 |
this->backgroundWorker1->WorkerReportsProgress = true;
|
|
|
143 |
//
|
|
|
144 |
// pictureBox1
|
|
|
145 |
//
|
|
|
146 |
this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"pictureBox1.Image")));
|
|
|
147 |
this->pictureBox1->Location = System::Drawing::Point(0, 2);
|
|
|
148 |
this->pictureBox1->Name = L"pictureBox1";
|
|
|
149 |
this->pictureBox1->Size = System::Drawing::Size(487, 112);
|
|
|
150 |
this->pictureBox1->TabIndex = 3;
|
|
|
151 |
this->pictureBox1->TabStop = false;
|
|
|
152 |
//
|
|
|
153 |
// StartUp
|
|
|
154 |
//
|
|
|
155 |
this->AutoScaleDimensions = System::Drawing::SizeF(96, 96);
|
|
|
156 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Dpi;
|
|
|
157 |
this->AutoSize = true;
|
|
|
158 |
this->ClientSize = System::Drawing::Size(489, 211);
|
|
|
159 |
this->Controls->Add(this->pictureBox1);
|
|
|
160 |
this->Controls->Add(this->label2);
|
|
|
161 |
this->Controls->Add(this->progressBar1);
|
|
|
162 |
this->Controls->Add(this->label1);
|
|
|
163 |
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
|
|
|
164 |
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
|
|
|
165 |
this->Name = L"StartUp";
|
|
|
166 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
|
|
|
167 |
this->Text = L"X-Universe Plugin Manager Lite";
|
|
|
168 |
this->TopMost = true;
|
|
|
169 |
this->Load += gcnew System::EventHandler(this, &StartUp::StartUp_Load);
|
|
|
170 |
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->EndInit();
|
|
|
171 |
this->ResumeLayout(false);
|
|
|
172 |
|
|
|
173 |
}
|
|
|
174 |
#pragma endregion
|
|
|
175 |
private: System::Void StartUp_Load(System::Object^ sender, System::EventArgs^ e) {
|
121 |
cycrow |
176 |
this->label2->Text = _US(*_sDir);
|
1 |
cycrow |
177 |
if ( m_bHide )
|
|
|
178 |
{
|
|
|
179 |
this->Hide();
|
|
|
180 |
this->WindowState = System::Windows::Forms::FormWindowState::Minimized;
|
|
|
181 |
}
|
|
|
182 |
else
|
|
|
183 |
this->Show();
|
|
|
184 |
backgroundWorker1->RunWorkerAsync();
|
|
|
185 |
}
|
|
|
186 |
private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
|
|
|
187 |
}
|
|
|
188 |
};
|
|
|
189 |
|
|
|
190 |
/*
|
|
|
191 |
public class StartUpProgress : public CProgressInfo
|
|
|
192 |
{
|
|
|
193 |
public:
|
|
|
194 |
StartUpProgress() { }
|
|
|
195 |
virtual void ProgressUpdated ( const long cur, const long max )
|
|
|
196 |
{
|
|
|
197 |
StartupUpdateProgress(cur, max);
|
|
|
198 |
};
|
|
|
199 |
virtual void ProgressUpdated2 ( const long cur, const long max ) { };
|
|
|
200 |
virtual void StatusUpdated(int i) { }
|
|
|
201 |
virtual void DoingFile ( C_File *file ) { };
|
|
|
202 |
};*/
|
|
|
203 |
}
|