• Tidak ada hasil yang ditemukan

Tampilan Menu Utama

Tampilan Menu Jumlah Antrian Yang Akan Dimasukkan

Tampilan Menu About

Listing Program Menu Utama

Dim no_antri, no_antri_panggil As Integer Dim Sounds(16) As String

Sub panggil_L1()

Dim arrJumlahKarakterSpasi() As String

arrJumlahKarakterSpasi = Split(txtTerbilang.Text, " ")

Call sndPlaySound(App.Path & "\Sounds\nomor-urut.wav", SND_NOSTOP) For i = LBound(arrJumlahKarakterSpasi) To UBound(arrJumlahKarakterSpasi)

Call sndPlaySound(App.Path & "\Sounds\" & arrJumlahKarakterSpasi(i) & ".wav", SND_NOSTOP)

Call sndPlaySound(App.Path & "\Sounds\loket.wav", SND_NOSTOP) Call sndPlaySound(App.Path & "\Sounds\satu.wav", SND_NOSTOP) End Sub

Private Sub Command1_Click() If no_antri_panggil < no_antri Then no_antri_panggil = no_antri_panggil + 1 Label4.Caption = no_antri_panggil txtTerbilang.Text = Trim(Bilang(Label4.Caption)) text1.Text = Trim(Bilang(Label4.Caption)) Call panggil_L1 no_antri = no_antri - 1 Label9.Caption = no_antri End If End Sub Sub panggil_L2()

Dim arrJumlahKarakterSpasi() As String

arrJumlahKarakterSpasi = Split(txtTerbilang.Text, " ")

Call sndPlaySound(App.Path & "\Sounds\nomor-urut.wav", SND_NOSTOP) For i = LBound(arrJumlahKarakterSpasi) To UBound(arrJumlahKarakterSpasi)

Call sndPlaySound(App.Path & "\Sounds\" & arrJumlahKarakterSpasi(i) & ".wav", SND_NOSTOP)

Next

Call sndPlaySound(App.Path & "\Sounds\loket.wav", SND_NOSTOP) Call sndPlaySound(App.Path & "\Sounds\dua.wav", SND_NOSTOP) End Sub

Private Sub Command2_Click()

Dim arrJumlahKarakterSpasi() As String arrJumlahKarakterSpasi = Split(text1.Text, " ")

Call sndPlaySound(App.Path & "\Sounds\nomor-urut.wav", SND_NOSTOP) For i = 0 To UBound(arrJumlahKarakterSpasi)

Call sndPlaySound(App.Path & "\Sounds\" & arrJumlahKarakterSpasi(i) & ".wav", SND_NOSTOP)

Next

Call sndPlaySound(App.Path & "\Sounds\loket.wav", SND_NOSTOP) Call sndPlaySound(App.Path & "\Sounds\satu.wav", SND_NOSTOP) End Sub

Private Sub Command3_Click() If no_antri_panggil < no_antri Then no_antri_panggil = no_antri_panggil + 1 Label5.Caption = no_antri_panggil txtTerbilang.Text = Trim(Bilang(Label5.Caption)) text2.Text = Trim(Bilang(Label5.Caption)) Call panggil_L2 no_antri = no_antri - 1 Label9.Caption = no_antri End If End Sub

Private Sub Command4_Click()

arrJumlahKarakterSpasi = Split(text2.Text, " ")

Call sndPlaySound(App.Path & "\Sounds\nomor-urut.wav", SND_NOSTOP) For i = 0 To UBound(arrJumlahKarakterSpasi)

Call sndPlaySound(App.Path & "\Sounds\" & arrJumlahKarakterSpasi(i) & ".wav", SND_NOSTOP)

Next

Call sndPlaySound(App.Path & "\Sounds\loket.wav", SND_NOSTOP) Call sndPlaySound(App.Path & "\Sounds\dua.wav", SND_NOSTOP) End Sub

Private Sub Command5_Click() no_antri = 0 no_antri_panggil = 0 Label4.Caption = no_antri_panggil Label5.Caption = no_antri_panggil label3.Caption = no_antri Label9.Caption = no_antri text1.Text = "" text2.Text = "" Command6.Enabled = False End Sub

Private Sub Command6_Click() label3.Visible = True

Label6.Visible = False

no_antri = no_antri + Val(Textantri.Text) label3.Caption = no_antri

Label9.Caption = no_antri End Sub

Private Sub Command7_Click() Form2.Show

label3.Visible = False Label6.Visible = True End Sub

Private Sub Form_Load() Me.KeyPreview = True no_antri = 0

no_antri_panggil = 0

Sounds(1) = App.Path & "\Sounds\satu.wav" Sounds(2) = App.Path & "\Sounds\dua.wav" Sounds(3) = App.Path & "\Sounds\tiga.wav" Sounds(4) = App.Path & "\Sounds\empat.wav" Sounds(5) = App.Path & "\Sounds\lima.wav" Sounds(6) = App.Path & "\Sounds\enam.wav" Sounds(7) = App.Path & "\Sounds\tujuh.wav" Sounds(8) = App.Path & "\Sounds\delapan.wav" Sounds(9) = App.Path & "\Sounds\sembilan.wav" Sounds(10) = App.Path & "\Sounds\sepuluh.wav" Sounds(11) = App.Path & "\Sounds\sebelas.wav" Sounds(12) = App.Path & "\Sounds\puluh.wav" Sounds(13) = App.Path & "\Sounds\ratus.wav" Sounds(14) = App.Path & "\Sounds\belas.wav"

Sounds(15) = App.Path & "\Sounds\nomor-urut.wav" Sounds(16) = App.Path & "\Sounds\loket.wav" End Sub

Private Sub mnAbout_Click() about.Show

End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call Command6_Click If KeyAscii = 43 Then Call Command7_Click If KeyAscii = 49 Then Call Command1_Click If KeyAscii = 50 Then Call Command2_Click If KeyAscii = 51 Then Call Command3_Click If KeyAscii = 52 Then Call Command4_Click

End Sub

Private Sub mnExit_Click() End

End Sub

Listing Program Menu Jumlah

Dim no_antri, no_antri_panggil As Integer Private Sub Command1_Click()

Form1.Textantri = Text1.Text Form1.Command6.Enabled = True Unload Me

End Sub

Private Sub Command2_Click() Unload Me

End Sub

Private Sub Command3_Click() Text1.Text = ""

End Sub

Private Sub Form_Activate() Text1.SetFocus

'Text1.Text = 100 'Command1_Click End Sub

Listing Program Menu About Option Explicit

Dim CreditLine() As String Dim CreditLeft() As Long Dim ColorFades(100) As Long Dim ScrollSpeed As Integer Dim ColText As Long Dim FadeIn As Long Dim FadeOut As Long Dim cDiff1 As Long Dim cDiff2 As Double Dim cDiff3 As Double Dim TotalLines As Integer Dim LinesOffset As Integer Dim Yscroll As Long Dim CharHeight As Integer Dim LinesVisible As Integer Private Sub Form_Load() Dim FileO As Integer Dim fileName As String Dim tmp As String Dim i As Integer Dim Rcol1 As Long Dim Gcol1 As Long Dim Bcol1 As Long Dim Rcol2 As Long Dim Gcol2 As Long Dim Bcol2 As Long Dim Rfade As Long Dim Gfade As Long Dim Bfade As Long Dim PercentFade As Integer Dim TimeInterval As Integer Dim AlignText As Integer PercentFade = 20 TimeInterval = 10 ScrollSpeed = 15 AlignText = 2

LinesVisible = (picCredits.Height / picCredits.TextHeight("A")) + 1 For i = 1 To LinesVisible

ReDim Preserve CreditLine(TotalLines) As String CreditLine(TotalLines) = tmp

TotalLines = TotalLines + 1 Next

FileO = FreeFile

fileName = App.Path & "\AboutCompany.txt" If Dir(fileName) = "" Then

GoTo errHandler End If

On Error GoTo errHandler

Open fileName For Input As FileO While Not EOF(FileO)

Line Input #FileO, tmp

ReDim Preserve CreditLine(TotalLines) As String CreditLine(TotalLines) = tmp

TotalLines = TotalLines + 1 Wend

Close #FileO

Me.Timer1.Interval = TimeInterval

LinesVisible = (picCredits.Height / picCredits.TextHeight("A")) + 1 CharHeight = picCredits.TextHeight("A")

If PercentFade <> 0 Then

FadeOut = ((picCredits.Height / 100) * PercentFade) - CharHeight FadeIn = (picCredits.Height - FadeOut) - CharHeight - CharHeight Else FadeIn = picCredits.Height FadeOut = 0 - CharHeight End If ColText = picCredits.ForeColor

cDiff1 = (picCredits.Height - (CharHeight - 10)) - FadeIn cDiff2 = 100 / cDiff1

cDiff3 = 100 / FadeOut

ReDim CreditLeft(TotalLines - 1) For i = 0 To TotalLines - 1 Select Case AlignText Case 1

CreditLeft(i) = 100 Case 2

CreditLeft(i) = (picCredits.Width - picCredits.TextWidth(CreditLine(i))) / 2 Case 3

CreditLeft(i) = picCredits.Width - picCredits.TextWidth(CreditLine(i)) - 100 End Select

Next i

Rcol1 = picCredits.ForeColor Mod 256

Gcol1 = (picCredits.ForeColor And vbGreen) / 256 Bcol1 = (picCredits.ForeColor And vbBlue) / 65536 Rcol2 = picCredits.BackColor Mod 256

Gcol2 = (picCredits.BackColor And vbGreen) / 256 Bcol2 = (picCredits.BackColor And vbBlue) / 65536 For i = 0 To 100

Rfade = Rcol2 + ((Rcol1 - Rcol2) / 100) * i: If Rfade < 0 Then Rfade = 0 Gfade = Gcol2 + ((Gcol1 - Gcol2) / 100) * i: If Gfade < 0 Then Gfade = 0

Bfade = Bcol2 + ((Bcol1 - Bcol2) / 100) * i: If Bfade < 0 Then Bfade = 0 ColorFades(i) = RGB(Rfade, Gfade, Bfade)

Next

Me.Timer1.Enabled = True Exit Sub

errHandler: Close FileO

MsgBox "Could not load Credits", vbCritical, " Credits Demo" End Sub

Private Sub Label1_Click(Index As Integer) Unload Me

End Sub

Private Sub Timer1_Timer() Dim Ycurr As Long Dim TextLine As Integer Dim ColPrct As Long Dim i As Integer picCredits.Cls

Yscroll = Yscroll - ScrollSpeed If Yscroll < (0 - CharHeight) Then Yscroll = 0

LinesOffset = LinesOffset + 1

If LinesOffset > TotalLines - 1 Then LinesOffset = 0 End If

picCredits.CurrentY = Yscroll Ycurr = Yscroll

For i = 1 To LinesVisible

If Ycurr > FadeIn And Ycurr < picCredits.Height Then ColPrct = cDiff2 * (cDiff1 - (Ycurr - FadeIn)) If ColPrct < 0 Then ColPrct = 0

If ColPrct > 100 Then ColPrct = 100

picCredits.ForeColor = ColorFades(ColPrct) ElseIf Ycurr < FadeOut Then

ColPrct = cDiff3 * Ycurr If ColPrct < 0 Then ColPrct = 0 If ColPrct > 100 Then ColPrct = 100

picCredits.ForeColor = ColorFades(ColPrct) Else

picCredits.ForeColor = ColText End If

TextLine = (i + LinesOffset) Mod TotalLines picCredits.CurrentX = CreditLeft(TextLine) picCredits.Print CreditLine(TextLine) Ycurr = Ycurr + CharHeight

Next i End Sub

Dokumen terkait