69 lines
2.0 KiB
C++
69 lines
2.0 KiB
C++
//---------------------------------------------------------------------------
|
|
|
|
#include <vcl.h>
|
|
#pragma hdrstop
|
|
|
|
#include "Bet03FrameUnit.h"
|
|
#include "PolicyUnit.h"
|
|
//---------------------------------------------------------------------------
|
|
#pragma package(smart_init)
|
|
#pragma resource "*.dfm"
|
|
TBet03Frame *Bet03Frame = NULL;
|
|
//---------------------------------------------------------------------------
|
|
__fastcall TBet03Frame::TBet03Frame(TComponent* Owner)
|
|
: TFrame(Owner)
|
|
{
|
|
m_leBlP->Text = g_BPDiffBet.diff[0];
|
|
m_lePlB->Text = g_BPDiffBet.diff[1];
|
|
|
|
// m_rgBlP->ItemIndex = g_BPDiffBet.bet[0] - 1;
|
|
// m_rgPlB->ItemIndex = g_BPDiffBet.bet[1] - 1;
|
|
m_edBlP->Text = g_BPDiffBet.bets[0];
|
|
m_edPlB->Text = g_BPDiffBet.bets[1];
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TBet03Frame::DiffEditExit(TObject *Sender)
|
|
{
|
|
TEdit* pE = (TEdit*)Sender;
|
|
|
|
int num = 0;
|
|
if(!TryStrToInt(pE->Text, num) || num<=0 || num>=30 ){
|
|
ShowMessage("请输入 1 - 30 之间的差值");
|
|
pE->Text = "5";
|
|
pE->SetFocus();
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TBet03Frame::BetEditKeyPress(TObject *Sender, System::WideChar &Key)
|
|
{
|
|
if(Key<0x1E)
|
|
return;
|
|
|
|
if(Key!='a' && Key!='s' && Key!='d' && Key!='x' && Key!='z')
|
|
Key = 0;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TBet03Frame::BetEditExit(TObject *Sender)
|
|
{
|
|
TEdit* pE = (TEdit*)Sender;
|
|
String txt = pE->Text;
|
|
if(txt.Length()==0 || txt.Length()>15){
|
|
ShowMessage("请输入 1 - 15 个下注项");
|
|
pE->Text = pE==m_edBlP ? g_BPDiffBet.bets[0] : g_BPDiffBet.bets[1];
|
|
pE->SetFocus();
|
|
}
|
|
else{
|
|
for(int i=1; i<=txt.Length(); i++){
|
|
char Key = txt[i];
|
|
if(Key!='a' && Key!='s' && Key!='d' && Key!='x' && Key!='z'){
|
|
ShowMessage("请按说明输入合法下注项");
|
|
pE->SetFocus();
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|