Esempio n. 1
0
        public TextSplitHotkeys(TextSplitShow TSS)
        {
            InitializeComponent();

            bCancel.Click += new EventHandler(bCancel_Click);
            bOK.Click += new EventHandler(bOK_Click);
            FormClosing += new FormClosingEventHandler(TSH_Closing);

            this.TSS = TSS;

            textboxNames = new string[] { "tNext1", "tNext2", "tPrev1", "tPrev2", "tFirst1", "tFirst2", "tLast1", "tLast2" };
            newHotkeys = new Keys[8];
            for (int i = 0; i < newHotkeys.Length; i++) {
                newHotkeys[i] = TSS.TST.Hotkeys[i];
            }

            foreach (var c in Controls) {
                if (c is TextBox) {
                    for (int i = 0; i < textboxNames.Length; i++) {
                        if (((TextBox)c).Name == textboxNames[i]) {
                            ((TextBox)c).Text = newHotkeys[i].ToString();
                        }
                    }
                    ((TextBox)c).GotFocus += new EventHandler(tKeyPrompt_Focus);
                    ((TextBox)c).LostFocus += new EventHandler(tKeyPrompt_LostFocus);
                    ((TextBox)c).KeyDown += new KeyEventHandler(tKeyPrompt_Key);
                }
            }
        }
Esempio n. 2
0
        public TextSplitHotkeys(TextSplitShow TSS)
        {
            InitializeComponent();

            bCancel.Click += new EventHandler(bCancel_Click);
            bOK.Click     += new EventHandler(bOK_Click);
            FormClosing   += new FormClosingEventHandler(TSH_Closing);

            this.TSS = TSS;

            textboxNames = new string[] { "tNext1", "tNext2", "tPrev1", "tPrev2", "tFirst1", "tFirst2", "tLast1", "tLast2" };
            newHotkeys   = new Keys[8];
            for (int i = 0; i < newHotkeys.Length; i++)
            {
                newHotkeys[i] = TSS.TST.Hotkeys[i];
            }

            foreach (var c in Controls)
            {
                if (c is TextBox)
                {
                    for (int i = 0; i < textboxNames.Length; i++)
                    {
                        if (((TextBox)c).Name == textboxNames[i])
                        {
                            ((TextBox)c).Text = newHotkeys[i].ToString();
                        }
                    }
                    ((TextBox)c).GotFocus  += new EventHandler(tKeyPrompt_Focus);
                    ((TextBox)c).LostFocus += new EventHandler(tKeyPrompt_LostFocus);
                    ((TextBox)c).KeyDown   += new KeyEventHandler(tKeyPrompt_Key);
                }
            }
        }
Esempio n. 3
0
        public TextSplitHotkeys(TextSplitShow TSS)
        {
            InitializeComponent();

            bCancel.Click += new EventHandler(bCancel_Click);
            bOK.Click += new EventHandler(bOK_Click);
            FormClosing += new FormClosingEventHandler(TSH_Closing);

            this.TSS = TSS;

            textboxNames = new string[] { "tNext1", "tNext2", "tPrev1", "tPrev2", "tFirst1", "tFirst2", "tLast1", "tLast2" };
            tempHotkeys = new ArrayList();
            for (int i = 0; i < Properties.Settings.Default.Hotkeys.Count; i++) {
                tempHotkeys.Add((Keys)Properties.Settings.Default.Hotkeys[i]);
            }

            foreach (var c in Controls) {
                if (c is TextBox) {
                    for (int i = 0; i < textboxNames.Length; i++) {
                        if (((TextBox)c).Name == textboxNames[i]) {
                            ((TextBox)c).Text = ((Keys)tempHotkeys[i]).ToString();
                        }
                    }
                    ((TextBox)c).GotFocus += new EventHandler(tKeyPrompt_Focus);
                    ((TextBox)c).LostFocus += new EventHandler(tKeyPrompt_LostFocus);
                    ((TextBox)c).KeyDown += new KeyEventHandler(tKeyPrompt_Key);
                }
            }
        }
Esempio n. 4
0
        public TextSplitHotkeys(TextSplitShow TSS)
        {
            InitializeComponent();

            bCancel.Click += new EventHandler(bCancel_Click);
            bOK.Click     += new EventHandler(bOK_Click);
            FormClosing   += new FormClosingEventHandler(TSH_Closing);

            this.TSS = TSS;

            textboxNames = new string[] { "tNext1", "tNext2", "tPrev1", "tPrev2", "tFirst1", "tFirst2", "tLast1", "tLast2" };
            tempHotkeys  = new ArrayList();
            for (int i = 0; i < Properties.Settings.Default.Hotkeys.Count; i++)
            {
                tempHotkeys.Add((Keys)Properties.Settings.Default.Hotkeys[i]);
            }

            foreach (var c in Controls)
            {
                if (c is TextBox)
                {
                    for (int i = 0; i < textboxNames.Length; i++)
                    {
                        if (((TextBox)c).Name == textboxNames[i])
                        {
                            ((TextBox)c).Text = ((Keys)tempHotkeys[i]).ToString();
                        }
                    }
                    ((TextBox)c).GotFocus  += new EventHandler(tKeyPrompt_Focus);
                    ((TextBox)c).LostFocus += new EventHandler(tKeyPrompt_LostFocus);
                    ((TextBox)c).KeyDown   += new KeyEventHandler(tKeyPrompt_Key);
                }
            }
        }
Esempio n. 5
0
 public void OpenFileNewWindow(string title)
 {
     openFileDialog.Filter = "TextSplit Text File|*.tst";
     openFileDialog.Title  = title;
     if (openFileDialog.ShowDialog() != DialogResult.Cancel && openFileDialog.FileName != "")
     {
         string        newFileName = openFileDialog.FileName;
         TextSplitShow TSS         = new TextSplitShow(newFileName, true);
         TSS.TST = serializer.DeSerializeObject(newFileName);
         Globals.OpenNewWindow(TSS);
     }
 }
Esempio n. 6
0
        public TextSplitLayout(TextSplitShow TSS)
        {
            InitializeComponent();
            ShowIcon = true;

            bTextColor.Click         += new EventHandler(bTextColor_Click);
            bBGColor.Click           += new EventHandler(bBGColor_Click);
            bOK.Click                += new EventHandler(bOK_Click);
            bCancel.Click            += new EventHandler(bCancel_Click);
            checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
            bChooseFont.Click        += new EventHandler(bChooseFont_Click);
            FormClosing              += new FormClosingEventHandler(TSL_Closing);

            this.TSS = TSS;

            bTextColor.BackColor = TSS.TST.Colors[0];
            bBGColor.BackColor   = TSS.TST.Colors[1];
            checkBox1.Checked    = TSS.TST.SlideWrap;

            textboxList = new TextBox[] { tWidth, tHeight, tLeft, tRight, tTop, tBottom };
            maxSizes    = new int[] { Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height };

            newFont      = TSS.TST.TextFont;
            newTextColor = TSS.TST.Colors[0];
            newBGColor   = TSS.TST.Colors[1];
            newWrap      = TSS.TST.SlideWrap;
            newSize      = (int[])TSS.TST.Size.Clone();
            newMargins   = (int[])TSS.TST.Margins.Clone();

            initialSize    = (int[])TSS.TST.Size.Clone();
            initialMargins = (int[])TSS.TST.Margins.Clone();

            for (int i = 0; i < textboxList.Length; i++)
            {
                if (i < 2)
                {
                    textboxList[i].Text       = TSS.TST.Size[i].ToString();
                    textboxList[i].LostFocus += new EventHandler(TextBoxWindow_Unfocus);
                }
                else
                {
                    textboxList[i].Text       = TSS.TST.Margins[i - 2].ToString();
                    textboxList[i].LostFocus += new EventHandler(TextBoxMargin_Unfocus);
                }
                textboxList[i].KeyDown += new KeyEventHandler(TextBox_Enter);
            }

            ToolTip toolTip = new ToolTip();

            toolTip.AutoPopDelay = 10000;
            toolTip.SetToolTip(checkBox1, "If this is checked, then the 'Next Slide' action on the last slide gets you to the first slide and the 'Previous Slide' action on the first slide gets you to the last slide");
        }
Esempio n. 7
0
        public TextSplitLayout(TextSplitShow TSS)
        {
            InitializeComponent();
            ShowIcon = true;

            bTextColor.Click += new EventHandler(bTextColor_Click);
            bBGColor.Click += new EventHandler(bBGColor_Click);
            bOK.Click += new EventHandler(bOK_Click);
            bCancel.Click += new EventHandler(bCancel_Click);
            checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
            bChooseFont.Click += new EventHandler(bChooseFont_Click);
            FormClosing += new FormClosingEventHandler(TSL_Closing);

            this.TSS = TSS;

            bTextColor.BackColor = TSS.TST.Colors[0];
            bBGColor.BackColor = TSS.TST.Colors[1];
            checkBox1.Checked = TSS.TST.SlideWrap;

            textboxList = new TextBox[] { tWidth, tHeight, tLeft, tRight, tTop, tBottom };
            maxSizes = new int[] { Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height };

            newFont = TSS.TST.TextFont;
            newTextColor = TSS.TST.Colors[0];
            newBGColor = TSS.TST.Colors[1];
            newWrap = TSS.TST.SlideWrap;
            newSize = (int[])TSS.TST.Size.Clone();
            newMargins = (int[])TSS.TST.Margins.Clone();

            initialSize = (int[])TSS.TST.Size.Clone();
            initialMargins = (int[])TSS.TST.Margins.Clone();

            for (int i = 0; i < textboxList.Length; i++) {
                if (i < 2) {
                    textboxList[i].Text = TSS.TST.Size[i].ToString();
                    textboxList[i].LostFocus += new EventHandler(TextBoxWindow_Unfocus);
                } else {
                    textboxList[i].Text = TSS.TST.Margins[i - 2].ToString();
                    textboxList[i].LostFocus += new EventHandler(TextBoxMargin_Unfocus);
                }
                textboxList[i].KeyDown += new KeyEventHandler(TextBox_Enter);
            }

            ToolTip toolTip = new ToolTip();
            toolTip.AutoPopDelay = 10000;
            toolTip.SetToolTip(checkBox1, "If this is checked, then the 'Next Slide' action on the last slide gets you to the first slide and the 'Previous Slide' action on the first slide gets you to the last slide");
        }
Esempio n. 8
0
        public TextSplitMain()
        {
            InitializeComponent();

            bPrevSlide.Click                       += new EventHandler(bPrevSlide_Click);
            fileToolStripMenuItem1.Click           += new EventHandler(fileToolStripMenuItem1_Click);
            windowToolStripMenuItem.Click          += new EventHandler(windowToolStripMenuItem_Click);
            saveToolStripMenuItem.Click            += new EventHandler(saveToolStripMenuItem_Click);
            saveAsToolStripMenuItem.Click          += new EventHandler(saveAsToolStripMenuItem_Click);
            loadToolStripMenuItem.Click            += new EventHandler(openToolStripMenuItem_Click);
            openInNewWindowToolStripMenuItem.Click += new EventHandler(openInNewWindowToolStripMenuItem_Click);
            toolStripMenuItem1.Click               += new EventHandler(aboutToolStripMenuItem_Click);
            exitToolStripMenuItem.Click            += new EventHandler(exitToolStripMenuItem_Click);
            editLayoutToolStripMenuItem.Click      += new EventHandler(editLayoutToolStripMenuItem_Click);
            editHotkeysToolStripMenuItem.Click     += new EventHandler(editHotkeysToolStripMenuItem_Click);
            cReadOnly.CheckedChanged               += new EventHandler(cReadOnly_CheckedChanged);
            cDisableHK.CheckedChanged              += new EventHandler(cDisableHK_CheckedChanged);
            bAddAfter.Click    += new EventHandler(bAddAfter_Click);
            bRemove.Click      += new EventHandler(bRemove_Click);
            bAddBefore.Click   += new EventHandler(bAddBefore_Click);
            bAddBegin.Click    += new EventHandler(bAddBegin_Click);
            bAddEnd.Click      += new EventHandler(bAddEnd_Click);
            bLastSlide.Click   += new EventHandler(bLastSlide_Click);
            bFirstSlide.Click  += new EventHandler(bFirstSlide_Click);
            tGoToSlide.KeyDown += new KeyEventHandler(tGoToSlide_Enter);
            bNextSlide.Click   += new EventHandler(bNextSlide_Click);
            FormClosing        += new FormClosingEventHandler(TSM_Closing);
            Resize             += new EventHandler(TSM_Resize);

            Globals.TSM = this;

            // Initializes the themes
            Globals.Themes = new Dictionary <string, Theme>();
            Globals.Themes.Add("Standard", new Theme("Standard", new Font("Microsoft Sans Serif", 11, FontStyle.Regular), Color.FromArgb(0, 0, 0), Color.FromArgb(255, 255, 255)));
            Globals.Themes.Add("Notepad", new Theme("Notepad", new Font("Consolas", 11, FontStyle.Regular), Color.FromArgb(0, 0, 0), Color.FromArgb(251, 251, 251)));
            Globals.Themes.Add("Carmine", new Theme("Carmine", new Font("Verdana", 11, FontStyle.Regular), Color.FromArgb(166, 0, 24), Color.FromArgb(251, 251, 251)));
            Globals.Themes.Add("Blue Neon", new Theme("Blue Neon", new Font("Segoe UI", 11, FontStyle.Regular), Color.FromArgb(54, 162, 241), Color.FromArgb(13, 13, 13)));
            Globals.Themes.Add("Camo", new Theme("Camo", new Font("Segoe UI", 11, FontStyle.Regular), Color.FromArgb(162, 175, 114), Color.FromArgb(38, 36, 26)));
            Globals.Themes.Add("Capuccino", new Theme("Capuccino", new Font("Verdana", 11, FontStyle.Regular), Color.FromArgb(206, 103, 0), Color.FromArgb(36, 24, 15)));
            Globals.Themes.Add("Midnight", new Theme("Midnight", new Font("Consolas", 11, FontStyle.Regular), Color.FromArgb(229, 229, 229), Color.FromArgb(28, 28, 28)));

            foreach (string k in Globals.Themes.Keys)
            {
                ToolStripDropDownItem item = new ToolStripMenuItem(k);
                item.Name   = k;
                item.Click += new EventHandler(themeMenuItem_Click);
                themeMenuItem.DropDownItems.Add(item);
            }

            ToolStripSeparator sep2 = new ToolStripSeparator();

            sep2.Name = "  ";
            themeMenuItem.DropDownItems.Add(sep2);
            ToolStripMenuItem saveItem = new ToolStripMenuItem("Save Layout As Theme...");

            saveItem.Click += new EventHandler(saveUserTheme_Click);
            themeMenuItem.DropDownItems.Add(saveItem);

            // Unpacks the values of UserThemes to Globals.themes
            Globals.UserThemes = new Dictionary <string, Theme>();
            foreach (string s in Properties.Settings.Default.UserThemes)
            {
                Theme t = UnpackThemeFromString(s);
                Globals.Themes.Add(t.Name, t);
                Globals.UserThemes.Add(t.Name, t);
            }

            // Adds user created themes menu items
            if (Globals.UserThemes.Count > 0)
            {
                AddUserThemeSeparator();
                foreach (string s in Globals.UserThemes.Keys)
                {
                    Theme t = Globals.UserThemes[s];
                    AddUserThemeMenuItem(t.Name);
                }
            }

            ToolTip toolTip = new ToolTip();

            toolTip.ShowAlways = true;
            toolTip.SetToolTip(cReadOnly, "Toggles between Edit Mode and Read-Only Mode");
            toolTip.SetToolTip(cDisableHK, "Toggle this to disable the global hotkeys");
            toolTip.SetToolTip(bAddAfter, "Adds a new slide after this slide");
            toolTip.SetToolTip(bAddBefore, "Adds a new slide before this slide");
            toolTip.SetToolTip(bAddBegin, "Adds a new slide before the first slide");
            toolTip.SetToolTip(bAddEnd, "Adds a new slide after the last slide");
            toolTip.SetToolTip(bRemove, "Removes the current slide");
            toolTip.SetToolTip(bNextSlide, "Next Slide");
            toolTip.SetToolTip(bPrevSlide, "Previous Slide");
            toolTip.SetToolTip(bFirstSlide, "First Slide");
            toolTip.SetToolTip(bLastSlide, "Last Slide");

            bool exampleOpen = true;
            int  j           = 0;

            while (j < Properties.Settings.Default.FileNames.Count)
            {
                TextSplitShow TSS = new TextSplitShow((string)Properties.Settings.Default.FileNames[j], false);
                if (TSS.fileLoaded)
                {
                    Globals.OpenNewWindow(TSS);
                    if (exampleOpen)
                    {
                        exampleOpen = false;
                    }
                    j++;
                }
                else
                {
                    Globals.WindowList.RemoveAt(Globals.WindowList.Count - 1);
                    Properties.Settings.Default.FileNames.RemoveAt(j);
                }
            }

            // Opens example
            if (exampleOpen)
            {
                TextSplitShow example = new TextSplitShow("", true);
                Globals.OpenNewWindow(example);
                example.fileLoaded = false;
            }
        }
Esempio n. 9
0
        public TextSplitMain()
        {
            InitializeComponent();

            bPrevSlide.Click += new EventHandler(bPrevSlide_Click);
            fileToolStripMenuItem1.Click += new EventHandler(fileToolStripMenuItem1_Click);
            windowToolStripMenuItem.Click += new EventHandler(windowToolStripMenuItem_Click);
            saveToolStripMenuItem.Click += new EventHandler(saveToolStripMenuItem_Click);
            saveAsToolStripMenuItem.Click += new EventHandler(saveAsToolStripMenuItem_Click);
            loadToolStripMenuItem.Click += new EventHandler(openToolStripMenuItem_Click);
            openInNewWindowToolStripMenuItem.Click += new EventHandler(openInNewWindowToolStripMenuItem_Click);
            toolStripMenuItem1.Click += new EventHandler(aboutToolStripMenuItem_Click);
            exitToolStripMenuItem.Click += new EventHandler(exitToolStripMenuItem_Click);
            editLayoutToolStripMenuItem.Click += new EventHandler(editLayoutToolStripMenuItem_Click);
            editHotkeysToolStripMenuItem.Click += new EventHandler(editHotkeysToolStripMenuItem_Click);
            cReadOnly.CheckedChanged += new EventHandler(cReadOnly_CheckedChanged);
            cDisableHK.CheckedChanged += new EventHandler(cDisableHK_CheckedChanged);
            bAddAfter.Click += new EventHandler(bAddAfter_Click);
            bRemove.Click += new EventHandler(bRemove_Click);
            bAddBefore.Click += new EventHandler(bAddBefore_Click);
            bAddBegin.Click += new EventHandler(bAddBegin_Click);
            bAddEnd.Click += new EventHandler(bAddEnd_Click);
            bLastSlide.Click += new EventHandler(bLastSlide_Click);
            bFirstSlide.Click += new EventHandler(bFirstSlide_Click);
            tGoToSlide.KeyDown += new KeyEventHandler(tGoToSlide_Enter);
            bNextSlide.Click += new EventHandler(bNextSlide_Click);
            FormClosing += new FormClosingEventHandler(TSM_Closing);
            Resize += new EventHandler(TSM_Resize);

            Globals.TSM = this;

            // Initializes the themes
            Globals.Themes = new Dictionary<string, Theme>();
            Globals.Themes.Add("Standard",  new Theme("Standard",   new Font("Microsoft Sans Serif", 11, FontStyle.Regular),    Color.FromArgb(0, 0, 0),        Color.FromArgb(255, 255, 255)));
            Globals.Themes.Add("Notepad",   new Theme("Notepad",    new Font("Consolas", 11, FontStyle.Regular),                Color.FromArgb(0, 0, 0),        Color.FromArgb(251, 251, 251)));
            Globals.Themes.Add("Carmine",   new Theme("Carmine",    new Font("Verdana", 11, FontStyle.Regular),                 Color.FromArgb(166, 0, 24),     Color.FromArgb(251, 251, 251)));
            Globals.Themes.Add("Blue Neon", new Theme("Blue Neon",  new Font("Segoe UI", 11, FontStyle.Regular),                Color.FromArgb(54, 162, 241),   Color.FromArgb(13, 13, 13)));
            Globals.Themes.Add("Camo",      new Theme("Camo",       new Font("Segoe UI", 11, FontStyle.Regular),                Color.FromArgb(162, 175, 114),  Color.FromArgb(38, 36, 26)));
            Globals.Themes.Add("Capuccino", new Theme("Capuccino",  new Font("Verdana", 11, FontStyle.Regular),                 Color.FromArgb(206, 103, 0),    Color.FromArgb(36, 24, 15)));
            Globals.Themes.Add("Midnight",  new Theme("Midnight",   new Font("Consolas", 11, FontStyle.Regular),                Color.FromArgb(229, 229, 229),  Color.FromArgb(28, 28, 28)));

            foreach (string k in Globals.Themes.Keys) {
                ToolStripDropDownItem item = new ToolStripMenuItem(k);
                item.Name = k;
                item.Click += new EventHandler(themeMenuItem_Click);
                themeMenuItem.DropDownItems.Add(item);
            }

            ToolStripSeparator sep2 = new ToolStripSeparator();
            sep2.Name = "  ";
            themeMenuItem.DropDownItems.Add(sep2);
            ToolStripMenuItem saveItem = new ToolStripMenuItem("Save Layout As Theme...");
            saveItem.Click += new EventHandler(saveUserTheme_Click);
            themeMenuItem.DropDownItems.Add(saveItem);

            // Unpacks the values of UserThemes to Globals.themes
            Globals.UserThemes = new Dictionary<string, Theme>();
            foreach (string s in Properties.Settings.Default.UserThemes) {
                Theme t = UnpackThemeFromString(s);
                Globals.Themes.Add(t.Name, t);
                Globals.UserThemes.Add(t.Name, t);
            }

            // Adds user created themes menu items
            if (Globals.UserThemes.Count > 0) {
                AddUserThemeSeparator();
                foreach (string s in Globals.UserThemes.Keys) {
                    Theme t = Globals.UserThemes[s];
                    AddUserThemeMenuItem(t.Name);
                }
            }

            ToolTip toolTip = new ToolTip();
            toolTip.ShowAlways = true;
            toolTip.SetToolTip(cReadOnly, "Toggles between Edit Mode and Read-Only Mode");
            toolTip.SetToolTip(cDisableHK, "Toggle this to disable the global hotkeys");
            toolTip.SetToolTip(bAddAfter, "Adds a new slide after this slide");
            toolTip.SetToolTip(bAddBefore, "Adds a new slide before this slide");
            toolTip.SetToolTip(bAddBegin, "Adds a new slide before the first slide");
            toolTip.SetToolTip(bAddEnd, "Adds a new slide after the last slide");
            toolTip.SetToolTip(bRemove, "Removes the current slide");
            toolTip.SetToolTip(bNextSlide, "Next Slide");
            toolTip.SetToolTip(bPrevSlide, "Previous Slide");
            toolTip.SetToolTip(bFirstSlide, "First Slide");
            toolTip.SetToolTip(bLastSlide, "Last Slide");

            bool exampleOpen = true;
            int j = 0;
            while (j < Properties.Settings.Default.FileNames.Count) {
                TextSplitShow TSS = new TextSplitShow((string)Properties.Settings.Default.FileNames[j], false);
                if (TSS.fileLoaded) {
                    Globals.OpenNewWindow(TSS);
                    if (exampleOpen) {
                        exampleOpen = false;
                    }
                    j++;
                } else {
                    Globals.WindowList.RemoveAt(Globals.WindowList.Count - 1);
                    Properties.Settings.Default.FileNames.RemoveAt(j);
                }
            }

            // Opens example
            if (exampleOpen) {
                TextSplitShow example = new TextSplitShow("", true);
                Globals.OpenNewWindow(example);
                example.fileLoaded = false;
            }
        }
Esempio n. 10
0
 public void OpenFileNewWindow(string title)
 {
     openFileDialog.Filter = "TextSplit Text File|*.tst";
     openFileDialog.Title = title;
     if (openFileDialog.ShowDialog() != DialogResult.Cancel && openFileDialog.FileName != "") {
         string newFileName = openFileDialog.FileName;
         TextSplitShow TSS = new TextSplitShow(newFileName, true);
         TSS.TST = serializer.DeSerializeObject(newFileName);
         Globals.OpenNewWindow(TSS);
     }
 }