public MainMenuStrip(WindowMain mainWindow, Tabs tabs, BottomStatusBar statusBar)
            : base()
        {
            this.mainWindow = mainWindow;
            this.tabs = tabs;
            this.statusBar = statusBar;

            ToolStripMenuItem fileMenu = new ToolStripMenuItem("File");

            itemOpen = new ToolStripMenuItem("Open...");
            itemOpen.ShortcutKeys = Keys.Control | Keys.O;
            itemOpen.Click += new EventHandler(openClick);
            fileMenu.DropDownItems.Add(itemOpen);

            itemSave = new ToolStripMenuItem("Save");
            itemSave.Click += new EventHandler(saveClick);
            itemSave.ShortcutKeys = Keys.Control | Keys.S;
            itemSave.Enabled = false;
            fileMenu.DropDownItems.Add(itemSave);

            itemSaveAs = new ToolStripMenuItem("Save As...");
            itemSaveAs.Click += new EventHandler(saveAsClick);
            itemSaveAs.ShortcutKeys = Keys.Control | Keys.Alt | Keys.S;
            itemSaveAs.Enabled = false;
            fileMenu.DropDownItems.Add(itemSaveAs);

            fileMenu.DropDownItems.Add(new ToolStripSeparator());

            itemClose = new ToolStripMenuItem("Close");
            itemClose.Click += new EventHandler(closeClick);
            itemClose.ShortcutKeys = Keys.Control | Keys.W;
            itemClose.Enabled = false;
            fileMenu.DropDownItems.Add(itemClose);

            itemCloseAll = new ToolStripMenuItem("Close all");
            itemCloseAll.Click += new EventHandler(closeAllClick);
            itemCloseAll.ShortcutKeys = Keys.Control | Keys.Alt | Keys.W;
            itemCloseAll.Enabled = false;
            fileMenu.DropDownItems.Add(itemCloseAll);

            fileMenu.DropDownItems.Add(new ToolStripSeparator());

            itemExit = new ToolStripMenuItem("Exit");
            itemExit.Click += new EventHandler(exitClick);
            itemExit.ShortcutKeys = Keys.Alt | Keys.F4;
            fileMenu.DropDownItems.Add(itemExit);

            Items.Add(fileMenu);

            ToolStripMenuItem helpMenu = new ToolStripMenuItem("Help");

            itemAbout = new ToolStripMenuItem("About");
            itemAbout.Click += new EventHandler(aboutClick);
            helpMenu.DropDownItems.Add(itemAbout);

            Items.Add(helpMenu);
        }
Esempio n. 2
0
        public WindowMain()
            : base()
        {
            Text = "7DaysProfileEditor";
            StartPosition = FormStartPosition.CenterScreen;
            WindowState = FormWindowState.Maximized;

            tabs = new Tabs(this);
            statusBar = new BottomStatusBar();
            mainMenu = new MainMenuStrip(this, tabs, statusBar);

            Controls.Add(tabs);
            Controls.Add(mainMenu);
            Controls.Add(statusBar);

            //Show();
        }
Esempio n. 3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainWindow()
        {
            Size = new Size(1000, 850);

            Text            = "7 Days Profile Editor - v" + Assembly.GetEntryAssembly().GetName().Version;
            StartPosition   = FormStartPosition.CenterScreen;
            FormBorderStyle = FormBorderStyle.FixedSingle;
            MaximizeBox     = false;

            tabs      = new PlayerTabControl(this);
            statusBar = new BottomStatusBar();
            mainMenu  = new MainMenuStrip(this, tabs, statusBar);

            focusDummy      = new Label();
            focusDummy.Size = new Size(0, 0);
            Controls.Add(focusDummy);

            Controls.Add(tabs);
            Controls.Add(mainMenu);
            Controls.Add(statusBar);
        }
Esempio n. 4
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="mainWindow">The program main window</param>
 /// <param name="playerTabControl">Tab control that holds all ttp files</param>
 /// <param name="statusBar">Status bar of the main window</param>
 public MainMenuActions(MainWindow mainWindow, PlayerTabControl playerTabControl, BottomStatusBar statusBar)
 {
     this.mainWindow       = mainWindow;
     this.playerTabControl = playerTabControl;
     this.bottomStatusBar  = statusBar;
 }
        /// <summary>
        /// Default contructor.
        /// </summary>
        /// <param name="mainWindow">Main window of the program</param>
        /// <param name="tabsControlPlayer">Tab control that holds all the ttps</param>
        /// <param name="statusBar">Bottom status bar</param>
        public MainMenuStrip(MainWindow mainWindow, PlayerTabControl tabsControlPlayer, BottomStatusBar statusBar)
        {
            this.playerTabs = tabsControlPlayer;

            mainMenuActions = new MainMenuActions(mainWindow, tabsControlPlayer, statusBar);

            ToolStripMenuItem fileMenu = new ToolStripMenuItem("File");

            itemOpen = new ToolStripMenuItem("Open...");
            itemOpen.ShortcutKeys = Keys.Control | Keys.O;
            itemOpen.Click       += new EventHandler(OpenClick);
            fileMenu.DropDownItems.Add(itemOpen);

            itemReload = new ToolStripMenuItem("Reload");
            itemReload.ShortcutKeys = Keys.Control | Keys.R;
            itemReload.Click       += new EventHandler(ReloadClick);
            itemReload.Enabled      = false;
            fileMenu.DropDownItems.Add(itemReload);

            itemSave              = new ToolStripMenuItem("Save");
            itemSave.Click       += new EventHandler(SaveClick);
            itemSave.ShortcutKeys = Keys.Control | Keys.S;
            itemSave.Enabled      = false;
            fileMenu.DropDownItems.Add(itemSave);

            itemSaveAs              = new ToolStripMenuItem("Save As...");
            itemSaveAs.Click       += new EventHandler(SaveAsClick);
            itemSaveAs.ShortcutKeys = Keys.Control | Keys.Alt | Keys.S;
            itemSaveAs.Enabled      = false;
            fileMenu.DropDownItems.Add(itemSaveAs);

            fileMenu.DropDownItems.Add(new ToolStripSeparator());

            itemClose              = new ToolStripMenuItem("Close");
            itemClose.Click       += new EventHandler(CloseClick);
            itemClose.ShortcutKeys = Keys.Control | Keys.W;
            itemClose.Enabled      = false;
            fileMenu.DropDownItems.Add(itemClose);

            itemCloseAll              = new ToolStripMenuItem("Close all");
            itemCloseAll.Click       += new EventHandler(CloseAllClick);
            itemCloseAll.ShortcutKeys = Keys.Control | Keys.Alt | Keys.W;
            itemCloseAll.Enabled      = false;
            fileMenu.DropDownItems.Add(itemCloseAll);

            fileMenu.DropDownItems.Add(new ToolStripSeparator());

            itemExit              = new ToolStripMenuItem("Exit");
            itemExit.Click       += new EventHandler(ExitClick);
            itemExit.ShortcutKeys = Keys.Alt | Keys.F4;
            fileMenu.DropDownItems.Add(itemExit);

            Items.Add(fileMenu);

            ToolStripMenuItem helpMenu = new ToolStripMenuItem("Help");

            itemSendReport        = new ToolStripMenuItem("Send error report");
            itemSendReport.Click += new EventHandler(sendReportClick);
            helpMenu.DropDownItems.Add(itemSendReport);

            itemAbout        = new ToolStripMenuItem("About");
            itemAbout.Click += new EventHandler(AboutClick);
            helpMenu.DropDownItems.Add(itemAbout);

            Items.Add(helpMenu);
        }