-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathform_cub.h
269 lines (256 loc) · 9.04 KB
/
form_cub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
#pragma once
#include "Cub.h"
namespace Praktika3 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Ñâîäêà äëÿ form_cub
/// </summary>
public ref class form_cub : public System::Windows::Forms::Form
{
public:
form_cub(void)
{
InitializeComponent();
//
//TODO: äîáàâüòå êîä êîíñòðóêòîðà
//
}
protected:
/// <summary>
/// Îñâîáîäèòü âñå èñïîëüçóåìûå ðåñóðñû.
/// </summary>
~form_cub()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::TextBox^ num1;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::TextBox^ num2;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Label^ label8;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::TextBox^ num3;
private: System::Windows::Forms::Button^ button3;
protected:
private:
/// <summary>
/// Îáÿçàòåëüíàÿ ïåðåìåííàÿ êîíñòðóêòîðà.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Òðåáóåìûé ìåòîä äëÿ ïîääåðæêè êîíñòðóêòîðà — íå èçìåíÿéòå
/// ñîäåðæèìîå ýòîãî ìåòîäà ñ ïîìîùüþ ðåäàêòîðà êîäà.
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(form_cub::typeid));
this->button1 = (gcnew System::Windows::Forms::Button());
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->num1 = (gcnew System::Windows::Forms::TextBox());
this->label7 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->num2 = (gcnew System::Windows::Forms::TextBox());
this->button2 = (gcnew System::Windows::Forms::Button());
this->label8 = (gcnew System::Windows::Forms::Label());
this->label6 = (gcnew System::Windows::Forms::Label());
this->num3 = (gcnew System::Windows::Forms::TextBox());
this->button3 = (gcnew System::Windows::Forms::Button());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(483, 307);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"Çàêðûòü";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &form_cub::button1_Click);
//
// pictureBox1
//
this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.Image")));
this->pictureBox1->Location = System::Drawing::Point(12, 12);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(315, 303);
this->pictureBox1->TabIndex = 1;
this->pictureBox1->TabStop = false;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(351, 12);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(184, 39);
this->label1->TabIndex = 2;
this->label1->Text = L"Ââåäèòå íåîáõîäèìûå ïàðàìåòðû \r\n äëÿ ðàñ÷¸òà îáú¸ìà ôèãóðû è\r\n ïëîùàäè ïîëíîé"
L" ïîâåðõíîñòè";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(351, 79);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(13, 13);
this->label2->TabIndex = 3;
this->label2->Text = L"a";
this->label2->Click += gcnew System::EventHandler(this, &form_cub::label2_Click);
//
// num1
//
this->num1->Location = System::Drawing::Point(370, 72);
this->num1->Name = L"num1";
this->num1->Size = System::Drawing::Size(150, 20);
this->num1->TabIndex = 4;
this->num1->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &form_cub::num1_KeyPress);
//
// label7
//
this->label7->AutoSize = true;
this->label7->Location = System::Drawing::Point(351, 121);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(45, 13);
this->label7->TabIndex = 14;
this->label7->Text = L"Îáú¸ì:";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(351, 148);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(14, 13);
this->label5->TabIndex = 15;
this->label5->Text = L"V";
//
// num2
//
this->num2->Location = System::Drawing::Point(372, 141);
this->num2->Name = L"num2";
this->num2->Size = System::Drawing::Size(148, 20);
this->num2->TabIndex = 16;
//
// button2
//
this->button2->Location = System::Drawing::Point(483, 167);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(75, 23);
this->button2->TabIndex = 17;
this->button2->Text = L"Âû÷èñëèòü";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &form_cub::button2_Click);
//
// label8
//
this->label8->AutoSize = true;
this->label8->Location = System::Drawing::Point(351, 203);
this->label8->Name = L"label8";
this->label8->Size = System::Drawing::Size(163, 13);
this->label8->TabIndex = 18;
this->label8->Text = L"Ïëîùàäü ïîëíîé ïîâåðõíîñòè:";
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(351, 234);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(40, 13);
this->label6->TabIndex = 19;
this->label6->Text = L"S_poln";
//
// num3
//
this->num3->Location = System::Drawing::Point(397, 227);
this->num3->Name = L"num3";
this->num3->Size = System::Drawing::Size(123, 20);
this->num3->TabIndex = 20;
//
// button3
//
this->button3->Location = System::Drawing::Point(483, 253);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(75, 23);
this->button3->TabIndex = 21;
this->button3->Text = L"Âû÷èñëèòü";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &form_cub::button3_Click);
//
// form_cub
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(570, 342);
this->Controls->Add(this->button3);
this->Controls->Add(this->num3);
this->Controls->Add(this->label6);
this->Controls->Add(this->label8);
this->Controls->Add(this->button2);
this->Controls->Add(this->num2);
this->Controls->Add(this->label5);
this->Controls->Add(this->label7);
this->Controls->Add(this->num1);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->pictureBox1);
this->Controls->Add(this->button1);
this->Name = L"form_cub";
this->Text = L"Cub";
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->Close();
}
private: System::Void label2_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
double number1 = System::Convert::ToDouble(num1->Text);
cub volume;
if (number1 > 0)
{
double decision2 = volume.Volume(number1);
num2->Text = System::Convert::ToString(decision2);
}
else
{
num2->Text = "Error!!!";
}
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
/*double number1 = System::Convert::ToDouble(num1->Text);
cub surface_area;
if (number1 > 0)
{
double decision2 = surface_area.Surface_area(number1);
num3->Text = System::Convert::ToString(decision2);
}
else
{
num3->Text = "Error!!!";
}*/
}
private: System::Void num1_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) {
if ((e->KeyChar != (char)8) && (e->KeyChar < (char)48 || e->KeyChar >(char)57)) {
e->Handled = true;
}
}
};
}