-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnit6.~cpp
108 lines (87 loc) · 3.7 KB
/
Unit6.~cpp
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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit6.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm6 *Form6;
//---------------------------------------------------------------------------
__fastcall TForm6::TForm6(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Button1Click(TObject *Sender)
{
if(CheckBox2->Checked==1){
Form1->Linia->ChangeSection(1,number_of_section,0,0,0,0);
}
else
{
if(CheckBox1->Checked==1){
Form1->Linia->ChangeSection(0,number_of_section,atof((Form6->Edit1->Text).c_str()),atof((Form6->Edit2->Text).c_str()),atoi((Form6->Edit3->Text).c_str()),1);
}
else if (CheckBox1->Checked==0){
Form1->Linia->ChangeSection(0,number_of_section,atof((Form6->Edit1->Text).c_str()),atof((Form6->Edit2->Text).c_str()),atoi((Form6->Edit3->Text).c_str()),0);
}
}
Form2->ListBox1->Items->Clear();
for(int i=0; i<Form1->Linia->Size(); i++){
AnsiString s= Form1->Linia->ShowSection(i);
Form2->ListBox1->Items->Add(s);}
Form2->ListBox2->Items->Clear();
for(int i=0; i<Form1->Linia->DescriptionCount(); i++){
AnsiString s=Form1->Linia->ShowDescribe(i);
Form2->ListBox2->Items->Add(s);}
if(Form1->Linia->DescriptionCount()==0){Form2->ListBox2->Items->Add(" ");}
Form6->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm6::CheckBox2Click(TObject *Sender)
{
if(Edit1->Enabled==1){
Edit1->Enabled=0;
Edit2->Enabled=0;
Edit3->Enabled=0;
CheckBox1->Enabled=0;
}
else {
Edit1->Enabled=1;
Edit2->Enabled=1;
Edit3->Enabled=1;
CheckBox1->Enabled=1;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Button2Click(TObject *Sender)
{
Form1->Linia->ChangeSection(0,-1,atof((Form6->Edit1->Text).c_str()),atof((Form6->Edit2->Text).c_str()),atoi((Form6->Edit3->Text).c_str()),CheckBox1->Checked);
Form2->ListBox1->Items->Clear();
for(int i=0; i<Form1->Linia->Size(); i++){
AnsiString s= Form1->Linia->ShowSection(i);
Form2->ListBox1->Items->Add(s);}
Form2->ListBox2->Items->Clear();
for(int i=0; i<Form1->Linia->DescriptionCount(); i++){
AnsiString s=Form1->Linia->ShowDescribe(i);
Form2->ListBox2->Items->Add(s);}
if(Form1->Linia->DescriptionCount()==0){Form2->ListBox2->Items->Add(" ");}
Form6->Close();
/*
*/
}
//---------------------------------------------------------------------------
void __fastcall TForm6::CheckBox3Click(TObject *Sender)
{
if(CheckBox3->Checked==1){
Edit1->Text = CurrToStr(Form1->Linia->ShowLength());
Edit1->Enabled = 0;
}
else
{
Edit1->Text = " ";
Edit1->Enabled = 1;
}
}
//---------------------------------------------------------------------------