Example #1
0
        private void btnInstructions_Click(object sender, EventArgs e)
        {
            FormInstructions formInst = new FormInstructions();

            formInst.ShowDialog();
        }
Example #2
0
        private void GetModuleMenus(ToolStrip menu)
        {
            // Affectation of .Text property happens in RefreshCultureMenu

            #region File
            mnuFile.MergeAction      = MergeAction.Append;
            mnuOpenFile.Image        = Properties.Resources.folder;
            mnuOpenFile.ShortcutKeys = Keys.Control | Keys.O;
            mnuOpenFile.Click       += mnuOpenFileOnClick;

            mnuOpenReplayWatcher.Image  = Properties.Resources.user_detective;
            mnuOpenReplayWatcher.Click += mnuOpenReplayWatcherOnClick;

            mnuHistory.Image = Properties.Resources.time;

            NotificationCenter.RaiseRecentFilesChanged(this);
            mnuHistoryReset.Image  = Properties.Resources.bin_empty;
            mnuHistoryReset.Click += mnuHistoryResetOnClick;

            mnuQuit.Image  = Properties.Resources.quit;
            mnuQuit.Click += new EventHandler(menuQuitOnClick);

            mnuFile.DropDownItems.AddRange(new ToolStripItem[] {
                mnuOpenFile,
                mnuOpenReplayWatcher,
                mnuHistory,
                new ToolStripSeparator(),
                // -> Here will be plugged the other file menus (save, export)
                new ToolStripSeparator(),
                mnuQuit
            });

            #endregion

            #region Edit
            mnuEdit.MergeAction = MergeAction.Append;

            mnuUndo.Tag          = RootLang.ResourceManager;
            mnuUndo.Image        = Properties.Resources.arrow_undo;
            mnuUndo.ShortcutKeys = Keys.Control | Keys.Z;
            mnuUndo.Enabled      = false;

            mnuRedo.Tag          = RootLang.ResourceManager;
            mnuRedo.Image        = Properties.Resources.arrow_redo;
            mnuRedo.ShortcutKeys = Keys.Control | Keys.Y;
            mnuRedo.Enabled      = false;

            HistoryMenuManager.RegisterMenus(mnuUndo, mnuRedo);

            mnuEdit.DropDownItems.AddRange(new ToolStripItem[] { mnuUndo, mnuRedo });
            #endregion

            #region View
            mnuToggleFileExplorer.Image        = Properties.Resources.explorer;
            mnuToggleFileExplorer.Checked      = true;
            mnuToggleFileExplorer.CheckState   = System.Windows.Forms.CheckState.Checked;
            mnuToggleFileExplorer.ShortcutKeys = Keys.F4;
            mnuToggleFileExplorer.Click       += new EventHandler(mnuToggleFileExplorerOnClick);
            mnuFullScreen.Image        = Properties.Resources.fullscreen;
            mnuFullScreen.ShortcutKeys = Keys.F11;
            mnuFullScreen.Click       += new EventHandler(mnuFullScreenOnClick);

            mnuView.DropDownItems.AddRange(new ToolStripItem[] { mnuToggleFileExplorer, mnuFullScreen, new ToolStripSeparator() });
            #endregion

            #region Options
            mnuLanguages.Image = Properties.Resources.international;
            foreach (KeyValuePair <string, string> lang in LanguageManager.Languages)
            {
                ToolStripMenuItem mnuLang = new ToolStripMenuItem(lang.Value);
                mnuLang.Tag    = lang.Key;
                mnuLang.Click += mnuLanguage_OnClick;
                languageMenus.Add(lang.Key, mnuLang);
                mnuLanguages.DropDownItems.Add(mnuLang);
            }

            mnuPreferences.Image  = Properties.Resources.wrench;
            mnuPreferences.Click += new EventHandler(mnuPreferencesOnClick);
            mnuTimecode.Image     = Properties.Resources.time_edit;

            mnuTimecodeClassic.Click       += new EventHandler(mnuTimecodeClassic_OnClick);
            mnuTimecodeFrames.Click        += new EventHandler(mnuTimecodeFrames_OnClick);
            mnuTimecodeMilliseconds.Click  += new EventHandler(mnuTimecodeMilliseconds_OnClick);
            mnuTimecodeMicroseconds.Click  += new EventHandler(mnuTimecodeMicroseconds_OnClick);
            mnuTimecodeTimeAndFrames.Click += new EventHandler(mnuTimecodeTimeAndFrames_OnClick);
            mnuTimecodeNormalized.Click    += new EventHandler(mnuTimecodeNormalized_OnClick);

            mnuTimecode.DropDownItems.AddRange(new ToolStripItem[] { mnuTimecodeClassic, mnuTimecodeFrames, mnuTimecodeMilliseconds, mnuTimecodeMicroseconds, mnuTimecodeTimeAndFrames });

            mnuOptions.DropDownItems.AddRange(new ToolStripItem[] {
                mnuLanguages,
                mnuTimecode,
                new ToolStripSeparator(),
                mnuPreferences
            });
            #endregion

            #region Help
            mnuHelpContents.Image        = Properties.Resources.book_open;
            mnuHelpContents.ShortcutKeys = Keys.F1;
            mnuHelpContents.Click       += new EventHandler(mnuHelpContents_OnClick);
            mnuApplicationFolder.Image   = Properties.Resources.bug;
            mnuApplicationFolder.Click  += (s, e) =>
            {
                FilesystemHelper.LocateFile(Path.Combine(Software.SettingsDirectory, "log.txt"));
            };

            mnuWebsite.Image  = Properties.Resources.website;
            mnuWebsite.Click += (s, e) => Process.Start("https://www.kinovea.org");
            mnuAbout.Image    = Properties.Resources.information;
            mnuAbout.Click   += new EventHandler(mnuAbout_OnClick);

            mnuAboutCM.Image  = Properties.Resources.information;
            mnuAboutCM.Click += (s, e) =>
            {
                FormAboutCH formAbout = new FormAboutCH();
                formAbout.ShowDialog();
            };

            mnuHelpCM.Image  = Properties.Resources.book_open;
            mnuHelpCM.Click += (s, e) =>
            {
                FormInstructions formInsCM = new FormInstructions();
                formInsCM.Show();
            };

            mnuHelp.DropDownItems.AddRange(new ToolStripItem[] {
                mnuHelpCM,
                mnuHelpContents,
                new ToolStripSeparator(),
                mnuApplicationFolder,
                new ToolStripSeparator(),
                mnuWebsite,
                new ToolStripSeparator(),
                mnuAboutCM,
                mnuAbout,
            });
            #endregion

            // Top level merge.
            MenuStrip thisMenuStrip = new MenuStrip();
            thisMenuStrip.Items.AddRange(new ToolStripItem[] { mnuFile, mnuEdit, mnuView, mnuImage, mnuVideo, mnuTools, mnuOptions, mnuHelp });
            thisMenuStrip.AllowMerge = true;

            ToolStripManager.Merge(thisMenuStrip, menu);

            // We need to affect the Text properties before merging with submenus.
            RefreshCultureMenu();
        }