/* This file is part of AHD Subtitles Maker Professional
   A program can create and edit subtitles

   Copyright © Ala I Hadid 2009 - 2012

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
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;
using System.Reflection;
using System.Resources;
namespace AHD.SM.Forms
{
    public partial class Frm_TipOfTheDay : Form
    {
        ResourceManager resources = new ResourceManager("AHD.SM.Forms.LanguageResources.Resource",
           Assembly.GetExecutingAssembly());
        public Frm_TipOfTheDay(bool DisplayAtStartUpChecked, int TipIndex, string HelpPath)
        {
            InitializeComponent();
            for (int i = 0; i < Tips_OfDays.Length / 2; i++)
            {
                Tips_OfDays[i, 0] = resources.GetString("TipOfTheDay_" + i);
            }
            checkBox1.Checked = DisplayAtStartUpChecked;
            IndexOfTip = TipIndex;
            _HelpPath = HelpPath;
            try { Tip_label2.Text = Tips_OfDays[IndexOfTip, 0]; }
            catch { IndexOfTip = 0; Tip_label2.Text = Tips_OfDays[IndexOfTip, 0]; }
        }
        public bool DisplayAtStartUp
        { get { return checkBox1.Checked; } }
        public int TipIndex
        { get { return IndexOfTip; } }

        string[,] Tips_OfDays =
        { 
          {"You can duplicate subtitles track's subtitles to another new one, just select the desired language track then CTRL+D or right-mouse click then select duplicate."
              ,"How to, Create subtitles track"},
          {"If your mp3 file has a ID3 Synchronized Lyric, add it to your project !!, Go to Tools>Extract from ID3 Or Ctrl+Alt+Q."
              ,"How to, Save subtitle track(s) as ID3 Tag Synchronised Lyrics element to mp3 file"},
          {"When you import a subtitle format, it may includes wrong subtitle(s). you can check subtitles error by going to Tools>Check subtitles errors Or Ctrl+Alt+C."
              ,"How to, Check for errors and auto fix"},
          {"You can change the media any time you want, press CTRL + M"
              ,"How to, Import subtitles format file"},
          {"You can set current time as the end time for the subtitle at the player time, just click 'Set current time as subtitle's end time' button in the player controls."
              ,"How to, Add subtitle"},
          {"Do you know that ASM auto check for subtitle errors for imported subtitles format ? aslo you can change this option via settings>general"
              ,"How to, Check for errors and auto fix"},
          {"No need to manual synchronise, use the timeline control to adjust subtitle timings !!"
              ,"TimeLine"},
          {"If you want to convert subtitles format,no need to run AHd Subtitles Maker Professional at all !! it's better  to use AHD Subtitles Converter istead."
              ,"AHD Subtitles Converter"},
          {"You need to translate subtitles but you don't have enough time to write texts ? you can use the google translate service instead."
              ,"How to, Translate subtitles track"},
          {"You Don't like the look of AHD Subtiltes Maker Professional and you see the layout is confused ? you can change the layout and more, go to View>Layout"
              ,"Change tab locations"},
          {"It's a long movie you work with here and it's hard to seek to chapters. You use the marks to seek media time easily, go to Player>Marks."
              ,"Marks"},
          {"Use the GT-Text file to translate huge count of subtitles, it's x 2 faster than usual translate opeation."
              ,"How to, Translate using GT Text"},
          {"You don't have time to synchronise subtitle timings using the timeline control ? then use the AHD Synchronisation Tool, it can do the hard works in seconds !!?"
              ,"Synchronisation Tool"},
          {"Don't you know ? AHD Subtitles format file can save all subtitle tracks of your project ? also saves styles (colors, fonts..) for each char of each subtitles ? A backup of your project can be created using this format."
              ,"AHD Subtitles"},
        };

        int IndexOfTip = 0;
        string _HelpPath = "";


        private void button1_Click(object sender, EventArgs e)
        {
            Help.ShowHelp(this, _HelpPath, HelpNavigator.KeywordIndex, Tips_OfDays[IndexOfTip, 1]);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            IndexOfTip++;
            if (IndexOfTip == Tips_OfDays.Length / 2)
                IndexOfTip = 0;
            Tip_label2.Text = Tips_OfDays[IndexOfTip, 0];
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Help.ShowHelp(this, _HelpPath, HelpNavigator.KeywordIndex, "Workflow");
        }
        //close
        private void button4_Click(object sender, EventArgs e)
        {
            IndexOfTip++;
            if (IndexOfTip == Tips_OfDays.Length)
                IndexOfTip = 0;
            Close();
        }
    }
}
