Ejemplo n.º 1
0
        public FormMain()
        {
            InitializeComponent();

            // Setup Devlog
            DevLog.setup("logs.txt");

            DockContainer = new DockContainer();
            DockContainer.MainForm = this;
            DockContainer.Dock = DockStyle.Fill;

            this.toolStripContainer1.ContentPanel.Controls.Add(this.DockContainer);

            DockContainer.ShowDocumentIcon = true;

            DockContainer.DocumentStyle = DocumentStyles.DockingWindow;

            DockContainer.ActiveDocumentChanged += new EventHandler(_DockContainer_ActiveDocumentChanged);

            DockContainer.ActiveContentChanged += new EventHandler(_DockContainer_ActiveContentChanged);

            DockContainer.ContextMenu = new ContextMenu();

            ///=========================Integration with SharpDevelop Start==================================

            Assembly exe = this.GetType().Assembly;

            ResourceService.RegisterNeutralStrings(new ResourceManager("PAT.GUI.Properties.StringResources", exe));
            ResourceService.RegisterNeutralImages(new ResourceManager("PAT.GUI.Properties.BitmapResources", exe));

            WorkbenchSingleton.DockContainer = DockContainer;
            WorkbenchSingleton.InitializeWorkbench();

            CoreStartup startup = new CoreStartup(Common.Utility.Utilities.APPLICATION_NAME);
            startup.ConfigDirectory = Common.Utility.Utilities.APPLICATION_PATH;// Application.StartupPath;
            startup.DataDirectory = Common.Utility.Utilities.APPLICATION_PATH;// Application.StartupPath;

            startup.StartCoreServices();

            startup.RunInitialization();
            ///=========================Integration with SharpDevelop End==================================

            // Change the message of the splash screen for loading modules
            SplashScreen.SplashScreen.UpdateStatusText("Loading modules..");

            // Load modules
            LoadModules();

            // After load the modules, close the splash screen
            SplashScreen.SplashScreen.UpdateStatusText("Modules Loaded");

            ToolStripMenuItem[] tools = GetNewFileItems();

            ToolbarButton_New.DropDownItems.AddRange(tools);
            ToolStripItem wizardItem = ToolbarButton_New.DropDownItems[0];
            ToolbarButton_New.DropDownItems.RemoveAt(0);
            ToolbarButton_New.DropDownItems.Add(new ToolStripSeparator());
            ToolbarButton_New.DropDownItems.Add(wizardItem);

            tools = GetNewFileItems();

            MenuButton_New.DropDownItems.AddRange(tools);
            wizardItem = MenuButton_New.DropDownItems[0];
            MenuButton_New.DropDownItems.RemoveAt(0);
            MenuButton_New.DropDownItems.Add(new ToolStripSeparator());
            MenuButton_New.DropDownItems.Add(wizardItem);

            this.LoadRecents();

            this.FormClosing += new FormClosingEventHandler(FormMain_FormClosing);

            ((ToolStripProfessionalRenderer)StandardToolBar.Renderer).ColorTable.UseSystemColors = true; ((ToolStripProfessionalRenderer)StandardToolBar.Renderer).ColorTable.UseSystemColors = true;
            ((ToolStripProfessionalRenderer)convertToolbar.Renderer).ColorTable.UseSystemColors = true;

            Output_Window = new OutputDockingWindow();
            Output_Window.Icon = Common.Utility.Utilities.GetIcon("Output");
            Output_Window.Disposed += new EventHandler(output_Window_Disposed);

            ErrorListWindow = new ErrorListWindow();
            ErrorListWindow.Icon = Common.Utility.Utilities.GetIcon("ErrorList");
            ErrorListWindow.Disposed += new EventHandler(ErrorListWindow_Disposed);
            ErrorListWindow.ListView.DoubleClick += new EventHandler(ErrorListView_DoubleClick);

            ModelExplorerWindow = new ModelExplorerWindow();
            ModelExplorerWindow.Icon = Common.Utility.Utilities.GetIcon("ModelExplorer");
            ModelExplorerWindow.Disposed += new EventHandler(ModelExplorerWindowWindow_Disposed);
            ModelExplorerWindow.TreeView_Model.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(TreeView_Model_NodeMouseDoubleClick);
            ModelExplorerWindow.Button_Refresh.Click += new EventHandler(Button_SpecParse_Click);

            FindUsagesWindow = new FindUsagesWindow();
            FindUsagesWindow.Icon = Common.Utility.Utilities.GetIcon("Find Usages");
            FindUsagesWindow.Disposed += new EventHandler(FindUsagesWindow_Disposed);
            FindUsagesWindow.ListView.DoubleClick += new EventHandler(FindUsagesWindow_DoubleClick);
            FindUsagesWindow.Button_Refresh.Click += new EventHandler(Button_Refresh_Click);

            //check the correct language menu
            foreach (ToolStripMenuItem item in this.MenuButton_Languages.DropDownItems)
            {
                if (item.Tag.ToString() == GUIUtility.GUI_LANGUAGE)
                {
                    item.Checked = true;
                    break;
                }
            }

            SetFormMainCaption();

            this.toolStripContainer1.TopToolStripPanel.Controls.Clear();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.convertToolbar);
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.StandardToolBar);
            this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.MenuStrip);

            convertToolbar.Location = new Point(3, 48);
            StandardToolBar.Location = new Point(3, 24);
            MenuStrip.Dock = DockStyle.Top;
            MenuStrip.Location = new Point(0, 0);
            MenuButton_Japanese.Visible = false;

            CheckForItemState();
        }
Ejemplo n.º 2
0
        private void showErrorListToolStripMenuItem_CheckStateChanged(object sender, EventArgs e)
        {
            try
            {
                do
                {
                    if (MenuButton_ErrorList.Checked == false)
                    {
                        try { ErrorListWindow.Hide(); }
                        catch (Exception) { }
                        break;
                    }

                    if (ErrorListWindow.IsDisposed)
                    {
                        ErrorListWindow = new ErrorListWindow();
                        ErrorListWindow.Icon = Utilities.GetIcon("ErrorList");
                        ErrorListWindow.Disposed += new EventHandler(ErrorListWindow_Disposed);
                        ErrorListWindow.ListView.DoubleClick += new EventHandler(ErrorListView_DoubleClick);
                        ChangeFormCulture.ChangeForm(ErrorListWindow, Thread.CurrentThread.CurrentUICulture.Name);
                    }
                    ErrorListWindow.Show(DockContainer);

                } while (false);
            }
            catch (Exception ex)
            {
                Utilities.LogException(ex, null);
            }
        }