tagCANDY CGI VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
[ツリー表示へ]  [ワード検索]  [Home]

タイトル Re^4: 経過時間の算出部分と表示部分の処理はできました。
投稿日: 2008/03/05(Wed) 14:17
投稿者tea
琴さん、回答をいただき本当にありがとうございます。
ご意見をいただいて私なりに追加したコードは以下ですが、
これを実行すると1回目にコマンドボタンをクリックすると
所定の位置に正しく「経過時間の数字」がでますが、色(赤
もしくは黒)が黒になります。正しくは赤です。
また、その後2回目にコマンドボタンをクリックすると、今
までと同様に2回目の経過時間の数字「3」が1回目の場所に
も表示されます。

実に勘所の悪い私ですが、どうか教えてください。
よろしくお願いします。

標準モジュール内に
Public Const bbTimeMin = 1
Public Const bbTimeMax = 7

Public Enum bbTime
    bbNothingQuarterTimeOutTime = -1
    bbPracticeQuarterTimeOutTime = 0
    bb1QuarterTimeOutTime = 1
    bb2QuarterTimeOutTime = 2
    bb3QuarterTimeOutTime = 3
   bb4QuarterTimeOutTime = 4
    bb5QuarterTimeOutTime = 5
    bbExtraQuarter1TimeOutTime = 6
    bbExtraQuarter2TimeOutTime = 7
    bbEndOfQuarterTimeOutTime = 8
End Enum

Teamクラス内に
Option Explicit
AnElapsedTime(bbTimeMin To bbTimeMax) As Integer

Public Property Get AnElapsedTime(ByVal Index As bbTime) As Integer
    AnElapsedTime = mp.AnElapsedTime(Index)
End Property

Public Property Let AnElapsedTime(ByVal Index As bbTime, _
                ByVal NewValue As Integer)
    With mp
        'NewValueの値に変更'
        .AnElapsedTime(Index) = NewValue
        .IsDirty = True
    End With
End Property

Private Sub clearResultWithoutPlayers()
Dim i As Long

    With mp
        For i = bbTimeOutMin To bbTimeOutMax
            .TimeOutted(i) = False
        Next
        '---新規追加-----------------------------
        For i = bbTimeMin To bbTimeMax
            .AnElapsedTime(i) = False
        Next
        For i = bbQuarterMin To bbQuarterMax
            .QuarterScore(i) = False
            .QuarterFoulCount(i) = False
        Next
        .IsDirty = True
    End With
End Sub

PrintEngineクラス内に
Public Sub TimeOutMinutes(ByVal Col As Single, _
                           ByVal Row As Single, _
                           ByVal Cols As Single, _
                           ByVal Rows As Single, _
                           ByVal Index As bbTime, _
                           Optional ByVal Color As Variant = Empty, _
                           Optional ByVal Font As Object = Nothing)

Dim Text As Integer
Dim A As Integer
Dim Alignment As EAlignment33
    
    Call AnElapsedTime
    
    Text = mp.A
    
    With makeMatrixRect(Col, Row, Cols, Rows)
        drawText .Left + 0.2, .Top + 0.05, .Right, .Bottom, _
            Text, Alignment, Color, Font
    End With
    
End Sub

'経過時間計算
Public Sub AnElapsedTime()
Dim A As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
    
    b = Game.Setting.QuarterMinutes
    c = Left(frmMain.vsGameTime.Value / 60, 1)
    d = b - c
        
    mp.A = d
    
End Sub

RScoresheetCommanderフォーム内に
'チャージドタイムアウトの表示切替。
Private Sub drawTeam(ByVal PE As PrintEngine, _
                     ByVal Left As Single, ByVal Top As Single, _
                     ByVal LeftColWidth As Single, ByVal RightColWidth As Single, ByVal TeamFoulMarginWidth As Single, ByVal TeamFaulColWidth As Single, _
                     ByVal RowHeight As Single, _
                     ByVal TeamMarginHeight As Single)

            ixRow = ixRow + 1
            For i = bbTimeOutMin To bbTimeOutMax
            
                .DrawMatrixBox i, ixRow, 1, 1
                
                If mp.Game.Team(ixTeam).TimeOutted(i) Then
                    If mp.Game.Team(ixTeam).AnElapsedTime(i) <> -1 Then
                        '「経過時間」を表示する-----------------
                        .TimeOutMinutes i, ixRow, 1, 1, _
            colorByQuarter(mp.Game.Team(ixTeam).TimeOutted(i))
                    End If
                Else
                    '「=」ダブルラインを表示する。
                    .DrawMatrixCenterDoubleLine i, ixRow, 1, 0.95, _
                    colorByQuarter(mp.Game.Team(ixTeam).TimeOutted(i))
                End If
            
            Next

- 関連一覧ツリー をクリックするとツリー全体を一括表示します)

古いスレッドにレスはつけられません。