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 |
|
|
|
11 |
namespace PluginManager {
|
|
|
12 |
|
|
|
13 |
/// <summary>
|
|
|
14 |
/// Summary for MessageBoxDetails
|
|
|
15 |
///
|
|
|
16 |
/// WARNING: If you change the name of this class, you will need to change the
|
|
|
17 |
/// 'Resource File Name' property for the managed resource compiler tool
|
|
|
18 |
/// associated with all .resx files this class depends on. Otherwise,
|
|
|
19 |
/// the designers will not be able to interact properly with localized
|
|
|
20 |
/// resources associated with this form.
|
|
|
21 |
/// </summary>
|
|
|
22 |
public ref class MessageBoxDetails : public System::Windows::Forms::Form
|
|
|
23 |
{
|
|
|
24 |
public:
|
|
|
25 |
static System::Windows::Forms::DialogResult Show(System::Windows::Forms::Form ^parent, String ^title, String ^desc, String ^details) { return MessageBoxDetails::Show(parent, title, desc, details, true); }
|
|
|
26 |
static System::Windows::Forms::DialogResult Show(System::Windows::Forms::Form ^parent, String ^title, String ^desc, String ^details, bool cancel) { return MessageBoxDetails::Show(parent, title, desc, details, cancel, 400); }
|
|
|
27 |
static System::Windows::Forms::DialogResult Show(System::Windows::Forms::Form ^parent, String ^title, String ^desc, String ^details, bool cancel, int initialwidth)
|
|
|
28 |
{
|
|
|
29 |
MessageBoxDetails ^form = gcnew MessageBoxDetails(title, desc, details, cancel);
|
|
|
30 |
|
|
|
31 |
form->Width = initialwidth;
|
|
|
32 |
System::Windows::Forms::DialogResult res = form->ShowDialog(parent);
|
|
|
33 |
delete form;
|
|
|
34 |
return res;
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
MessageBoxDetails(String ^title, String ^desc, String ^details, bool cancel)
|
|
|
38 |
{
|
|
|
39 |
InitializeComponent();
|
|
|
40 |
|
|
|
41 |
m_sDetails = "Details";
|
|
|
42 |
this->Text = title;
|
|
|
43 |
this->richTextBox1->Text = desc;
|
|
|
44 |
this->richTextBox2->Text = details;
|
|
|
45 |
|
|
|
46 |
this->richTextBox1->SelectionAlignment = HorizontalAlignment::Center;
|
|
|
47 |
|
|
|
48 |
this->button2->Focus();
|
|
|
49 |
|
|
|
50 |
if ( !cancel )
|
|
|
51 |
NoCancel();
|
|
|
52 |
|
|
|
53 |
CloseDetails();
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
void SetCancelText(String ^text) { this->button3->Text = text; }
|
|
|
57 |
void SetOkText(String ^text) { this->button2->Text = text; }
|
|
|
58 |
void SetDetailsText(String ^text) { m_sDetails = text; }
|
|
|
59 |
void NoCancel() { this->button3->Hide(); }
|
|
|
60 |
|
|
|
61 |
void OpenDetails()
|
|
|
62 |
{
|
|
|
63 |
m_bDetails = true;
|
|
|
64 |
this->button1->Text = m_sDetails + " <<<";
|
|
|
65 |
this->Height += m_iHeight;
|
|
|
66 |
this->splitContainer1->Panel2Collapsed = false;
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
void CloseDetails()
|
|
|
70 |
{
|
|
|
71 |
m_bDetails = false;
|
|
|
72 |
this->button1->Text = m_sDetails + " >>>";
|
|
|
73 |
int diff = this->Height - this->splitContainer1->Height;
|
|
|
74 |
m_iHeight = this->splitContainer1->Panel2->Height + this->splitContainer1->SplitterWidth;
|
|
|
75 |
int h = diff + (this->splitContainer1->Height - m_iHeight);
|
|
|
76 |
this->splitContainer1->Panel2Collapsed = true;
|
|
|
77 |
this->Height = h;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
protected:
|
|
|
81 |
/// <summary>
|
|
|
82 |
/// Clean up any resources being used.
|
|
|
83 |
/// </summary>
|
|
|
84 |
~MessageBoxDetails()
|
|
|
85 |
{
|
|
|
86 |
if (components)
|
|
|
87 |
{
|
|
|
88 |
delete components;
|
|
|
89 |
}
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
String ^m_sDetails;
|
|
|
93 |
bool m_bDetails;
|
|
|
94 |
int m_iHeight;
|
|
|
95 |
private: System::Windows::Forms::SplitContainer^ splitContainer1;
|
|
|
96 |
protected:
|
|
|
97 |
private: System::Windows::Forms::Panel^ panel1;
|
|
|
98 |
private: System::Windows::Forms::Panel^ panel2;
|
|
|
99 |
private: System::Windows::Forms::Button^ button1;
|
|
|
100 |
private: System::Windows::Forms::RichTextBox^ richTextBox1;
|
|
|
101 |
private: System::Windows::Forms::Button^ button3;
|
|
|
102 |
private: System::Windows::Forms::Button^ button2;
|
|
|
103 |
private: System::Windows::Forms::RichTextBox^ richTextBox2;
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
private:
|
|
|
107 |
/// <summary>
|
|
|
108 |
/// Required designer variable.
|
|
|
109 |
/// </summary>
|
|
|
110 |
System::ComponentModel::Container ^components;
|
|
|
111 |
|
|
|
112 |
#pragma region Windows Form Designer generated code
|
|
|
113 |
/// <summary>
|
|
|
114 |
/// Required method for Designer support - do not modify
|
|
|
115 |
/// the contents of this method with the code editor.
|
|
|
116 |
/// </summary>
|
|
|
117 |
void InitializeComponent(void)
|
|
|
118 |
{
|
|
|
119 |
this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
|
|
|
120 |
this->panel1 = (gcnew System::Windows::Forms::Panel());
|
|
|
121 |
this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
|
|
|
122 |
this->panel2 = (gcnew System::Windows::Forms::Panel());
|
|
|
123 |
this->button3 = (gcnew System::Windows::Forms::Button());
|
|
|
124 |
this->button2 = (gcnew System::Windows::Forms::Button());
|
|
|
125 |
this->button1 = (gcnew System::Windows::Forms::Button());
|
|
|
126 |
this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());
|
|
|
127 |
this->splitContainer1->Panel1->SuspendLayout();
|
|
|
128 |
this->splitContainer1->Panel2->SuspendLayout();
|
|
|
129 |
this->splitContainer1->SuspendLayout();
|
|
|
130 |
this->panel1->SuspendLayout();
|
|
|
131 |
this->panel2->SuspendLayout();
|
|
|
132 |
this->SuspendLayout();
|
|
|
133 |
//
|
|
|
134 |
// splitContainer1
|
|
|
135 |
//
|
|
|
136 |
this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
137 |
this->splitContainer1->Location = System::Drawing::Point(0, 0);
|
|
|
138 |
this->splitContainer1->Name = L"splitContainer1";
|
|
|
139 |
this->splitContainer1->Orientation = System::Windows::Forms::Orientation::Horizontal;
|
|
|
140 |
//
|
|
|
141 |
// splitContainer1.Panel1
|
|
|
142 |
//
|
|
|
143 |
this->splitContainer1->Panel1->Controls->Add(this->panel1);
|
|
|
144 |
this->splitContainer1->Panel1->Controls->Add(this->panel2);
|
|
|
145 |
//
|
|
|
146 |
// splitContainer1.Panel2
|
|
|
147 |
//
|
|
|
148 |
this->splitContainer1->Panel2->Controls->Add(this->richTextBox2);
|
|
|
149 |
this->splitContainer1->Panel2->Padding = System::Windows::Forms::Padding(5);
|
|
|
150 |
this->splitContainer1->Size = System::Drawing::Size(413, 268);
|
|
|
151 |
this->splitContainer1->SplitterDistance = 90;
|
|
|
152 |
this->splitContainer1->TabIndex = 0;
|
|
|
153 |
//
|
|
|
154 |
// panel1
|
|
|
155 |
//
|
|
|
156 |
this->panel1->Controls->Add(this->richTextBox1);
|
|
|
157 |
this->panel1->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
158 |
this->panel1->Location = System::Drawing::Point(0, 0);
|
|
|
159 |
this->panel1->Name = L"panel1";
|
|
|
160 |
this->panel1->Padding = System::Windows::Forms::Padding(5);
|
|
|
161 |
this->panel1->Size = System::Drawing::Size(413, 57);
|
|
|
162 |
this->panel1->TabIndex = 0;
|
|
|
163 |
//
|
|
|
164 |
// richTextBox1
|
|
|
165 |
//
|
|
|
166 |
this->richTextBox1->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
|
|
167 |
this->richTextBox1->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
168 |
this->richTextBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
|
|
169 |
static_cast<System::Byte>(0)));
|
|
|
170 |
this->richTextBox1->Location = System::Drawing::Point(5, 5);
|
|
|
171 |
this->richTextBox1->Name = L"richTextBox1";
|
|
|
172 |
this->richTextBox1->ReadOnly = true;
|
|
|
173 |
this->richTextBox1->ScrollBars = System::Windows::Forms::RichTextBoxScrollBars::ForcedVertical;
|
|
|
174 |
this->richTextBox1->Size = System::Drawing::Size(403, 47);
|
|
|
175 |
this->richTextBox1->TabIndex = 0;
|
|
|
176 |
this->richTextBox1->Text = L"";
|
|
|
177 |
//
|
|
|
178 |
// panel2
|
|
|
179 |
//
|
|
|
180 |
this->panel2->Controls->Add(this->button3);
|
|
|
181 |
this->panel2->Controls->Add(this->button2);
|
|
|
182 |
this->panel2->Controls->Add(this->button1);
|
|
|
183 |
this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
|
|
|
184 |
this->panel2->Location = System::Drawing::Point(0, 57);
|
|
|
185 |
this->panel2->Name = L"panel2";
|
|
|
186 |
this->panel2->Padding = System::Windows::Forms::Padding(5);
|
|
|
187 |
this->panel2->Size = System::Drawing::Size(413, 33);
|
|
|
188 |
this->panel2->TabIndex = 1;
|
|
|
189 |
//
|
|
|
190 |
// button3
|
|
|
191 |
//
|
|
|
192 |
this->button3->DialogResult = System::Windows::Forms::DialogResult::Cancel;
|
|
|
193 |
this->button3->Dock = System::Windows::Forms::DockStyle::Right;
|
|
|
194 |
this->button3->Location = System::Drawing::Point(255, 5);
|
|
|
195 |
this->button3->Name = L"button3";
|
|
|
196 |
this->button3->Size = System::Drawing::Size(78, 23);
|
|
|
197 |
this->button3->TabIndex = 2;
|
|
|
198 |
this->button3->Text = L"Cancel";
|
|
|
199 |
this->button3->UseVisualStyleBackColor = true;
|
|
|
200 |
//
|
|
|
201 |
// button2
|
|
|
202 |
//
|
|
|
203 |
this->button2->DialogResult = System::Windows::Forms::DialogResult::OK;
|
|
|
204 |
this->button2->Dock = System::Windows::Forms::DockStyle::Right;
|
|
|
205 |
this->button2->Location = System::Drawing::Point(333, 5);
|
|
|
206 |
this->button2->Name = L"button2";
|
|
|
207 |
this->button2->Size = System::Drawing::Size(75, 23);
|
|
|
208 |
this->button2->TabIndex = 1;
|
|
|
209 |
this->button2->Text = L"Ok";
|
|
|
210 |
this->button2->UseVisualStyleBackColor = true;
|
|
|
211 |
//
|
|
|
212 |
// button1
|
|
|
213 |
//
|
|
|
214 |
this->button1->Dock = System::Windows::Forms::DockStyle::Left;
|
|
|
215 |
this->button1->Location = System::Drawing::Point(5, 5);
|
|
|
216 |
this->button1->Name = L"button1";
|
|
|
217 |
this->button1->Size = System::Drawing::Size(75, 23);
|
|
|
218 |
this->button1->TabIndex = 0;
|
|
|
219 |
this->button1->Text = L"button1";
|
|
|
220 |
this->button1->UseVisualStyleBackColor = true;
|
|
|
221 |
this->button1->Click += gcnew System::EventHandler(this, &MessageBoxDetails::button1_Click);
|
|
|
222 |
//
|
|
|
223 |
// richTextBox2
|
|
|
224 |
//
|
|
|
225 |
this->richTextBox2->BorderStyle = System::Windows::Forms::BorderStyle::None;
|
|
|
226 |
this->richTextBox2->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
227 |
this->richTextBox2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
|
|
|
228 |
static_cast<System::Byte>(0)));
|
|
|
229 |
this->richTextBox2->Location = System::Drawing::Point(5, 5);
|
|
|
230 |
this->richTextBox2->Name = L"richTextBox2";
|
|
|
231 |
this->richTextBox2->ReadOnly = true;
|
|
|
232 |
this->richTextBox2->ScrollBars = System::Windows::Forms::RichTextBoxScrollBars::ForcedVertical;
|
|
|
233 |
this->richTextBox2->Size = System::Drawing::Size(403, 164);
|
|
|
234 |
this->richTextBox2->TabIndex = 1;
|
|
|
235 |
this->richTextBox2->Text = L"";
|
|
|
236 |
//
|
|
|
237 |
// MessageBoxDetails
|
|
|
238 |
//
|
|
|
239 |
this->AcceptButton = this->button2;
|
|
|
240 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
|
|
241 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
|
|
242 |
this->CancelButton = this->button3;
|
|
|
243 |
this->ClientSize = System::Drawing::Size(413, 268);
|
|
|
244 |
this->ControlBox = false;
|
|
|
245 |
this->Controls->Add(this->splitContainer1);
|
|
|
246 |
this->Name = L"MessageBoxDetails";
|
|
|
247 |
this->ShowInTaskbar = false;
|
|
|
248 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
|
|
|
249 |
this->Text = L"MessageBoxDetails";
|
|
|
250 |
this->splitContainer1->Panel1->ResumeLayout(false);
|
|
|
251 |
this->splitContainer1->Panel2->ResumeLayout(false);
|
|
|
252 |
this->splitContainer1->ResumeLayout(false);
|
|
|
253 |
this->panel1->ResumeLayout(false);
|
|
|
254 |
this->panel2->ResumeLayout(false);
|
|
|
255 |
this->ResumeLayout(false);
|
|
|
256 |
|
|
|
257 |
}
|
|
|
258 |
#pragma endregion
|
|
|
259 |
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
|
|
|
260 |
if ( m_bDetails )
|
|
|
261 |
CloseDetails();
|
|
|
262 |
else
|
|
|
263 |
OpenDetails();
|
|
|
264 |
}
|
|
|
265 |
};
|
|
|
266 |
}
|