• Tidak ada hasil yang ditemukan

Perancangan Kamus Digital Bahasa Indonesia – Nias Dengan Efek Suara Menggunakan Visual Basic 6.0

N/A
N/A
Protected

Academic year: 2017

Membagikan "Perancangan Kamus Digital Bahasa Indonesia – Nias Dengan Efek Suara Menggunakan Visual Basic 6.0"

Copied!
13
0
0

Teks penuh

(1)

LAMPIRAN 1

Kode Program Menu Utama

Private Sub tengah()

Me.Left = (Screen.Width - Me.Width) / 2 Me.Top = (Screen.Height - Me.Height) / 2 End Sub

Private Sub about_Click() frmAbout.Show

End Sub

Private Sub CmdIndNis_Click() frmMain.Show

Unload Me End Sub

Private Sub Command1_Click() frmMain2.Show

Unload Me End Sub

Private Sub indonesianias_Click() frmMain2.Show

End Sub

Private Sub kamushelp_Click() FormHelp.Show

End Sub

Private Sub keluar_Click() Unload Me

End Sub

Private Sub niasindonesia_Click() frmMain.Show

End Sub

(2)

Private Sub Timer2_Timer() Me.Width = Me.Width + 100 tengah

If Me.Width >= 6020 Then Timer2.Enabled = False tengah

End If End Sub

Private Sub what_Click() FormWhat.Show

End Sub

LAMPIRAN 2

Kode Program FrmMain2 (Indonesia – Nias)

Private Declare Function PlaySound Lib "winmm.dll" Alias _

"PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, _

ByVal dwFlags As Long) As Long

Public Function PlayWaveFile(strFileName As String, Optional blnAsync As Boolean) As Boolean

Dim lngFlags As Long Const snd_sync = &H0 Const snd_Async = &H1 Const snd_Nodefault = &H2 Const snd_Filename = &H20000

lngFlags = snd_Nodefault Or snd_Filename Or snd_sync If blnAsync Then lngFlags = lngFlags Or snd_Async PlayWaveFile = PlaySound(strFileName, 0&, lngFlags) End Function

Private Sub about_Click() frmAbout.Show

frmMain2.Hide End Sub

Private Sub CmdKembali_Click() FormKamus.Show

frmMain2.Hide End Sub

(3)

strSQL = "Select suara from NiasIndonesia where Istilahdesc ='" & txtWord.Text & "'"

Set rssuara = New ADODB.Recordset rssuara.Open strSQL, gAdoConn If Not rssuara.EOF Then

retval = PlayWaveFile(App.Path & rssuara!suara, True) Else

MsgBox "error" End If

End Sub

Private Sub cmdDelete_Click() Dim strDelete As String

strDelete = "Delete from NiasIndonesia Where Id = " & gintIdItem.Text & ""

gAdoConn.Execute strDelete PopData (strTextSearch) txtWord.Text = ""

txtMeaning.Text = "" End Sub

Private Sub cmdNew_Click() txtWord.Text = "" txtMeaning.Text = "" End Sub

Private Sub cmdSave_Click() Dim strSQL As String

Dim rs As ADODB.Recordset

If txtWord.Text = "" Then

MsgBox "Masukkan Kata. ", vbExclamation, "Alert" Exit Sub

End If

If txtMeaning.Text = "" Then

MsgBox "Masukkan Arti Kata.", vbExclamation, "Alert" Exit Sub

End If

strSQL = "Insert into

NiasIndonesia(IstilahDesc,Istilah)Values('" & SQLSafe(txtWord.Text) & "','" & _

SQLSafe(txtMeaning.Text) & "')" gAdoConn.Execute strSQL

(4)

txtMeaning.Text = "" End Sub

Private Sub cmdUpdate_Click() Dim strUpdate As String

strUpdate = "Update NiasIndonesia Set IstilahDesc = '" & SQLSafe(txtWord) & "'," & _

"Istilah = '" & SQLSafe(txtMeaning) & "' Where Id = " & gintIdItem & ""

gAdoConn.Execute strUpdate PopData (strTextSearch) txtWord.Text = ""

txtMeaning.Text = "" End Sub

Private Sub Command2_Click() FormKamus.Show

End Sub

Private Sub exit_Click() Unload Me

End Sub

Private Sub Form_Load() Me.Caption = App.Title InitConnection

PopData (strTextSearch) End Sub

Private Sub kamushelp_Click() FormHelp.Show

End Sub

Private Sub keluar_Click() Unload Me

End Sub

Private Sub lstView_ItemClick(ByVal Item As

MSComctlLib.ListItem)

Dim intSelItem As Integer

intSelItem = Item

txtWord.Text =

(5)

txtMeaning.Text = lstView.ListItems(intSelItem).ListSubItems(2).Text

gintIdItem =

lstView.ListItems(intSelItem).ListSubItems(3).Text End Sub

Private Sub mnuAbout_Click() frmAbout.Show

End Sub

Private Sub mnuExit_Click() End

End Sub

Private Sub InitConnection() Dim conDBString As String

conDBString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\Kamus.mdb"

Set gAdoConn = New ADODB.Connection

gAdoConn.ConnectionString = conDBString gAdoConn.Open

End Sub

Private Sub PopData(strTextSearch As String)

Dim lstX As ListItem Dim strSQL As String Dim rs As ADODB.Recordset

Dim intCounter As Integer If strTextSearch = "" Then

strSQL = "select * from NiasIndonesia Order by IstilahDesc ASC"

Else

strSQL = "Select * from NiasIndonesia IstilahDesc " & _ "where IstilahDesc like '%" & strTextSearch & "%' order by IstilahDesc asc"

End If

Set rs = New ADODB.Recordset

rs.Open strSQL, gAdoConn, 3, 1

(6)

With rs

If .RecordCount > 0 Then .MoveFirst

intCounter = 1 While Not .EOF

Set lstX = lstView.ListItems.Add(, , intCounter) lstX.ListSubItems.Add = Trim(!IstilahDesc) lstX.ListSubItems.Add = Trim(!Istilah) lstX.ListSubItems.Add = Trim(!Id) intCounter = intCounter + 1

.MoveNext Wend End If End With End Sub

Private Sub niasindonesia_Click() frmMain.Show

frmMain2.Hide End Sub

Private Sub txtSearch_Change() PopData (txtSearch.Text) End Sub

Private Sub whatthis_Click() FormWhat.Show

End Sub

LAMPIRAN 3

Kode Program FrmMain (Nias – Indonesia)

Private Declare Function PlaySound Lib "winmm.dll" Alias _

"PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, _

ByVal dwFlags As Long) As Long

(7)

Dim lngFlags As Long Const snd_sync = &H0 Const snd_Async = &H1 Const snd_Nodefault = &H2 Const snd_Filename = &H20000

lngFlags = snd_Nodefault Or snd_Filename Or snd_sync If blnAsync Then lngFlags = lngFlags Or snd_Async PlayWaveFile = PlaySound(strFileName, 0&, lngFlags) End Function

Private Sub about_Click() frmAbout.Show

frmMain.Hide End Sub

Private Sub cmdDelete_Click() Dim strDelete As String

strDelete = "Delete from NiasIndonesia Where Id = " & gintIdItem.Text & ""

gAdoConn.Execute strDelete PopData (strTextSearch) txtWord.Text = ""

txtMeaning.Text = "" End Sub

Private Sub CmdKembali_Click() FormKamus.Show

frmMain.Hide End Sub

Private Sub cmdNew_Click() txtWord.Text = "" txtMeaning.Text = "" End Sub

Private Sub cmdSave_Click() Dim strSQL As String

Dim rs As ADODB.Recordset

If txtWord.Text = "" Then

MsgBox "Masukkan Kata. ", vbExclamation, "Alert" Exit Sub

End If

If txtMeaning.Text = "" Then

(8)

End If

strSQL = "Insert into

NiasIndonesia(Istilah,IstilahDesc)Values('" & SQLSafe(txtWord.Text) & "','" & _

SQLSafe(txtMeaning.Text) & "')" gAdoConn.Execute strSQL

PopData (strTextSearch) txtWord.Text = ""

txtMeaning.Text = "" End Sub

Private Sub cmdUpdate_Click() Dim strUpdate As String

strUpdate = "Update NiasIndonesia Set Istilah = '" & SQLSafe(txtWord) & "'," & _

"IstilahDesc = '" & SQLSafe(txtMeaning) & "' Where Id = " & gintIdItem & ""

gAdoConn.Execute strUpdate PopData (strTextSearch) txtWord.Text = ""

txtMeaning.Text = "" End Sub

Private Sub Command1_Click()

strSQL = "Select suara from NiasIndonesia where Istilah ='" & txtWord.Text & "'"

Set rssuara = New ADODB.Recordset rssuara.Open strSQL, gAdoConn If Not rssuara.EOF Then

retval = PlayWaveFile(App.Path & rssuara!suara, True) Else

MsgBox "error" End If

End Sub

Private Sub Form_Load() Me.Caption = App.Title InitConnection

PopData (strTextSearch) End Sub

(9)

frmMain2.Show frmMain.Hide End Sub

Private Sub keterangan_Click() FormHelp.Show

End Sub

Private Sub kamushelp_Click() FormHelp.Show

End Sub

Private Sub keluar_Click() Unload Me

End Sub

Private Sub lstView_ItemClick(ByVal Item As

MSComctlLib.ListItem)

Dim intSelItem As Integer intSelItem = Item

txtWord.Text =

lstView.ListItems(intSelItem).ListSubItems(1).Text

txtMeaning.Text =

lstView.ListItems(intSelItem).ListSubItems(2).Text

gintIdItem =

lstView.ListItems(intSelItem).ListSubItems(3).Text End Sub

Private Sub mnuAbout_Click() frmAbout.Show

End Sub

Private Sub mnuExit_Click() End

End Sub

Private Sub InitConnection() Dim conDBString As String

conDBString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\Kamus.mdb"

Set gAdoConn = New ADODB.Connection

gAdoConn.ConnectionString = conDBString gAdoConn.Open

End Sub

Private Sub PopData(strTextSearch As String)

(10)

Dim strSQL As String Dim rs As ADODB.Recordset

Dim intCounter As Integer If strTextSearch = "" Then

strSQL = "select * from NiasIndonesia Order by Istilah ASC"

Else

strSQL = "Select * from NiasIndonesia Istilah " & _ "where Istilah like '%" & strTextSearch & "%' order by Istilah asc"

End If

Set rs = New ADODB.Recordset

rs.Open strSQL, gAdoConn, 3, 1

lstView.ListItems.Clear With rs

If .RecordCount > 0 Then .MoveFirst

intCounter = 1 While Not .EOF

Set lstX = lstView.ListItems.Add(, , intCounter) lstX.ListSubItems.Add = Trim(!Istilah)

lstX.ListSubItems.Add = Trim(!IstilahDesc) lstX.ListSubItems.Add = Trim(!Id)

intCounter = intCounter + 1 .MoveNext

Wend End If End With End Sub

Private Sub txtSearch_Change() PopData (txtSearch.Text) End Sub

Private Sub whatthis_Click() FormWhat.Show

End Sub

LAMPIRAN 4

Kode Program Kamus Help

(11)

Text1.Visible = False Text2.Visible = True Text3.Visible = False End Sub

Private Sub Cmd2_Click() Text1.Visible = False Text2.Visible = False Text3.Visible = True End Sub

Private Sub Cmd3_Click() Text1.Visible = True Text2.Visible = False Text3.Visible = False End Sub

Private Sub Form_Load() Text1.Visible = False Text2.Visible = False Text3.Visible = False End Sub

LAMPIRAN 5

Kode Program What’s This

Private Sub cmdDelete_Click() Text1.Visible = False

Text2.Visible = False Text3.Visible = False Text4.Visible = False Text5.Visible = False Text6.Visible = True End Sub

(12)

Text1.Visible = False Text2.Visible = False Text3.Visible = False Text4.Visible = True Text5.Visible = False Text6.Visible = False End Sub

Private Sub cmdNew_Click() Text1.Visible = False

Text2.Visible = False Text3.Visible = True Text4.Visible = False Text5.Visible = False Text6.Visible = False End Sub

Private Sub cmdSave_Click() Text1.Visible = False

Text2.Visible = False Text3.Visible = False Text4.Visible = False Text5.Visible = True Text6.Visible = False End Sub

Private Sub cmdUpdate_Click() Text1.Visible = False

Text2.Visible = True Text3.Visible = False Text4.Visible = False Text5.Visible = False Text6.Visible = False End Sub

Private Sub Command1_Click() Text1.Visible = True

Text2.Visible = False Text3.Visible = False Text4.Visible = False Text5.Visible = False Text6.Visible = False End Sub

(13)

Text5.Visible = False Text6.Visible = False End Sub

LAMPIRAN 6

Kode Program About

Private Sub cmdClose_Click() FormKamus.Show

frmAbout.Hide End Sub

LAMPIRAN 7

Module

Public gAdoConn As ADODB.Connection

Public Function SQLSafe(strValue As String) As String Dim strTemp1 As String

strTemp1 = Replace(strValue, "'", "''")

Referensi

Dokumen terkait

[r]

A tree-environment-crop interaction equation is derived in which the overall tree effect on crop production is explained as a balance of (positive and negative) relative net

In connection with the above, thus proposed that this meeting give the authority and/or power of the Board of Directors and/or Corporate Secretary of the

Jika tombol baca spinner di-click, maka teks label nilai akan berubah sesuai nilai dari spinner. Jika spinner tanggal diubah nilainya oleh

substansi berkaitan dengan perlindungan dan pengelolaan lingkungan hidup, serta kesehatan manusia dari dampak merkuri, sebagai berikut:. Undang-Undang Nomor 17 Tahun

[r]

bahwa berdasarkan pertimbangan sebagaimana dimaksud huruf a, perlu menetapkan Keputusan Bupati Bantul tentang Pembentukan Tim Pembantu Sekretariat Panitia Pengadaan Tanah

[r]