//Bakalarska prace

//TEMA:
//UZIVATELSKY PROGRAM PRO ZOBRAZENI
//A ZPRACOVANI KVANTITATIVNI FAZE
//Z DIGITALNIHO HOLOGRAFICKEHO MIKROSKOPU

//FAKULTA STROJNIHO INZENYRSTVI
//USTAV FYZIKALNIHO INZENYRSTVI

//Jmeno:		Hladik Lukas
//Skupina:		3E/91
//Verze:		1.0
//Datum:		27. kvetna 2010

      

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class nataveni_videa : Form
    {
               
        int KrokNahled;

        public nataveni_videa()
        {
            InitializeComponent();
        }
                
        
        //----NAVRATOVE FUNKCE
        public void NastavKrokUlozeni(int krok)
        {
            KrokNahled = krok;
        }
        
        public string GetCesta()

        {

            return txtDstFile.Text;
        }


        public UInt16 GetFrames()
        {

            return Convert.ToUInt16(trackBar2.Value);
        }

        


        private void button1_Click_1(object sender, EventArgs e)
        {

            if (txtDstFile.Text.Length == 0)
            {
                MessageBox.Show("Není zadána cesta ukládaného videosouboru.",
                    "Chyba",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation,
                    MessageBoxDefaultButton.Button1);
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();            
            }


        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();

        }

        private void btnDstFile_Click(object sender, EventArgs e)
        {
            
            
            


        }

        

        private void trackBar2_Scroll(object sender, EventArgs e)
        {
            label7.Text = Convert.ToString(trackBar2.Value);
            txtDstFile.Text = Application.StartupPath + "\\phaD" + trackBar2.Value + ".avi";
        }

        private void nataveni_videa_Load(object sender, EventArgs e)
        {

            trackBar2.Value = KrokNahled;
            
            //trackBar2.Value = dlg.GetKrokNahled();
            label7.Text = Convert.ToString(trackBar2.Value); 
            
            //n = dlg.GetKrokNahled();
            //trackBar2.Value = n; 
            txtDstFile.Text = Application.StartupPath + "\\phaD" + trackBar2.Value + ".avi";
            //nataveni_videa.
            

        }

        private void txtDstFile_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnDstFile_Click_1(object sender, EventArgs e)
        {
            
            saveFileDialog1.Title = "Uložení videa";
            saveFileDialog1.InitialDirectory = Application.ExecutablePath;
            saveFileDialog1.Filter = "soubor (*.avi)|*.avi";
            saveFileDialog1.DefaultExt = "avi";
            saveFileDialog1.FileName = "phaD" + trackBar2.Value + ".avi";
            //saveFileDialog1.ShowDialog();

            if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
            {
                txtDstFile.Text = saveFileDialog1.FileName;
                //MessageBox.Show("Bylo kliknuto OK");
            }
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }






    }
}
