Вы находитесь на странице: 1из 41

:

. .
10 2

. .

2011 .

.............................................................................................................. 3
............................................................................................... 4
1. ................................................................................. 4
1.1. ...................................................................... 4
1.1.1 ............................................ 4
1.1.2. ......................................... 4
1.1.3.
.............................................................................................................5
1.2. ............................ 6
1.3. .................................................... 8
1.3.1. .................... 8
1.3.2. ..................... 8
1.3.3. .................................................................... 12
1.4. ................. 13
1.4. ............................................. 14
1.5. ................................................ 14
..................................................................................................... 15
.............................................. 16
1. .................................... 17

,
, ,

.
,
,
;
, ,
,
.
: ,
, , .

,
.

.
,
,
:
, .

:

.


1.
1.1.

,
,
, ,
.
:
, ,
,
, .

.

1.1.1


.
4.
.

1.1.2.



,
.

1.1.3.

,
PascalABC.NET.
, Microsoft.NET: ,
, , , , ,
, , .NET-.
, PascalABC.NET Delphi (Object
Pascal): , .
PascalABC.NET
PascalABC.NET 1 .exe,

.
PascalABC.NET
, ,
. , PascalABC.NET
:
, - , -
, .
:

, .NET,

,
, . ,
, , .

1.2.

,
.

,
.


.
.

:
.

, .

.
.
:


,
.
,
.

*.graph,
*.bmp.

1.

1.3.

1.3.1.

.

ToolStrip ToolStripMenuItem,
Windows,
.
Button Windows "".

Combobox
Windows.
Label Windows.
Radiobutton
,
RadioButton.
TextBox " "
Windows.
PictureBox
Windows .

1.3.2.

2-6.
( 2) 15
.
.
.

2.

( 3)
4 .
.
,
,
. .

10

3. - 2

- ( 4)
:
.

.

( 5), ( 6),
,
.
- .
,
,
.

11

4. - 3

5.

12

6.

1.3.3.

.
.
TextFunctions.

,
Case of.
GraphFunctions.
, .
MainForm. ,
,
.
1.

13

1.4.

14

,
, .
.

1.4.

1. ,
;
2.
;
3. 2 (4)
;
4. ,
...;

5.
, ;
6. ,

, Alt+F4

.

1.5.


Windows 98, .NET.
.
,
.
.

.

15

.
. GraphBilder
v. 1.0 .


.

16

1. . . , . .
. ., , 1963. 168 .
2. . ., . ., . . .
. : . , 1979. 320 .
3. PscalABC.NET http://pascalabc.net
4. .. 7.0. : .
.: , 2006. 576 .

17

1.
MainForm.pas

Unit MainForm;
#apptype windows //
#reference 'System.Windows.Forms.dll'
#reference 'System.Drawing.dll'
{$resource 'Save.png'}
Interface
Uses System, System.Windows.Forms, System.Drawing,
TextFunctions, GraphFunctions;
Const
TextFileExt = 'graph'; //

TextFileFilter = '
(*.'+TextFileExt+')|*.'+TextFileExt;
ImageFileExt = 'bmp'; //

ImageFileFilter = '
(*.'+ImageFileExt+')|*.'+ImageFileExt;
Var
Form_Main, Form_graph, Form_text, Form_next_1st,
Form_next_2nd: Form;
ToolStripMenu: ToolStrip;
MiFile: ToolStripMenuItem;
Button_mnext, Button_next, Button_Back_1st, Button_Back_2nd,
Button_cancel: Button;
RadioButton_text, RadioButton_graph: RadioButton;
Textbox_basic: Textbox;
Combobox_basic: Combobox;
PictureBox_basic: PictureBox;
Stringtemp:String;
N, K: Integer;
Field: array[1..4] of Integer;
Label_n: array[1..4] of &label;
Textbox_n: array[1..4] of textbox;
Procedure SaveFile_1st(FileName: String);

Procedure SaveFile_2nd(FileName: String);

///////////////

//
//

18

Procedure MenuSaveClick_1st(sender:Object;
args:System.EventArgs);
Procedure MenuSaveClick_2nd(Sender:Object;
args:System.EventArgs);
Procedure FormClose_Main(sEnder: Object; args:
System.EventArgs);
Procedure FormClose_1st(Sender: Object; args: System.EventArgs);
Procedure FormClose_2nd(Sender: Object; args: System.EventArgs);
Procedure KeyPressed_a(Sender: Object; e: KeyPressEventArgs);
Procedure KeyPressed_1st(Sender: Object; e: KeyPressEventArgs);
Procedure ButtonNext_1st(Sender: Object; e: EventArgs);
Procedure ButtonNext_2nd(Sender: Object; e: EventArgs);
Procedure ButtonBack_1st(Sender: Object; e: EventArgs);
Procedure ButtonBack_2nd(Sender: Object; e: EventArgs);
Procedure ButtonCancel(Sender: Object; e: EventArgs);
Procedure MyButtonClick_Text(Sender: Object; e: EventArgs);
Procedure Form_closing(Sender: Object; e:
System.ComponentModel.CancelEventArgs);
Procedure Form_closing_tg(Sender: Object; e:
System.ComponentModel.CancelEventArgs);
Procedure MyButtonClick_Graph;
///////////////
Procedure NomberItems(Var n:Integer); //

Function F_chx(var line:String):String; //

Procedure Case_Function_Text(n: Integer; StrTemp: String);
//

Procedure Case_Function_Graph(n: Integer); //




Procedure CreateFormNext_1st; // 2 -
Procedure CreateFormNext_2nd; // 3 -
Procedure CreateForm_Text; //

Procedure CreateForm_Graph; //

Procedure MainInterface; //
Implementation
Procedure SaveFile_1st(FileName: String);
Var
F1 := new System.IO.StreamWriter(FileName, false,
System.Text.Encoding.Unicode);
Begin
F1.Write(TextBox_basic.Text);
F1.Close;
End;
Procedure SaveFile_2nd(FileName: String);

19

Begin
Picturebox_basic.Image.Save(Filename,system.Drawing.Imaging.Imag
eFormat.Bmp);
End;
Procedure FormClose_Main(Sender: Object; args:
System.EventArgs);
Begin
Form_main.Close;
End;
Procedure FormClose_1st(Sender: Object; args: System.EventArgs);
Begin
Form_Text.Close;
End;
Procedure FormClose_2nd(Sender: Object; args: System.EventArgs);
Begin
Form_graph.Close;
End;
Procedure MenuSaveClick_1st(Sender:Object;
args:System.EventArgs);
Var
Sd :=new SaveFileDialog;
Begin
Sd.DefaultExt := TextFileExt;
Sd.Filter := TextFileFilter;
If Sd.ShowDialog = DialogResult.OK then
SaveFile_1st(Sd.FileName);
End;
Procedure MenuSaveClick_2nd(Sender:Object;
args:System.EventArgs);
Var
Sd := new SaveFileDialog;
Begin
Sd.DefaultExt := ImageFileExt;
Sd.Filter := ImageFileFilter;
If Sd.ShowDialog = DialogResult.OK then
SaveFile_2nd(sd.FileName);
End;
Procedure NomberItems(Var n:Integer);
Var
Temptext: String;
Begin
Temptext:= Combobox_basic.text;
n:= 16;
For i:Integer:= 1 to nx do
if Temptext = fx[i] then Begin
n:= i;

20

break;
End
End;
Procedure ButtonCancel(Sender: Object; e: EventArgs);
Var result: DialogResult;
Begin
result:= MessageBox.Show('
?','GraphBilder v. 1.0', Messageboxbuttons.YesNo,
MessageboxIcon.Question);
if result = System.Windows.Forms.DialogResult.Yes then
Form_main.Close;
End;
Procedure Case_Function_text(n:Integer; StrTemp: String);
Begin
Case n of
1:
begin
FSinX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
2:
Begin
FCosX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
3:
Begin
FTgX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);

21

While FuncsData1 <> nil do


Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
4:
Begin
FCtgX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
5:
Begin
FArcSinX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
6:
Begin
FArcCosX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);

22

End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
7:
Begin
FArcTgX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);;
End;
8:
Begin
FArcCtgX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
9:
Begin
FabsX(FuncsData1,StrTemp, field[1], field[2], field[3]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;

23

10:
Begin
FkX_b(FuncsData1,StrTemp, field[1], field[2]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(form_main);
End;
11:
Begin
FAXX_BX_C(FuncsData1,StrTemp, field[1], field[2],
field[3]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;
12:
Begin
FAXXX_B(FuncsData1,StrTemp, field[1], field[2], field[3]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;
13:
Begin
FXA(FuncsData1,StrTemp, field[1], field[3], field[2],
field[4]);
While FuncsData1 <> nil do
Begin

24

TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;
14:
Begin
FAX(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;
15:
Begin
FLog_A_X(FuncsData1,StrTemp, field[1], field[2], field[3],
field[4]);
While FuncsData1 <> nil do
Begin
TextBox_Basic.AppEndText(PopPunct(funcsData1) +
Environment.NewLine);
TextBox_Basic.AppEndText(Environment.NewLine);
End;
Form_next_2nd.hide;
Textbox_basic.ReadOnly:= true;
Textbox_basic.BackColor:= color.White;
Form_Text.ShowDialog(Form_main);
End;
End;
End;
Procedure Case_Function_Graph(n:Integer);
Begin
Case n of
1:
Begin
if field[2] <> 0 then GSinX(PictureBox_Basic, field[1],
field[2], field[3], field[4])

25

else
SolidLine(PictureBox_Basic,Field[1]*sin(field[3])+field[4]);
Form_graph.Controls.Add(Picturebox_Basic);
Form_graph.ShowDialog(Form_main);
End;
2:
Begin
if field[2] <> 0 then GCosX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*cos(field[3])+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
3:
Begin
if field[2] <> 0 then GTgX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*tan(field[3])+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
4:
Begin
if field[2] <> 0 then GCtgX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*(1/tan(field[3]))+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
5:
Begin
if field[2] <> 0 then GArcSinX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*arcsin(field[3])+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
6:
Begin
if field[2] <> 0 then GArcCosX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*arccos(field[3])+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);

26

Form_Graph.ShowDialog(Form_main);
End;
7:
Begin
if field[2] <> 0 then GArcTgX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else
SolidLine(PictureBox_Basic,Field[1]*arctan(field[3])+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
8:
Begin
if field[2] <> 0 then GArcCtgX(PictureBox_Basic, field[1],
field[2], field[3], field[4])
else SolidLine(PictureBox_Basic,field[1]*(arctan(field[3])+pi/2)+field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
9:
Begin
GAbsX(PictureBox_Basic, field[1], field[2], field[3]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
10:
Begin
GKX_B(PictureBox_Basic, field[1], field[2]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
11:
Begin
GAXX_BX_C(PictureBox_Basic, field[1], field[2], field[3]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
12:
Begin
GAXXX_B(PictureBox_Basic, field[1], field[2], field[3]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
13:
Begin

27

GXA(PictureBox_Basic, field[1], field[2], field[3],


field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
14:
Begin
GAX(PictureBox_Basic, field[1], field[2], field[3],
field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
15:
Begin
GLog_A_X(PictureBox_Basic, field[1], field[2], field[3],
field[4]);
Form_Graph.Controls.Add(PictureBox_Basic);
Form_Graph.ShowDialog(Form_main);
End;
End;
End;
procedure KeyPressed_1st(Sender: Object; e: KeyPressEventArgs);
Begin
if (not Char.IsDigit(e.KeyChar)) and (e.KeyChar<>'-') and
(e.KeyChar<> chr(8)) then
e.Handled := True
End;
procedure KeyPressed_a(Sender: Object; e: KeyPressEventArgs);
Begin
if not Char.IsDigit(e.KeyChar) and (e.KeyChar<> chr(8)) then
e.Handled := True
End;
Procedure ButtonNext_1st(Sender: Object; e: EventArgs);
Begin
NomberItems(n);
if n = 16 then MessageBox.Show(' ', '
',MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
else
Begin
Form_main.visible:= false;
CreateFormNext_1st;
End;
End;
Procedure ButtonNext_2nd(Sender: Object; e: EventArgs);
Var

28

ps:boolean;
tempstr:String;
Begin
NomberItems(n);
ps:= true;
For i:Integer:= 1 to k do
if Trim(Textbox_n[i].Text) = '' then
Field[i] := 0
else if Textbox_n[i].Text[1] = '-' then Begin tempstr:=
textbox_n[i].Text; delete(tempstr,1,1); field[i]:=
Integer.Parse(tempstr); field[i]:= -1*field[i] End
else
try
Field[i] := Integer.Parse(Textbox_n[i].Text);
except
on System.FormatException do
begin
MessageBox.Show(' ', '
',MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
ps:=false;
end;
end;
if (n = 15) and ((field[2]<=1) or (field[2]>10000)) and (ps =
true) then
Begin
messagebox.Show(' a
2 10000',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if (n = 13) and ((field[2]< -10000) or (field[2] > 10000)) and
(ps = true) then
Begin
messagebox.Show(' a
-10000 10000','
',MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
ps:= false;
End;
if (n = 14) and ((field[2]< -10000) or (field[2] > 10000)) and
(ps = true) then
Begin
messagebox.Show(' a
-10000 10000',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if (n = 14) and (field[2] = 0) and (ps = true) then
Begin
messagebox.Show(' a
0',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;

29

if ((field[1]<-10000) or (field[1]>10000)) and (ps = true)


then
Begin
messagebox.Show(' A
-10000 10000','
',MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
ps:= false;
End;
if field[1] = 0 then
Begin
messagebox.Show(' A
0',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if ((field[2]<-10000) or (field[2]>10000)) and (n<>13) and
(n<>15) and (ps = true) then
Begin
messagebox.Show(' '
+label_n[2].Text[1]+' -10000
10000',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if ((field[3]<-10000) or (field[3]>10000)) and (ps = true)
then
Begin
messagebox.Show(' '
+label_n[3].Text[1]+' -10000
10000',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if ((field[4]<-10000) or (field[4]>10000)) and (ps = true)
then
Begin
messagebox.Show(' '
+label_n[4].Text[1]+' -10000
10000',' ',MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
ps:= false;
End;
if ps = true then
Begin
Form_next_1st.Visible:= false;
CreateFormNext_2nd;
End;
End;
Procedure ButtonBack_1st(Sender: Object; e: EventArgs);
Begin
Form_main.Visible:= true;

30

Form_next_1st.visible:= false;;
End;
Procedure ButtonBack_2nd(Sender: Object; e: EventArgs);
Begin
Form_next_1st.Visible:= true;
Form_next_2nd.visible:= false;
End;
Procedure MyButtonClick_Text(Sender: Object; e: EventArgs);
Begin
if radiobutton_text.Checked = true then
Begin
NomberItems(n);
CreateForm_text;
Case_Function_text(n,Stringtemp);
End
else
if radiobutton_graph.Checked = true then MyButtonClick_Graph;
End;
Procedure Form_closing(Sender: Object; e:
System.ComponentModel.CancelEventArgs);
Var result: DialogResult;
Begin
result:= MessageBox.Show('
?','GraphBilder v. 1.0', Messageboxbuttons.YesNo,
MessageboxIcon.Question);
if result = System.Windows.Forms.DialogResult.Yes then
Form_main.Close
else
if result = System.Windows.Forms.DialogResult.No then
e.Cancel:= true;
End;
procedure MyButtonClick_Graph;
Begin
CreateForm_graph;
Case_Function_Graph(n);
End;
Procedure CreateFormNext_1st;
Var
Tempstr:String;
lgth: Integer;
move,j: Integer;
label_4, label_5: &label;
Begin
Form_next_1st:= new Form;
Form_next_1st := new Form;
Form_next_1st.Text := 'GraphBilder v. 1.0';
Form_next_1st.Font:= new Font('Times New Roman',11);

31

Form_next_1st.Width:= 450;
Form_next_1st.Height:= 210;
Form_next_1st.FormBorderStyle:= FormBorderStyle.FixedDialog;
Form_next_1st.MaximizeBox:= false;
Var ScreenWidth := Screen.PrimaryScreen.Bounds.Width;
Var ScreenHeight := Screen.PrimaryScreen.Bounds.Height;
Form_next_1st.left:= (ScreenWidth - Form_next_1st.Width) div
2;
Form_next_1st.top:= (ScreenHeight - Form_next_1st.Height) div
2;
label_4 := new &Label;
label_4.AutoSize := True;
label_4.Font:= new Font('Times New Roman',12, fontstyle.Bold);
label_4.Text := ' : ';
label_4.Top:= 30;
label_4.Left:= 20;
Form_next_1st.Controls.Add(label_4);
label_5 := new &Label;
label_5.AutoSize := True;
label_5.Text := '
'+chrunicode(402)+'(x) = '+combobox_basic.Text;
label_5.Top:= 54;
label_5.Left:= 22;
Form_next_1st.Controls.Add(label_5);
tempstr:= combobox_basic.Text;
lgth:= length(tempstr);
move:= 22;
j:= 1;
For i:Integer:= 1 to lgth do
Begin
if (tempstr[i] = '*') then
Begin
Label_n[j]:= new &label;
textbox_n[j]:= new TextBox;
Label_n[j].Text:= tempstr[i-1]+':';
Label_n[j].Left:= move;
textbox_n[j].Left:= move+30;
Label_n[j].Top:= 90;
textbox_n[j].Top:= 90;
Label_n[j].Width:= 20;
textbox_n[j].Width:= 40;
textbox_n[j].KeyPress += KeyPressed_1st;
inc(move,90);
Form_next_1st.Controls.Add(label_n[j]);
Form_next_1st.Controls.Add(textbox_n[j]);
inc(j);
End
else
if (tempstr[i] = '+') and ((i+1 = lgth) or (lgth >= 11) or
(i+4 = lgth) or (i+5 = lgth) and (tempstr[i+2]<>'*')) then
Begin
Label_n[j]:= new &label;
textbox_n[j]:= new TextBox;

32

Label_n[j].Text:= tempstr[i+1]+':';
textbox_n[j].Left:= move+30;
Label_n[j].Left:= move;
Label_n[j].Top:= 90;
textbox_n[j].Top:= 90;
Label_n[j].Width:= 20;
textbox_n[j].Width:= 40;
inc(move,90);
textbox_n[j].KeyPress += KeyPressed_1st;
Form_next_1st.Controls.Add(label_n[j]);
Form_next_1st.Controls.Add(textbox_n[j]);
inc(j);
End
else
if (tempstr[i] = 'a') or (tempstr[i] = chrunicode(8336)) or
(tempstr[i] = chrunicode(7491)) then
Begin
Label_n[j]:= new &label;
textbox_n[j]:= new TextBox;
Label_n[j].Text:= 'a:';
textbox_n[j].Left:= move+30;
Label_n[j].Left:= move;
Label_n[j].Top:= 90;
textbox_n[j].Top:= 90;
Label_n[j].Width:= 20;
textbox_n[j].Width:= 40;
if n<>13 then textbox_n[j].KeyPress += KeyPressed_a
else textbox_n[j].KeyPress += KeyPressed_1st;
inc(move,90);
Form_next_1st.Controls.Add(label_n[j]);
Form_next_1st.Controls.Add(textbox_n[j]);
inc(j);
End
End;
Button_next:= new Button;
Button_next.AutoSize := True;
Button_next.Height:= 30;
Button_next.Text:= ' >';
Button_next.Left:= 190;
Button_next.Top:= 130;
Button_next.Click += ButtonNext_2nd;
Form_next_1st.Controls.Add(Button_next);
Button_back_1st:= new Button;
Button_back_1st.AutoSize := True;
Button_back_1st.Height:= 30;
Button_back_1st.Text:= '< ';
Button_back_1st.Left:= 100;
Button_back_1st.Top:= 130;
Button_back_1st.Click += Buttonback_1st;
Form_next_1st.Controls.Add(Button_back_1st);
Button_cancel:= new Button;
Button_cancel.AutoSize := True;
Button_cancel.Height:= 30;

33

Button_cancel.Text:= '';
Button_cancel.Left:= 280;
Button_cancel.Top:= 130;
Button_cancel.Click += ButtonCancel;
Form_next_1st.Controls.Add(Button_cancel);
Form_next_1st.Show;
Form_next_1st.Closing += Form_closing;
k:= j-1;
End;
Function F_chx(Var line:String):String;
Var
Tempstr:String;
m:Integer;
Begin
m:= pos('A',line);
Delete(line,m,2);
Case field[1] of
-10000..-2: Begin
tempstr:= inttostr(field[1]);
Insert(tempstr,Line,m);
End;
2..10000: Begin
tempstr:= inttostr(field[1]);
Insert(tempstr,Line,m);
End;
-1: Begin
Insert('-',Line,m);
End;
End;
For i:Integer:= 2 to k do
Begin
if PosEx('t',line,m)<>0 then
Begin
case n of
1..3,5..7: m:= posEx('t',line,m);
4: m:= posEx('(t',line,m)+1;
8: m:= posEx('(t',line,m)+1;
End;
Delete(line,m,2);
Case field[2] of
-10000..-2, 2..10000:
Begin
tempstr:= inttostr(field[2]);
Insert(tempstr,Line,m);
End;
-1:
Begin
tempstr:= '-';
Insert(tempstr,Line,m)
End;
0:
Begin

34

Delete(line,m,2);
dec(m,2);
End;
1:
Begin
tempstr:= '';
Insert(tempstr,Line,m);
End;
End;
End
else
if PosEx('a',line,m)<>0 then
Begin
m:= posEx('a',line,m);
Delete(line,m,1);
tempstr:= inttostr(field[2]);
Insert(tempstr,Line,m);
End
else
if PosEx('B',line,m)<>0 then
Begin
m:= posEx('B',line,m);
Case n of
9, 10:
Begin
tempstr:= inttostr(field[2]);
Case field[2] of
-10000..-1:
Begin
Delete(line,m-1,2);
Insert(tempstr,Line,m-1)
End;
1..10000:
Begin
Delete(line,m,1);
Insert(tempstr,Line,m)
End;
0:
Begin
Delete(line,m-1,2);
dec(m);
End;
End;
End;
11:Begin
Case field[2] of
-10000..-2:
Begin
tempstr:= inttostr(field[2]);
Delete(line,m-1,3);
Insert(tempstr,Line,m-1)
End;
2..10000:

35

Begin
tempstr:= inttostr(field[2]);
Delete(line,m,2);
Insert(tempstr,Line,m)
End;
-1:
Begin
tempstr:= '-';
Delete(line,m-1,3);
Insert(tempstr,Line,m-1)
End;
0:
Begin
Delete(line,m-1,4);
End;
1:
Begin
Delete(line,m,2);
dec(m);
End;
End;
End;
12, 13:
Begin
tempstr:= inttostr(field[2]);
Case field[2] of
-10000..-1:
Begin
Delete(line,m-1,2);
Insert(tempstr,Line,m-1)
End;
1..10000:
Begin
Delete(line,m,1);
Insert(tempstr,Line,m)
End;
0:
Begin
Delete(line,m-1,2);
dec(m);
End;
End;
End;
1..8, 14, 15:
Begin
tempstr:= inttostr(field[3]);
Case field[3] of
-10000..-1:
Begin
Delete(line,m-1,2);
Insert(tempstr,Line,m-1)
End;
1..10000:

36

Begin
Delete(line,m,1);
Insert(tempstr,Line,m)
End;
0:
Begin
if field[2]<>0 then Delete(line,m-1,2)
else
Begin
delete(line,m,1);
insert('0',line,m);
End;
dec(m);
End;
End;
End;
End;
End
else
if (PosEx('C',line,m)<>0) and (line[abs(PosEx('C',line,m)1)] <> 'o') then
Begin
m:= posEx('C',line,m);
Case n of
1..8, 13..15:
Begin
tempstr:= inttostr(field[4]);
Case field[4] of
-10000..-1:
Begin
Delete(line,m-1,2);
Insert(tempstr,Line,m-1)
End;
1..10000:
Begin
Delete(line,m,1);
Insert(tempstr,Line,m)
End;
0:
Begin
Delete(line,m-1,2);
dec(m);
End;
End;
End;
9, 11, 12: Begin
tempstr:= inttostr(field[3]);
Case field[3] of
-10000..-1:
Begin
Delete(line,m-1,2);
Insert(tempstr,Line,m-1)
End;

37

1..10000:
Begin
Delete(line,m,1);
Insert(tempstr,Line,m)
End;
0:
Begin
Delete(line,m-1,2);
dec(m);
End;
End;
End;
End;
End
End;
F_chx:= line;
End;
Procedure CreateFormNext_2nd;
Var
label_5: &label;
strtemp: String;
Begin
strtemp:= combobox_basic.text;
Form_next_2nd:= new Form;
Form_next_2nd:= new Form;
Form_next_2nd.Text := 'GraphBilder v. 1.0';
Form_next_2nd.Font:= new Font('Times New Roman',11);
Form_next_2nd.Width:= 450;
Form_next_2nd.Height:= 280;
Form_next_2nd.FormBorderStyle:= FormBorderStyle.FixedDialog;
Form_next_2nd.MaximizeBox:= false;
Var ScreenWidth := Screen.PrimaryScreen.Bounds.Width;
Var ScreenHeight := Screen.PrimaryScreen.Bounds.Height;
Form_next_2nd.left:= (ScreenWidth - Form_next_2nd.Width) div
2;
Form_next_2nd.top:= (ScreenHeight - Form_next_2nd.Height) div
2;
label_5 := new &Label;
label_5.AutoSize := True;
Stringtemp:= f_chx(strtemp);
label_5.Text := ' '+chrunicode(402)+'(x) = '+
Stringtemp;
label_5.Top:= 40;
label_5.Left:= 79;
Radiobutton_text:= new RadioButton;
Radiobutton_text.Text:= ' ';
Radiobutton_text.Width:= 190;
Radiobutton_text.Left:= 100;
Radiobutton_text.Top:= 110;
Form_next_2nd.Controls.Add(radiobutton_text);
Radiobutton_graph:= new RadioButton;
Radiobutton_graph.Text:= ' ';

38

Radiobutton_graph.Width:= 220;
Radiobutton_graph.Left:= 100;
Radiobutton_graph.Top:= 140;
Form_next_2nd.Controls.Add(radiobutton_graph);
Button_next:= new Button;
Button_next.AutoSize := True;
Button_next.Height:= 30;
Button_next.Text:= ' >';
Button_next.Left:= 190;
Button_next.Top:= 200;
Button_next.Click += MyButtonClick_text;
Form_next_2nd.Controls.Add(Button_next);
Button_back_2nd:= new Button;
Button_back_2nd.AutoSize := True;
Button_back_2nd.Height:= 30;
Button_back_2nd.Text:= '< ';
Button_back_2nd.Left:= 100;
Button_back_2nd.Top:= 200;
Button_back_2nd.Click += ButtonBack_2nd;
Form_next_2nd.Controls.Add(Button_back_2nd);
Button_cancel:= new Button;
Button_cancel.AutoSize := True;
Button_cancel.Height:= 30;
Button_cancel.Text:= '';
Button_cancel.Left:= 280;
Button_cancel.Top:= 200;
Button_cancel.Click += ButtonCancel;
Form_next_2nd.Controls.Add(Button_cancel);
Form_next_2nd.Controls.Add(label_5);
Form_next_2nd.Closing += Form_closing;
Form_next_2nd.Show;
End;
Procedure Form_closing_tg(Sender: Object; e:
System.ComponentModel.CancelEventArgs);
Begin
Form_next_2nd.visible:= true;
End;
Procedure CreateForm_text;
Begin
Form_Text := new Form;
Form_Text.Text := ' ' +
Stringtemp;
Form_Text.Size:= new System.Drawing.Size(605,650);
Form_Text.FormBorderStyle:= FormBorderStyle.FixedDialog;
Form_Text.MaximizeBox:= false;
Form_Text.MinimizeBox:= false;
TextBox_Basic := new TextBox;
TextBox_Basic.Multiline := True;
TextBox_Basic.Height := 590;
TextBox_Basic.Width := 600;
TextBox_Basic.Top:= 30;

39

TextBox_Basic.AcceptsReturn:= true;
TextBox_Basic.AcceptsTab:= true;
TextBox_Basic.ScrollBars:= scrollbars.both;
TextBox_Basic.Font := new System.Drawing.Font('Times new
roman',12);
Form_Text.Controls.Add(TextBox_Basic);
ToolStripMenu := new ToolStrip;
ToolStripMenu.GripStyle :=
System.Windows.Forms.ToolStripGripStyle.Hidden;
miFile := new ToolStripMenuItem('');
miFile.DropDownItems.Add(new ToolStripMenuItem('
...',new
System.Drawing.Bitmap(GetResourceStream('Save.png')),MenuSaveCli
ck_1st));
miFile.DropDownItems.Add(new
ToolStripMenuItem('',nil,FormClose_1st));
ToolStripMenu.Items.Add(miFile);
Form_Text.Controls.Add(ToolStripMenu);
Form_text.Closing += Form_closing_tg;
End;
Procedure CreateForm_graph;
Begin
Form_Graph := new Form;
Form_Graph.Text := ' ' + Stringtemp;
Form_Graph.Size:= new System.Drawing.Size(680,680);
Form_Graph.FormBorderStyle:= FormBorderStyle.FixedDialog;
Form_Graph.MaximizeBox:= false;
Form_Graph.MinimizeBox:= false;
Var ScreenWidth := Screen.PrimaryScreen.Bounds.Width;
Var ScreenHeight := Screen.PrimaryScreen.Bounds.Height;
Form_Graph.left:= (ScreenWidth - Form_Graph.Width) div 2;
Form_Graph.top:= (ScreenHeight - Form_Graph.Height) div 2;
ToolStripMenu := new ToolStrip;
ToolStripMenu.GripStyle :=
System.Windows.Forms.ToolStripGripStyle.Hidden;
miFile := new ToolStripMenuItem('');
miFile.DropDownItems.Add(new ToolStripMenuItem('
...',new
System.Drawing.Bitmap(GetResourceStream('Save.png')),MenuSaveCli
ck_2nd));
miFile.DropDownItems.Add(new
ToolStripMenuItem('',nil,FormClose_2nd));
ToolStripMenu.Items.Add(miFile);
Form_Graph.Controls.Add(ToolStripMenu);
Form_graph.Closing += Form_closing_tg;
End;
Procedure MainInterface;
Var
label_2, Label_3, Label_1: &Label;
Begin
Funs_inititial;

40

Form_main := new Form;


Form_main.Text := 'GraphBilder v. 1.0';
Form_main.Font:= new Font('Times New Roman',11);
Form_main.Width:= 400;
Form_main.Height:= 180;
Form_main.FormBorderStyle:= FormBorderStyle.FixedDialog;
Form_main.MaximizeBox:= false;
Form_main.Left:= 400;
Form_main.Top:= 300;
Var ScreenWidth := Screen.PrimaryScreen.Bounds.Width;
Var ScreenHeight := Screen.PrimaryScreen.Bounds.Height;
Form_main.left:= (ScreenWidth - Form_main.Width) div 2;
Form_main.top:= (ScreenHeight - Form_main.Height) div 2;
label_1 := new &Label;
label_1.AutoSize := True;
label_1.Font:= new Font('Times New Roman',12, fontstyle.Bold);
label_1.Text := ' : ';
label_1.Top:= 40;
label_1.Left:= 20;
Form_main.Controls.Add(label_1);
label_2 := new &Label;
label_2.AutoSize := True;
label_2.Text := ' ';
label_2.Top:= 60;
label_2.Left:= 22;
Form_main.Controls.Add(label_2);
label_3 := new &Label;
label_3.AutoSize := True;
label_3.Text := chrunicode(402)+'(x) = ';
label_3.Top:= 90;
label_3.Left:= 22;
Form_main.Controls.Add(label_3);
combobox_basic:= new combobox;
combobox_basic.Height := 70;
combobox_basic.Width := 186;
combobox_basic.Left:= 70;
combobox_basic.Top:= 85;
combobox_basic.Font := new System.Drawing.Font('Times New
Roman',14);
For i:Integer:= 1 to nx do
combobox_basic.Items.add(fx[i]);
combobox_basic.BackColor:= color.White;
Form_main.Controls.Add(combobox_basic);
Button_mnext:= new Button;
Button_mnext.AutoSize := True;
Button_mnext.Height:= 30;
Button_mnext.Text:= ' >';
Button_mnext.Left:= 270;
Button_mnext.Top:= 84;
Button_mnext.Click += ButtonNext_1st;
Form_main.Controls.Add(Button_mnext);
toolStripmenu := new ToolStrip;

41

toolStripmenu .GripStyle :=
System.Windows.Forms.ToolStripGripStyle.Hidden;
miFile := new ToolStripMenuItem('');
miFile.DropDownItems.Add(new
ToolStripMenuItem('',Nil,FormClose_main));
toolStripmenu .Items.Add(miFile);
Form_main.Controls.Add(toolStripmenu );
Application.Run(Form_main);
End;
Initialization
Finalization
End.

Вам также может понравиться