コード例 #1
0
        public OctarineWindow(OctarineController tcontroller)
        {
            controller = tcontroller;
            controller.SetWindow(this);
            this.Shown += (sender, e) => {
                _CurrentWindow = this;
                controller.Initiate();
            };

            this.Size = new Size(800, 600);
            this.Text = "Octarine";

            edt_result           = new RichTextBox();
            edt_result.Size      = new Size(760, 560);
            edt_result.Location  = new Point(20, 20);
            edt_result.ReadOnly  = true;
            edt_result.Multiline = true;
            this.Controls.Add(edt_result);

            MenuStrip ms = new MenuStrip();

            ms.Parent = this;
            ToolStripMenuItem mb_file = new ToolStripMenuItem("&Plik");
            ToolStripMenuItem mi_open = new ToolStripMenuItem("&Otwórz", null,
                                                              new EventHandler((sender, e) => { BrowseFile(); }));

            mi_open.ShortcutKeys = Keys.Control | Keys.O;
            mb_file.DropDownItems.Add(mi_open);
            ToolStripMenuItem mi_save = new ToolStripMenuItem("Zapi&sz", null,
                                                              new EventHandler((sender, e) => { SaveFile(); }));

            mi_save.ShortcutKeys = Keys.Control | Keys.S;
            mb_file.DropDownItems.Add(mi_save);
            ToolStripMenuItem mi_exit = new ToolStripMenuItem("Za&kończ", null,
                                                              new EventHandler((sender, e) => { this.Close(); }));

            mb_file.DropDownItems.Add(mi_exit);
            ms.Items.Add(mb_file);
            ToolStripMenuItem mb_tools    = new ToolStripMenuItem("&Narzędzia");
            ToolStripMenuItem mi_settings = new ToolStripMenuItem("Wybór &silnika", null,
                                                                  new EventHandler((sender, e) => {
                OctarineSettingsWindow wnd_settings = new OctarineSettingsWindow(this.controller);
                wnd_settings.ShowDialog(this);
            }));

            mb_tools.DropDownItems.Add(mi_settings);
            ms.Items.Add(mb_tools);
            foreach (ToolStripMenuItem mi in additionalMenus)
            {
                ms.Items.Add(mi);
            }
            MainMenuStrip = ms;
        }
コード例 #2
0
ファイル: controller.cs プロジェクト: dawidpieper/Octarine
 public void SetWindow(OctarineWindow twnd)
 {
     wnd = twnd;
 }