-
Notifications
You must be signed in to change notification settings - Fork 0
/
FightResultUnit.cpp
49 lines (45 loc) · 1.64 KB
/
FightResultUnit.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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "FightResultUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//TFightResultForm *FightResultForm;
//---------------------------------------------------------------------------
__fastcall TFightResultForm::TFightResultForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void TFightResultForm::LoadPlayerNames(AnsiString player1, AnsiString player2)
{
WinnerBox->Clear();
WinnerBox->Items->Add(player1);
WinnerBox->Items->Add(player2);
WinnerBox->ItemIndex = 0;
}
void TFightResultForm::LoadWinReasons(TStringList &winReasons)
{
WinReasonBox->Clear();
WinReasonBox->Items->Text = winReasons.Text;
}
void __fastcall TFightResultForm::OKBtnClick(TObject *Sender)
{
if (Trim(WinReasonBox->Text) == "" || Trim(WinnerBox->Text) == "")
{
ShowMessage("Âñå ïîëÿ äîëæíû áûòü çàïîëíåíû");
ModalResult = mrNone;
};
}
//---------------------------------------------------------------------------
void __fastcall TFightResultForm::FormCreate(TObject *Sender)
{
//âûñòàâëÿåì ïîëîæåíèå îêíà ïî öåíòðó
if (Screen->MonitorCount > 1)
{
this->Left = (Screen->Monitors[0]->Width - this->Width) / 2;
this->Top = (Screen->Monitors[0]->Height - this->Height) / 2;
};
}
//---------------------------------------------------------------------------