Example #1
0
        public DodajNowa(int index)
        {
            InitializeComponent();

            editIndex = index;
            Piesn editable = new Piesn();

            editable               = Piesn.importujWpis(Piesn.pobierzLinie(index));
            textBox1.Text          = editable.nazwa;
            wejscieBox.Checked     = editable.wejscie;
            ofiarowanieBox.Checked = editable.ofiarowanie;
            komuniaBox.Checked     = editable.komunia;
            uwielbienieBox.Checked = editable.uwielbienie;
            wyjscieBox.Checked     = editable.wyjscie;
            krotkaBox.Checked      = editable.krotka;
            sredniaBox.Checked     = editable.srednia;
            dlugaBox.Checked       = editable.dluga;
            starsiBox.Checked      = editable.starsi;
            mlodsiBox.Checked      = editable.mlodsi;
            postBox.Checked        = editable.post;
            wielkanocBox.Checked   = editable.wielkanoc;
            koledyBox.Checked      = editable.koledy;
            adwentBox.Checked      = editable.adwent;
            maryjneBox.Checked     = editable.maryjne;
            zwykleBox.Checked      = editable.zwykle;
            nowaBox.Checked        = editable.nowa;
            richTextBox1.Text      = editable.tekst;
            numerTextbox.Text      = editable.numer.ToString();
            szukajChwytow();
            try { sizePicker.Value = decimal.Parse(editable.size); }
            catch { }
            button1.Hide();
            button3.Show();
        }
Example #2
0
        public void drukujZNazw(string nazwa1, string nazwa2)
        {
            Piesn target1, target2;
            int   index1 = Piesn.szukajPoNazwie(nazwa1);

            target1 = Piesn.importujWpis(Piesn.pobierzLinie(index1));
            string tekst1 = target1.tekst;
            string size1  = target1.size;
            string title1 = (int.Parse(size1) + 3).ToString();

            tekst1 = tekst1.Replace("@", " ");
            tekst1 = tekst1.Replace("\n", "<br>");

            int index2 = Piesn.szukajPoNazwie(nazwa2);

            target2 = Piesn.importujWpis(Piesn.pobierzLinie(index2));
            string tekst2 = target2.tekst;
            string size2  = target2.size;
            string title2 = (int.Parse(size2) + 3).ToString();

            tekst2 = tekst2.Replace("@", " ");
            tekst2 = tekst2.Replace("\n", "<br>");

            string[] html =
            {
                "<html>",
                "<head>",
                "</head>",
                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />",
                "<body>",
                "<table height=100% width=100% border=1><tr>",
                "<td width=50% align=center valign=top>",
                "<br>",
                "<b><u><h1 style=\"font-size:" + title1 + "pt;\">",
                Piesn.importujWpis(Piesn.pobierzLinie(index1)).nazwa,
                "</h1></u></b><h3 style=\"font-size:" + size1 + "pt; font-weight:normal;\">",
                tekst1,
                "</h3>",
                "</td>",
                "<td width=50% align=center valign=top>",
                "<br>",
                "<b><u><h1 style=\"font-size:" + title2 + "pt;\">",
                Piesn.importujWpis(Piesn.pobierzLinie(index2)).nazwa,
                "</h1></u></b><h3 style=\"font-size:" + size2 + "pt; font-weight:normal;\">",
                tekst2,
                "</h3>",
                "</td></tr></table>",
                "</body>",
                "<script>javascript:window.print()</script>",
                "</html>",
            };
            File.WriteAllLines("wydruk.html", html);
            System.Diagnostics.Process.Start(@"wydruk.html");
        }
Example #3
0
        public void drukujZNazw(string nazwa1)
        {
            string size   = "14";
            int    index1 = Piesn.szukajPoNazwie(nazwa1);
            Piesn  target = Piesn.importujWpis(Piesn.pobierzLinie(index1));
            string tekst1 = target.tekst;

            size = target.size;
            string title = (int.Parse(size) + 3).ToString();

            tekst1 = tekst1.Replace("@", " ");
            tekst1 = tekst1.Replace("\n", "</font><br><font color=black>");

            tekst1 = tekst1.Replace("[czerwony]", "<font color=red>");      //red
            tekst1 = tekst1.Replace("[zielony]", "<font color=green>");     //green
            tekst1 = tekst1.Replace("[niebieski]", "<font color=blue>");    // blue
            tekst1 = tekst1.Replace("[fioletowy]", "<font color=#660066>"); // violet
            tekst1 = tekst1.Replace("[brazowy]", "<font color=brown>");     // brown

            string[] html =
            {
                "<html>",
                "<head>",
                "</head>",
                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />",
                "<body>",
                "<table height=100% width=100% border=1><tr>",
                "<td width=50% align=center valign=top>",
                "<br>",
                "<b><u><h1 style=\"font-size:" + title + "pt;\">",
                Piesn.importujWpis(Piesn.pobierzLinie(index1)).nazwa,
                "</h1></u></b><h3 style=\"font-size:" + size + "pt; font-weight:normal;\">",
                tekst1,
                "</h3>",
                "</td>",
                "<td width=50% align=center valign=top>",
                "<br>",
                "<b><u><h1 style=\"font-size:" + title + "pt;\">",
                Piesn.importujWpis(Piesn.pobierzLinie(index1)).nazwa,
                "</h1></u></b><h3 style=\"font-size:" + size + "pt; font-weight:normal;\">",
                tekst1,
                "</h3>",
                "</td></tr></table>",
                "</body>",
                "<script>javascript:window.print()</script>",
                "</html>",
            };

            File.WriteAllLines("wydruk.html", html);
            System.Diagnostics.Process.Start(@"wydruk.html");
        }
Example #4
0
        private void nowaText_DoubleClick(object sender, EventArgs e)
        {
            System.IO.StreamReader file = new System.IO.StreamReader("baza.txt");
            string linia, lista = null;
            Piesn  bufor = new Piesn();

            while ((linia = file.ReadLine()) != null)
            {
                bufor = Piesn.importujWpis(linia);
                if (bufor.nowa)
                {
                    lista += bufor.nazwa + "\n";
                }
            }
            file.Close();
            MessageBox.Show(lista, "DO PRZEĆWICZENIA");
        }
Example #5
0
        private void bezchwytText_DoubleClick(object sender, EventArgs e)
        {
            System.IO.StreamReader file = new System.IO.StreamReader("baza.txt");
            string linia, lista = null;
            Piesn  bufor = new Piesn();

            while ((linia = file.ReadLine()) != null)
            {
                bufor = Piesn.importujWpis(linia);
                if (bufor.chwyty.Count == 0)
                {
                    lista += bufor.nazwa + "\n";
                }
            }
            file.Close();
            MessageBox.Show(lista, "BEZ CHWYTÓW");
        }
Example #6
0
        private void SongDetails_Activated(object sender, EventArgs e)
        {
            Piesn detale = new Piesn();

            detale          = Piesn.importujWpis(Piesn.pobierzLinie(numer));
            labelTytul.Text = detale.nazwa;
            labelTytul.Left = ((this.Width) / 2) - ((labelTytul.Width) / 2);
            if (detale.numer == 0)
            {
                labelNumer.Text = "BRAK NUMERU W KOMPUTERZE";
            }
            else
            {
                labelNumer.Text = "NUMER: " + detale.numer.ToString();
            }
            labelNumer.Left   = ((this.Width) / 2) - ((labelNumer.Width) / 2);
            richTextBox1.Text = detale.tekst;
        }