⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grvbdialog.frm

📁 机器人程序
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form NewGameFrm 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "开始新游戏"
   ClientHeight    =   3915
   ClientLeft      =   11985
   ClientTop       =   3960
   ClientWidth     =   3285
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3915
   ScaleMode       =   0  'User
   ScaleWidth      =   3275.875
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Visible         =   0   'False
   Begin VB.OptionButton PlayWithComputer 
      Caption         =   "在电脑上下"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1800
      TabIndex        =   15
      Top             =   1560
      Width           =   1215
   End
   Begin VB.OptionButton PlayWithRobot 
      Caption         =   "和机器人下"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   14
      Top             =   1560
      Width           =   1455
   End
   Begin VB.ComboBox ComWhite 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1320
      Style           =   2  'Dropdown List
      TabIndex        =   12
      Top             =   1200
      Width           =   1695
   End
   Begin VB.ComboBox ComBlack 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      ItemData        =   "GRVBDialog.frx":0000
      Left            =   1320
      List            =   "GRVBDialog.frx":0002
      Style           =   2  'Dropdown List
      TabIndex        =   11
      Top             =   840
      Width           =   1695
   End
   Begin VB.CommandButton btnCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   350
      Left            =   1680
      TabIndex        =   10
      Top             =   3480
      Width           =   1335
   End
   Begin VB.CommandButton btnOK 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   350
      Left            =   240
      TabIndex        =   0
      Top             =   3480
      Width           =   1335
   End
   Begin VB.TextBox txtKomi 
      BeginProperty DataFormat 
         Type            =   1
         Format          =   "0.00"
         HaveTrueFalseNull=   0
         FirstDayOfWeek  =   0
         FirstWeekOfYear =   0
         LCID            =   2052
         SubFormatType   =   1
      EndProperty
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   270
      Left            =   1320
      TabIndex        =   9
      Text            =   "2.75"
      Top             =   2880
      Width           =   1695
   End
   Begin VB.TextBox txtManName 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   270
      Left            =   1320
      TabIndex        =   7
      Text            =   "无名氏"
      Top             =   1935
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.TextBox txtHandicap 
      BeginProperty DataFormat 
         Type            =   1
         Format          =   "0"
         HaveTrueFalseNull=   0
         FirstDayOfWeek  =   0
         FirstWeekOfYear =   0
         LCID            =   2052
         SubFormatType   =   1
      EndProperty
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   270
      Left            =   1320
      TabIndex        =   4
      Text            =   "0"
      Top             =   2400
      Width           =   1455
   End
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   270
      Left            =   2775
      TabIndex        =   3
      Top             =   2400
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   476
      _Version        =   393216
      BuddyControl    =   "txtHandicap"
      BuddyDispid     =   196617
      OrigLeft        =   3360
      OrigTop         =   1440
      OrigRight       =   3600
      OrigBottom      =   1710
      Max             =   9
      SyncBuddy       =   -1  'True
      BuddyProperty   =   0
      Enabled         =   -1  'True
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   1
      X1              =   119.667
      X2              =   3111.333
      Y1              =   720
      Y2              =   720
   End
   Begin VB.Label Label6 
      Caption         =   "您可以在电脑上下棋,也可以和机器人下棋。"
      BeginProperty Font 
         Name            =   "新宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   13
      Top             =   140
      Width           =   2655
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   0
      X1              =   119.667
      X2              =   3111.333
      Y1              =   3360
      Y2              =   3360
   End
   Begin VB.Label Label5 
      Caption         =   "贴目"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   2880
      Width           =   615
   End
   Begin VB.Label textName 
      Caption         =   "您的姓名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   6
      Top             =   1995
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "让子"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   2445
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "黑方"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   885
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "白方"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   1260
      Width           =   615
   End
End
Attribute VB_Name = "NewGameFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'form NewGameFrm
'“开始新游戏” 对话框

'- - - - - - - - - - - - - - - - - - - - - - - - - -
'窗体

Private Sub Form_Load()
  Initialize_All
  Init_Opt
  
  txtManName.Text = optManName
  txtHandicap.Text = optHandicap
  txtKomi.Text = optKomi
  'load opt
  ComBlack.AddItem "您自己"
  ComBlack.AddItem "电脑"
  ComWhite.AddItem "您自己"
  ComWhite.AddItem "电脑"
  '默认
  ComBlack.ListIndex = 0
  ComWhite.ListIndex = 1
  
  PlayWithRobot = True
End Sub

'- - - - - - - - - - - - - - - - - - - - - - - - - -
'Button

'确定
Private Sub btnOK_Click()
  If PlayWithRobot = True Then
    If InitSucceed = False Then
      'Robby.Play "greet"
      GRSpeak "找不到摄像头或红外发射塔,请检查上述设备是否连接正确!"
      'Robby.Play "blink"
      Exit Sub
    End If
    optPlayWith = PLAY_ROBOT
  ElseIf PlayWithComputer = True Then
    optPlayWith = PLAY_COMPUTER
  End If
  
  
  optManName = txtManName.Text
  optHandicap = Val(txtHandicap.Text)
  optKomi = Val(txtKomi.Text)

  If ComBlack.ListIndex = PLAYER_MAN And _
     ComWhite.ListIndex = PLAYER_MAN _
  Then
    GRSpeak "您要和自己下棋吗?"
  Else
    optBlackPlayer = ComBlack.ListIndex
    optWhitePlayer = ComWhite.ListIndex
    
    If ComBlack.ListIndex = PLAYER_ROBOT And _
       ComWhite.ListIndex = PLAYER_ROBOT _
    Then 'Robot vs Robot
      optMode = MODE_RvsR
      Me.Hide
      GRVBMain.Enabled = True
      GRVBMain.Show
      Play_RvsR
    Else 'Robot vs Human
      optMode = MODE_MvsR
      Me.Hide
      GRVBMain.Enabled = True
      GRVBMain.Show
      Play_MvsR
    End If
  End If

End Sub

'取消
Private Sub btnCancel_Click()
  Me.Hide
  GRVBMain.Enabled = True
  GRVBMain.Show
End Sub

'- - - - - - - - - - - - - - - - - - - - - - - - - -
'组合框
Private Sub ComBlack_Click()
  If ComBlack.ListIndex = PLAYER_ROBOT And _
     ComWhite.ListIndex = PLAYER_ROBOT _
  Then
    txtManName.Visible = False
    textName.Visible = False
  Else
    txtManName.Visible = True
    textName.Visible = True
  End If
End Sub

Private Sub ComWhite_Click()
  If ComBlack.ListIndex = PLAYER_ROBOT And _
     ComWhite.ListIndex = PLAYER_ROBOT _
  Then
    txtManName.Visible = False
    textName.Visible = False
  Else
    txtManName.Visible = True
    textName.Visible = True
  End If
End Sub


'- - - - - - - - - - - - - - - - - - - - - - - - - -

'txtManName , when got focus
Private Sub txtKomi_GotFocus()
  txtKomi.SelStart = 0
  txtKomi.SelLength = Len(txtKomi.Text)
End Sub

Private Sub txtManName_GotFocus()
  txtManName.SelStart = 0
  txtManName.SelLength = Len(txtManName.Text)
End Sub

'- - - - - - - - - - - - - - - - - - - - - - - - - -

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -