-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphEdit.cpp
61 lines (58 loc) · 1.96 KB
/
GraphEdit.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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "GraphEdit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tf_GraphEdit *f_GraphEdit;
//---------------------------------------------------------------------------
__fastcall Tf_GraphEdit::Tf_GraphEdit(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tf_GraphEdit::b_UpdateClick(TObject *Sender)
{
if(e_Name->Text == "")
ShowMessage("Must have a Name");
if( l_SaveName->Caption != e_Name->Text
&& f_CPUNode->NodeNameExists(e_Name->Text))
{
ShowMessage("Name Already Exists");
} else {
if(e_PosX->Text == "")
ShowMessage("Must have a X");
else if(e_PosY->Text == "")
ShowMessage("Must have a Y");
else {
if(e_PinIDInUp->Text == "")
e_PinIDInUp->Text = "0";
if(e_PinIDInDown->Text == "")
e_PinIDInDown->Text = "0";
if(e_PinIDOutUp->Text == "")
e_PinIDOutUp->Text = "0";
if(e_PinIDOutDown->Text == "")
e_PinIDOutDown->Text = "0";
f_CPUNode->UpdateNode();
}
}
}
//---------------------------------------------------------------------------
void __fastcall Tf_GraphEdit::b_deleteClick(TObject *Sender)
{
if (Application->MessageBox( L"Delete Node ?", L"Delete Node", MB_YESNO) == mrYes)
{
cb_Delete->Checked = true;
f_CPUNode->UpdateNode();
}
}
//---------------------------------------------------------------------------
void __fastcall Tf_GraphEdit::e_NameOutUpKeyPress(TObject *Sender, char &Key)
{
if(Key == VK_RETURN )
this->b_UpdateClick(Sender);
else if(Key == VK_DELETE )
this->b_delete->Click();
}
//---------------------------------------------------------------------------