home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / create6r / frmnewga.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-02-21  |  4.4 KB  |  146 lines

  1. VERSION 5.00
  2. Begin VB.Form frmnewgame 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00FFFFFF&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "New Game"
  7.    ClientHeight    =   2385
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   4275
  11.    Icon            =   "frmnewgame.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   159
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   285
  18.    StartUpPosition =   3  'Windows Default
  19.    Begin VB.CommandButton Command2 
  20.       BackColor       =   &H80000002&
  21.       Caption         =   "Cancel"
  22.       Height          =   375
  23.       Left            =   2280
  24.       TabIndex        =   5
  25.       Top             =   1800
  26.       Width           =   855
  27.    End
  28.    Begin VB.CommandButton Command1 
  29.       BackColor       =   &H80000002&
  30.       Caption         =   "Ok"
  31.       Height          =   375
  32.       Left            =   3240
  33.       TabIndex        =   4
  34.       Top             =   1800
  35.       Width           =   855
  36.    End
  37.    Begin VB.OptionButton Option4 
  38.       BackColor       =   &H80000002&
  39.       Caption         =   "Visitor"
  40.       Enabled         =   0   'False
  41.       ForeColor       =   &H80000009&
  42.       Height          =   255
  43.       Left            =   240
  44.       Style           =   1  'Graphical
  45.       TabIndex        =   3
  46.       Top             =   1200
  47.       Width           =   1335
  48.    End
  49.    Begin VB.OptionButton Option3 
  50.       BackColor       =   &H80000002&
  51.       Caption         =   "Host"
  52.       Enabled         =   0   'False
  53.       ForeColor       =   &H80000009&
  54.       Height          =   255
  55.       Left            =   240
  56.       Style           =   1  'Graphical
  57.       TabIndex        =   2
  58.       Top             =   840
  59.       Width           =   1335
  60.    End
  61.    Begin VB.OptionButton Option2 
  62.       BackColor       =   &H80000002&
  63.       Caption         =   "Oline Game"
  64.       ForeColor       =   &H80000009&
  65.       Height          =   375
  66.       Left            =   240
  67.       Style           =   1  'Graphical
  68.       TabIndex        =   1
  69.       Top             =   240
  70.       Width           =   1815
  71.    End
  72.    Begin VB.OptionButton Option1 
  73.       BackColor       =   &H80000002&
  74.       Caption         =   "Offline Game"
  75.       ForeColor       =   &H80000009&
  76.       Height          =   375
  77.       Left            =   2280
  78.       Style           =   1  'Graphical
  79.       TabIndex        =   0
  80.       Top             =   240
  81.       Value           =   -1  'True
  82.       Width           =   1815
  83.    End
  84. Attribute VB_Name = "frmnewgame"
  85. Attribute VB_GlobalNameSpace = False
  86. Attribute VB_Creatable = False
  87. Attribute VB_PredeclaredId = True
  88. Attribute VB_Exposed = False
  89. Private Sub Command1_Click()
  90. 'On Error Resume Next
  91. If Not Connected And Not PlayOffline Then GoTo j2
  92.  If Connected Then
  93.   If PlayOffline Then
  94.     frmChess.SockClient.SendData "#020code#quitegame"
  95.     frmChess.HChessBoard1.EraseBoard
  96.     GoTo j2
  97.   End If
  98.   Dim d
  99.   If JoueurHote Then
  100.    d = "Hote"
  101.   Else
  102.    d = "No"
  103.   End If
  104.   'MsgBox "Envoi les donnees"
  105.   frmChess.SockClient.SendData "#020code#wantnewga" & d
  106.   frmChess.HChessBoard1.EraseBoard
  107.   Unload Me
  108.   frmWaitting.Show 1
  109.   Exit Sub
  110.  End If
  111. Unload Me
  112. NameNIP.Show 1
  113. End Sub
  114. Private Sub Command2_Click()
  115. Unload Me
  116. End Sub
  117. Private Sub Form_Load()
  118. OutSquare 0, 0, ScaleWidth - 1, ScaleHeight, Me
  119. InSquare Option1.Left, Option1.Top, Option1.Width - 1, Option1.Height, Me
  120. InSquare Option2.Left, Option2.Top, Option2.Width - 1, Option2.Height, Me
  121. InSquare Option3.Left, Option3.Top, Option3.Width - 1, Option3.Height, Me
  122. InSquare Option4.Left, Option4.Top, Option4.Width - 1, Option4.Height, Me
  123. InSquare Command1.Left, Command1.Top, Command1.Width - 1, Command1.Height, Me
  124. InSquare Command2.Left, Command2.Top, Command2.Width - 1, Command2.Height, Me
  125. JoueurHote = True
  126. PlayOffline = True
  127. Left = frmChess.Left + ((frmChess.Width - Width) / 2)
  128. Top = frmChess.Top + ((frmChess.Height - Height) / 2)
  129. End Sub
  130. Private Sub Option1_Click()
  131. 'On Error Resume Next
  132. Option3.Enabled = False: Option4.Enabled = False
  133. JoueurHote = True: PlayOffline = True
  134. End Sub
  135. Private Sub Option2_Click()
  136. 'On Error Resume Next
  137. Option3.Enabled = True: Option4.Enabled = True
  138. PlayOffline = False
  139. End Sub
  140. Private Sub Option3_Click()
  141. JoueurHote = True
  142. End Sub
  143. Private Sub Option4_Click()
  144. JoueurHote = False
  145. End Sub
  146.