Public Schranka Public JeZmena As Boolean Public K Public Kam Public Radek Public PText Public CRadku Public AktX Public PocetN Public Mode Public Aktualni Public ZKolika Public Kde Private Sub b_Click(Index As Integer) Mode = 0 fil.SetFocus Select Case Index Case 0: GoTo prepni Case 1: prepni Aktualni - 1 Case 2: prepni Aktualni + 1 Case 4: GoTo Vymaz Case 5: Form2.tim.Interval = 1: Form2.Show 1 Case 6: PopupMenu Nabidka Case 7 ko = InputBox("Zadejte číslo osnovy (1/" + Str(CRadku) + "): ") If Val(ko) >= 1 And Val(ko) <= CRadku Then Aktualni = ko: prepni Aktualni Else Exit Sub If Val(ko) = CRadku Then b(2).Enabled = False Else b(2).Enabled = True If Val(ko) = 1 Then b(1).Enabled = False Else b(1).Enabled = True Case 3 If Kam >= PocetN - 1 Then MsgBox ("Řádek je plný!"): Exit Sub If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption l = Left(a, Kam) r = Right(a, Len(a) - Kam - 1) t = l + "~" + r If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t End Select Exit Sub prepni: ReDim Q(CRadku) ReDim W(CRadku) For i = 1 To CRadku Q(i) = Radek(i) W(i) = PText(i) Next ReDim Radek(CRadku + 1) ReDim PText(CRadku + 1) CRadku = CRadku + 1 Aktualni = Aktualni + 1 For i = 1 To Aktualni - 1 Radek(i) = Q(i) PText(i) = W(i) Next For i = 1 To 6 txt = txt + String(((Len(Radek(Aktualni - 1)) \ 6) - 1), "-") + "|" Next Radek(Aktualni) = txt PText(Aktualni) = " " If Aktualni = CRadku Then GoTo z For i = Aktualni + 1 To CRadku Radek(i) = Q(i - 1) PText(i) = W(i - 1) Next z: prepni Aktualni Nahled 0 Exit Sub Vymaz: a = MsgBox("Opravdu chcete vymazat tuto osnovu?", vbYesNo) If a = vbNo Then Exit Sub If CRadku = 1 Then For i = 1 To 6 txt = txt + String(90, "-") + "|" DopText.Text = " " Next Radek(Aktualni) = txt prepni (Aktualni) Nahled 0 Exit Sub: End If ReDim Q(CRadku) ReDim W(CRadku) If Aktualni = 1 Then GoTo ak1 For i = 1 To Aktualni - 1 Q(i) = Radek(i) W(i) = PText(i) Next ak1: If Aktualni = CRadku Then GoTo a2 For i = Aktualni + 1 To CRadku Q(i - 1) = Radek(i) W(i - 1) = PText(i) Next a2: If Aktualni = CRadku Then Aktualni = Aktualni - 1 CRadku = CRadku - 1 ReDim Radek(CRadku) ReDim PText(CRadku) For i = 1 To CRadku Radek(i) = Q(i) PText(i) = W(i) Next prepni Aktualni Nahled 0 Exit Sub End Sub Private Sub b_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) fil.SetFocus Fil_KeyDown KeyCode, Shift End Sub Private Sub b_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub DopText_Change() PText(Aktualni) = DopText.Text Nahled 0 End Sub Private Sub E1nota_Click() Klik 6 End Sub Private Sub Hnota_Click() Klik 6 Fil_KeyDown vbKeyDown, 0 End Sub Private Sub Gnota_Click() Klik 1 Fil_KeyDown vbKeyDown, 0 End Sub Private Sub Dnota_Click() Klik 2 Fil_KeyDown vbKeyDown, 0 End Sub Private Sub Anota_Click() Klik 3 Fil_KeyDown vbKeyDown, 0 End Sub Private Sub E2nota_Click() Klik 4 Fil_KeyDown vbKeyDown, 0 End Sub Private Sub DoLeva_Click() If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption t = Right(a, (Len(a) - 1)) t = Left(t, Len(t) - 1) + "-|" If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t fil.SetFocus End Sub Private Sub DoLeva_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub DoPrava_Click() If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption t = "-" + Left(a, (Len(a) - 1)) t = Left(t, Len(t) - 1) + "|" If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t fil.SetFocus End Sub Private Sub DoPrava_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub m_about_Click() ki = "O PROGRAMU TABLATURE MAKER:" + Chr(13) + Chr(13) ki = ki + Chr(13) + "Roku 2004 Vytvořil Jan Dvořák" ki = ki + Chr(13) + "E - mail: dvorkaman@centrum.cz" MsgBox (ki) End Sub Private Sub m_kopy_Click() Schranka = Radek(Aktualni) MsgBox ("Provedeno...") End Sub Private Sub m_na_Click() Form4.tim.Interval = 500: Form4.Show 1 End Sub Private Sub m_pri_Click() Form3.tx.Text = DopText.Text Form3.Show 1 End Sub Private Sub m_vlo_Click() If Schranka = "" Then MsgBox ("Ve schránce není žádná osnova!"): Exit Sub ot = MsgBox("Chcete nahradit obsah aktuální osnovy?", vbYesNo) If ot = vbNo Then Exit Sub Radek(Aktualni) = Schranka Nahled 0 prepni Aktualni End Sub Private Sub m_zam_Click() If m_zam.Checked = False Then m_zam.Checked = True: zamek1_.Visible = True Else m_zam.Checked = False: zamek1_.Visible = False End Sub Private Sub plus_Click() minus.Enabled = True If PocetN > 90 Then plus.Enabled = False: Exit Sub PocetN = PocetN + 1 For Kde = 1 To 6 If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption l = Left(a, Len(a) - 1) t = l + "-|" If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t Next Kam = -1 Kde = 6 Fil_KeyDown vbKeyDown, 0 Fil_KeyDown vbKeyRight, 0 akt Mode = 0 fil.SetFocus End Sub Private Sub plus_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub minus_Click() plus.Enabled = True If PocetN < 10 Then minus.Enabled = False: Exit Sub PocetN = PocetN - 1 For Kde = 1 To 6 If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption l = Left(a, Len(a) - 2) t = l + "|" If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t Next Kam = -1 Kde = 6 Fil_KeyDown vbKeyDown, 0 Fil_KeyDown vbKeyRight, 0 akt Mode = 0 fil.SetFocus End Sub Private Sub minus_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub repetice_Click() kk = Kde For Kde = 2 To 5 If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption l = Left(a, Kam) r = Right(a, Len(a) - Kam - 1) t = l + "|" + r If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t Next Kde = kk Mode = 0 fil.SetFocus End Sub Private Sub repetice_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Public Sub Fil_KeyDown(KeyCode As Integer, Shift As Integer) fil.Text = "" K = KeyCode Select Case KeyCode Case vbKeyPageUp: If Aktualni > 1 Then b_Click 1 Case vbKeyPageDown: If Aktualni < CRadku Then b_Click 2 Case vbKeyF4: m_pri_Click Case vbKeyF5: If Shift = 1 Then m_na_Click Case vbKeyF6: Form4.prehod Case vbKeyF12: m_zam_Click Case vbKeyHome: Kam = 0: GoTo BezKodu Case vbKeyEnd: Kam = PocetN - 1: GoTo BezKodu Case vbKeyF8: If minus.Enabled = True Then minus_Click Case vbKeyF9: If plus.Enabled = True Then plus_Click Case vbKeyF10: b_Click 5 Case vbKeyUp: Kde = Kde - 1: GoTo posun Case vbKeyDown: Kde = Kde + 1: GoTo posun Case 96 To 105: Kam = Kam + 2: GoTo Radek Case vbKeyDelete: Kam = Kam + 2: GoTo Radek Case vbKeyLeft: Kam = Kam - 1: K = "": GoTo Radek Case vbKeyRight: Kam = Kam + 1: K = "": GoTo Radek Case vbKeyInsert: Mode = 1: Spe.SetFocus End Select Exit Sub posun: 'Výběr řádku tablatury If Kde < 1 Then Kde = 6 If Kde > 6 Then Kde = 1 ag = &H0& bg = &H404040 E1nota.BackColor = ag Hnota.BackColor = ag Gnota.BackColor = ag Dnota.BackColor = ag Anota.BackColor = ag E2nota.BackColor = ag If Kde = 1 Then E1nota.BackColor = bg If Kde = 2 Then Hnota.BackColor = bg If Kde = 3 Then Gnota.BackColor = bg If Kde = 4 Then Dnota.BackColor = bg If Kde = 5 Then Anota.BackColor = bg If Kde = 6 Then E2nota.BackColor = bg Pos.Top = 60 + ((Kde - 1) * 240) Exit Sub Radek: ' Posun kurzoru po řádku If Kam > PocetN + 1 Then Kam = Kam - 2: Exit Sub If Kam < 0 Then Kam = Kam + 2: Exit Sub If K = "" Then GoTo BezKodu If Form4.Akord = "Zap" Then Zjisti K - 48: Exit Sub If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption If K = vbKeyDelete Then K = 93 z = Chr(K - 48) If m_zam.Checked = True Then z = "1" + z If Kam + 1 > PocetN + 1 And m_zam.Checked = True Then Exit Sub bb = Kam - 2 l = Left(a, bb) r = Right(a, Len(a) - bb - Len(z)) t = l + z + r If m_zam.Checked = True Then Kam = Kam + 1 If K = 93 Then Kam = Kam - 2 If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t akt BezKodu: Pos.Left = 320 + (Kam * 120) Exit Sub End Sub Private Sub Fil_LostFocus() If Mode = 1 Then Exit Sub If Form1.Enabled = True Then fil.SetFocus End Sub Private Sub Form_Load() If Command <> "" Then tim.Interval = 10: Exit Sub Kde = 1 PocetN = 90 Aktualni = 1 ZKolika = 1 CRadku = 1 JeZmena = False ReDim Radek(1) ReDim PText(1) PText(1) = " " For i = 1 To 6 txt = txt + String(90, "-") + "|" Next Radek(Aktualni) = txt prepni (Aktualni) Nahled 0 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 0 End Sub Private Sub Fra_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 0 End Sub Private Sub Smazat_Click() a = MsgBox("Opravdu chcete smazat obsah osnovy?", vbYesNo) If a = vbYes Then E1nota.Caption = String(PocetN, "-") + "|" Hnota.Caption = String(PocetN, "-") + "|" Gnota.Caption = String(PocetN, "-") + "|" Dnota.Caption = String(PocetN, "-") + "|" Anota.Caption = String(PocetN, "-") + "|" E2nota.Caption = String(PocetN, "-") + "|" DopText.Text = " " Kam = -1 Kde = 6 Fil_KeyDown vbKeyDown, 0 Fil_KeyDown vbKeyRight, 0 Mode = 1: fil.SetFocus End If akt End Sub Private Sub Smazat_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Mode = 1 End Sub Private Sub Spe_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 13 Then vloz_Click End Sub Private Sub tim_Timer() tim.Interval = 0 Form2.Comm = "AAA" Form2.Otevri End Sub Private Sub vloz_Click() If Kam + Len(Spe.Text) > PocetN Then MsgBox ("Řádek je plný!"): GoTo p If Kam > PocetN Then Kam = Kam - 2: Exit Sub If Kde = 1 Then a = E1nota.Caption If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption bb = Kam l = Left(a, bb) z = Spe.Text r = Right(a, Len(a) - bb - Len(z)) t = l + z + r If Kde = 1 Then E1nota.Caption = t If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t Kam = Kam + Len(z) + 1 Pos.Left = 320 + (Kam * 120) p: akt Mode = 0 fil.SetFocus End Sub Public Sub akt() JeZmena = True txt = E1nota.Caption + Hnota.Caption + Gnota.Caption + Dnota.Caption + Anota.Caption + E2nota.Caption Radek(Aktualni) = txt Nahled 0 End Sub Public Sub OpenIt(txt, ttr, kolik) kolik = kolik - 1 txt = Left(txt, Len(txt) - 1) ReDim Radek(kolik) ReDim PText(kolik) cc = 1 For i = 1 To Len(txt) zn = Mid(txt, i, 1) If zn <> Chr(10) Then o = o + zn If zn = Chr(10) Then Radek(cc) = o cc = cc + 1 o = "" End If Next odkad = 1 cis = 1 For i = 1 To Len(ttr) - 7 z = Mid(ttr, i, 7) If z = "*/-|-\*" Then PText(cis) = Mid(ttr, odkad, i - odkad - 2) odkad = i + 7 cis = cis + 1 i = i + 1 End If Next If cis = 1 Then GoTo pok For i = 2 To kolik PText(i) = Right(PText(i), Len(PText(i)) - 2) Next pok: Aktualni = 1 CRadku = kolik prepni (1) Nahled 0 JeZmena = False End Sub Public Sub DejNovy() Kde = 1 PocetN = 90 Aktualni = 1 ZKolika = 1 CRadku = 1 ReDim Radek(1) For i = 1 To 6 txt = txt + String(90, "-") + "|" Next Radek(Aktualni) = txt prepni (Aktualni) Nahled 0 End Sub Sub Zjisti(Cislo) o = Form4.Okolik p = Form4.Pocet If Kde = 1 Then GoTo Nejde If Kde = 2 And p = 3 Then GoTo Nejde If m_zam.Checked = True Then Cislo = Cislo + 10 Cislo = Cislo - 48 horni = Str((Cislo + o)) dolni = Str(Cislo) horni = Right(horni, Len(horni) - 1) dolni = Right(dolni, Len(dolni) - 1) If Kam + Len(horni) > PocetN + 2 Then Exit Sub If Len(horni) > Len(dolni) Then dolni = dolni + "-" If Kde = 2 Then a = Hnota.Caption If Kde = 3 Then a = Gnota.Caption If Kde = 4 Then a = Dnota.Caption If Kde = 5 Then a = Anota.Caption If Kde = 6 Then a = E2nota.Caption bb = Kam - 2 l = Left(a, bb) r = Right(a, Len(a) - bb - Len(dolni)) t = l + dolni + r If Kde = 2 Then Hnota.Caption = t If Kde = 3 Then Gnota.Caption = t If Kde = 4 Then Dnota.Caption = t If Kde = 5 Then Anota.Caption = t If Kde = 6 Then E2nota.Caption = t For i = Kde - 1 To Kde - p + 1 Step -1 If i = 1 Then a = E1nota.Caption If i = 2 Then a = Hnota.Caption If i = 3 Then a = Gnota.Caption If i = 4 Then a = Dnota.Caption If i = 5 Then a = Anota.Caption bb = Kam - 2 l = Left(a, bb) r = Right(a, Len(a) - bb - Len(horni)) t = l + horni + r If i = 1 Then E1nota.Caption = t If i = 2 Then Hnota.Caption = t If i = 3 Then Gnota.Caption = t If i = 4 Then Dnota.Caption = t If i = 5 Then Anota.Caption = t Next If Len(horni) = 2 Then Kam = Kam + 1 Fil_KeyDown vbKeyRight, 0 Fil_KeyDown vbKeyLeft, 0 akt Exit Sub Nejde: Kam = Kam - 2 beep: End Sub Public Q Public Sub Klik(c) Form1.Kde = c Form1.Fil_KeyDown vbKeyDown, 0 End Sub Public Sub prepni(c) Form1.Aktualni = c txt = Form1.Radek(c) Form1.DopText.Text = Form1.PText(c) z = Len(txt) \ 6 Form1.E1nota.Caption = Left(txt, z) Form1.Hnota.Caption = Mid(txt, z + 1, z) Form1.Gnota.Caption = Mid(txt, (2 * z) + 1, z) Form1.Dnota.Caption = Mid(txt, (3 * z) + 1, z) Form1.Anota.Caption = Mid(txt, (4 * z) + 1, z) Form1.E2nota.Caption = Right(txt, z) Form1.Kam = -1 Form1.Kde = 6 Form1.Fil_KeyDown vbKeyDown, 0 Form1.Fil_KeyDown vbKeyRight, 0 If c = 1 Then Form1.b(1).Enabled = False Else Form1.b(1).Enabled = True If c = Form1.CRadku Then Form1.b(2).Enabled = False Else Form1.b(2).Enabled = True Form1.ff(0).Caption = " Aktuální:" + Str(c) + "/" + Str(Form1.CRadku) + " " Form1.PocetN = Len(Form1.E1nota.Caption) - 1 If Form1.PocetN < 10 Then Form1.minus.Enabled = False Else Form1.minus.Enabled = True If Form1.PocetN > 90 Then Form1.plus.Enabled = False Else Form1.plus.Enabled = True End Sub Public Sub Nahled(cq) For i = 1 To Form1.CRadku n = Chr(13) + Chr(10) txt = Form1.Radek(i) z = Len(txt) \ 6 aa = "E|" + Left(txt, z) bb = "H|" + Mid(txt, z + 1, z) cc = "G|" + Mid(txt, (2 * z) + 1, z) dd = "D|" + Mid(txt, (3 * z) + 1, z) ee = "A|" + Mid(txt, (4 * z) + 1, z) ff = "E|" + Right(txt, z) dop = Form1.PText(i) If cq = 0 Then ttt = ttt + dop + n + aa + n + bb + n + cc + n + dd + n + ee + n + ff + n + " " + n If cq = 1 Then ttt = ttt + aa + n + bb + n + cc + n + dd + n + ee + n + ff + n + " " + n Next Form1.nah.Text = ttt End Sub Public Akord 'Automatické dotvoření akordu Public Pocet 'Počet řádků v akordu Public Okolik 'Okolik pražců se posunou ostatní řádky v akordu Public NSlozky 'Nastavení výchozí složky Public CSlozky 'Nastavení cesty složky Public Kolikrat 'Nastavení Private Sub b_Click(Index As Integer) Select Case Index Case 0: Form4.Hide Case 1 Open App.Path + "\config.cfg" For Output As #1 Write #1, Akord, Pocet, Okolik, NSlozky, ces.Text, Kolikrat Close #1 MsgBox ("Uloženo...") End Select End Sub Private Sub ces_GotFocus() If ces.Text = " " Then ces.Text = "" End Sub Private Sub ces_LostFocus() If ces.Text = "" Then ces.Text = " " CSlozky = ces.Text End Sub Private Sub Form_Load() Pocet = 3 Okolik = 2 Kolikrat = 1 NSlozky = "Vyp" Akord = "Vyp" End Sub Private Sub ch_a_Click() If ch_a.Value = 0 Then ch_a.Caption = "Vyp": Akord = "Vyp": Form1.z2.Visible = False Else ch_a.Caption = "Zap": Akord = "Zap": Form1.z2.Visible = True End Sub Private Sub ch_Click() If ch.Value = 0 Then ch.Caption = "Vyp" Else ch.Caption = "Zap" NSlozky = ch.Caption End Sub Private Sub chba_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) chbb.Value = 0 Kolikrat = 1 End Sub Private Sub chbb_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) chba.Value = 0 Kolikrat = 2 End Sub Private Sub nac_Click() Form2.cd.ShowOpen a = Form2.cd.FileName If a = "" Then Exit Sub ces.Text = Left(a, Len(a) - Len(Form2.cd.FileTitle)) End Sub Private Sub okol_Change() okol.Text = Abs(Val(okol.Text)) okol.SelStart = 0: okol.SelLength = 1 Okolik = okol.Text t = Str(3 + Val(okol.Text)) tx = Chr(13) For i = 1 To Pocet - 1 tx = tx + t + Chr(13) Next tx = tx + " 3" ukazat.Caption = tx End Sub Private Sub op1_Click(Index As Integer) If op1(0).Value = True Then Pocet = 2 Else Pocet = 3 okol_Change End Sub Private Sub tim_Timer() If tim.Tag = "" Then tim.Tag = "w" okol_Change Exit Sub End If tim.Interval = 0 tim.Tag = "" End Sub Public Sub prehod() If ch_a.Value = 0 Then ch_a.Value = 1: Form1.z2.Visible = True Else ch_a.Value = 0: Form1.z2.Visible = False If ch_a.Value = 0 Then ch_a.Caption = "Vyp": Akord = "Vyp" Else ch_a.Caption = "Zap": Akord = "Zap" End Sub Dim PoKol Dim Zabl Public Comm Dim ko Dim Zpusob Dim Cesta Dim Cislo Dim Novy As Boolean Private Sub com_KeyDown(KeyCode As Integer, Shift As Integer) If Zabl = 1 Then Exit Sub If KeyCode = vbKeyF2 Then Uloz If KeyCode = vbKeyF3 Then Otevri If KeyCode = vbKeyF12 Then Konec If KeyCode = vbKeyEscape Then Zpet End Sub Private Sub com_LostFocus() If Form2.Visible = True Then com.SetFocus End Sub Private Sub Form_Load() Novy = True Zpusob = 0 PoKol = 0 Form2.MouseIcon = Form1.MouseIcon End Sub Private Sub l_Click(Index As Integer) If Index = 1 Then Uloz If Index = 2 Then ko = 1: Uloz If Index = 3 Then Zpet If Index = 4 Then Konec If Index = 5 Then Otevri If Index = 6 Then NaTxt If Index = 7 Then Novej End Sub Private Sub l_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) If Index = 0 Then Exit Sub For i = 1 To 7 l(i).ForeColor = &H80FF80 Next l(Index).ForeColor = &HFF& End Sub Private Sub tim_Timer() qw = 40 If Zpusob = 0 Then Cislo = Cislo + 1 Form2.Left = Cislo * qw - Form2.Width - 100 If Cislo = 1 Then Form2.Top = 300 If Cislo > (Form2.Width \ qw) Then tim.Interval = 0 End If If Zpusob = 1 Then Cislo = Cislo - 1 If Cislo = 0 Then tim.Interval = 0: Zpusob = 0: Zabl = 0: Form2.Hide Form2.Left = Cislo * qw - Form2.Width End If End Sub Sub Konec() If Form1.JeZmena = False Then End a = MsgBox("Soubor byl změněn. Přejete si uložit změny?", vbYesNoCancel) If a = vbCancel Then Exit Sub If a = vbYes Then Uloz Unload Form2 Unload Form3 Unload Form4 Unload Form5 End End Sub Sub Zpet() Zabl = 1 Zpusob = 1 tim.Interval = 1 End Sub Sub Uloz() For i = 1 To Form1.CRadku For o = 1 To Len(Form1.Radek(i)) z = Mid(Form1.Radek(i), o, 1) zz = zz + Chr(Asc(z) Xor 37) Next txt = txt + zz + Chr(13) + Chr(10) zz = "" Next Nahled 1 If ko = 1 Or Novy = True Then UlozJako (txt): ko = 0: Exit Sub If Novy = False Then Open Cesta For Output As #1 Print #1, txt Close #1 txt = "" For i = 1 To Form1.CRadku txt = txt + Form1.PText(i) + Chr(13) + Chr(10) + "*/-|-\*" + Chr(13) + Chr(10) Next Open Cesta + "t" For Output As #2 Print #2, txt Close #2 Nahled 0 MsgBox ("Uloženo") Zpet Form1.JeZmena = False End If End Sub Sub UlozJako(txt) cd.Filter = "Soubory rozpisů (*.tab)|*.tab" cd.ShowSave If cd.FileName = "" Then Exit Sub On Error GoTo p Open cd.FileName For Input As #1 Input #1, LL Close #1 aa = MsgBox("Přejete si soubor " + cd.FileTitle + " přepsat?", vbYesNo) If aa = vbNo Then Exit Sub p: Nahled 1 Open cd.FileName For Output As #1 Print #1, txt Close #1 txt = "" For i = 1 To Form1.CRadku txt = txt + Form1.PText(i) + Chr(13) + Chr(10) + "*/-|-\*" + Chr(13) + Chr(10) Next Open cd.FileName + "t" For Output As #2 Print #2, txt Close #2 Cesta = cd.FileName Novy = False Form1.Caption = " Tablature maker - " + cd.FileTitle MsgBox ("Uloženo") Nahled 0 Zpet Form1.JeZmena = False End Sub Sub Otevri() If Comm <> "" Then cd.FileName = Command: GoTo Preskoc If cd.FileName <> "" And Form1.JeZmena = True Then Ukol cd.Filter = "Soubory rozpisů (*.tab)|*.tab" cd.Flags = cdlOFNFileMustExist nns = Form4.ces.Text If Right(nns, 1) <> "\" And Right(nns, 1) <> "/" Then nns = nns + "\" nns = nns + "*.tab" If PoKol = 0 And Val(Form4.Kolikrat) = 1 And Form4.NSlozky = "Zap" Then cd.FileName = nns If Val(Form4.Kolikrat) = 2 And Form4.NSlozky = "Zap" Then cd.FileName = nns PoKol = 1 cd.ShowOpen If cd.FileName = "" Or cd.FileTitle = "" Then Exit Sub On Error GoTo pp Preskoc: Open cd.FileName For Input As #1 Do While Not EOF(1) Line Input #1, t For o = 1 To Len(t) z = Mid(t, o, 1) zz = zz + Chr(Asc(z) Xor 37) Next tx = tx + zz + Chr(10) zz = "" po = po + 1 Loop Close #1 Open cd.FileName + "t" For Input As #1 Do While Not EOF(1) Line Input #1, t 'For o = 1 To Len(t) 'z = Mid(t, o, 1) 'zz = zz + Chr(Asc(z) Xor 37) zz = t 'Next ttr = ttr + zz + Chr(13) + Chr(10) zz = "" Loop Close #1 Form1.Caption = " Tablature maker - " + cd.FileTitle If Command <> "" And Comm <> "" Then jm = Command For i = 1 To Len(jm) le = Right(jm, i) lo = Left(le, 1) If lo = "\" Then Pos = i - 1: GoTo kolp Next kolp: Form1.Caption = " Tablature maker - " + Right(jm, Pos) End If Cesta = cd.FileName Novy = False Form1.OpenIt tx, ttr, po If Comm = "" Then Zpet Comm = "" Exit Sub pp: MsgBox ("Nelze otevřít") Comm = "" End Sub Sub NaTxt() qq = cd.FileName cd.FileName = "Bez názvu.txt" cd.Filter = "Textové soubory (*.txt)|*.txt" cd.ShowSave If cd.FileName = "" Then Exit Sub On Error GoTo p Open cd.FileName For Input As #1 Input #1, LL Close #1 aa = MsgBox("Přejete si soubor " + cd.FileTitle + " přepsat?", vbYesNo) If aa = vbNo Then Exit Sub p: Nahled 0 Open cd.FileName For Output As #1 Print #1, Form1.nah.Text Close #1 cd.FileName = qq Cesta = cd.FileName Novy = False MsgBox ("Uloženo") End Sub Sub Novej() If Form1.JeZmena = True Then Ukol Form1.DopText.Text = " " Cesta = "" cd.FileName = "" Novy = True Form1.DejNovy Form1.akt Form1.Caption = " Tablature maker - Bez názvu" Zpet Form1.JeZmena = False End Sub Sub Ukol() a = MsgBox("Přejete si uložit změny?", vbYesNo) If a = vbYes Then Uloz End Sub Private Sub tim_Timer() tim.Interval = 0 On Error GoTo p Open App.Path + "\config.cfg" For Input As #1 Input #1, Akord2, Pocet2, Okolik2, nslozky2, Cslozky2, Kolikrat2 Close #1 Form4.Akord = Akord If Akord2 = "Vyp" Then Form4.ch_a.Value = 0 If Akord2 = "Zap" Then Form4.ch_a.Value = 1 Form4.Pocet = Pocet2 If Val(Pocet2) = 2 Then Form4.op1(0).Value = 1 If Val(Pocet2) = 3 Then Form4.op1(1).Value = 1 Form4.Okolik = Okolik2 Form4.okol.Text = Okolik2 Form4.NSlozky = nslozky2 If nslozky2 = "Vyp" Then Form4.ch.Value = 0 If NSlozky = "Zap" Then Form4.ch.Value = 1 Form4.CSlozky = Cslozky2 Form4.ces.Text = Cslozky2 Form4.Kolikrat = Kolikrat2 If Val(Kolikrat2) = 1 Then Form4.chba.Value = 1: Form4.chbb.Value = 0 If Val(Kolikrat2) = 2 Then Form4.chbb.Value = 1: Form4.chba.Value = 0 GoTo l p: MsgBox ("Stiskněte Shift + F5 a proveďte nastavení!") l: Form1.Show 1 Unload Form5 Form5.Hide End Sub