Beispiel #1
0
        protected override void DoCommandAction()
        {
            CommandExecuter.Instance.GUIActive = true;
            GoAhead.GUI.GUI gui = new GoAhead.GUI.GUI();
            gui.FormsToLoadOnStartup.AddRange(FormsToLoadOnStartup);
            gui.CommandToExecuteOnLoad.AddRange(GUICommands.Where(cmd => cmd is OpenScriptInDebugger));

            foreach (GUICommand addCmd in GUICommands.Where(cmd => cmd is AddUserElement))
            {
                CommandExecuter.Instance.Execute(addCmd);
            }
            GUICommands.Clear();

            // store FPGA View for SaveFPGAViewAsBitmap
            m_FPGAView = gui.FPGAView;
            try
            {
                gui.ShowDialog();
            }
            catch (Exception) { }

            CommandHook            hook         = CommandExecuter.Instance.GetAllHooks().FirstOrDefault(h => h is PrintProgressToGUIHook);
            PrintProgressToGUIHook progressHook = (PrintProgressToGUIHook)hook;

            progressHook.m_forms.Add(gui);

            CommandExecuter.Instance.GUIActive = false;
        }
        public FPGAViewCtrl()
        {
            InitializeComponent();

            UpdateDrawingOptionsMenu();

            BindingSource macroBsrc = new BindingSource();

            macroBsrc.DataSource = Library.Instance.LibraryElements;
            m_toolStripDrpDownMacro.ComboBox.DisplayMember = "Name";
            m_toolStripDrpDownMacro.ComboBox.ValueMember   = "Name";
            m_toolStripDrpDownMacro.ComboBox.DataSource    = macroBsrc;

            BindingSource selBsrc = new BindingSource();

            selBsrc.DataSource = TileSelectionManager.Instance.UserSelectionTypes;

            m_toolStripTopDrpDownSelect.ComboBox.DataSource = selBsrc;
            // be notified about reset
            Commands.Reset.ObjectsToReset.Add(this);

            m_timer.Interval = 1000;
            m_timer.Tick    += ShowToolTipAfterTimerFired;

            Reset();

            PrintProgressToGUIHook hook = new PrintProgressToGUIHook();

            hook.ProgressBar = m_toolStripProgressBar;
            CommandExecuter.Instance.AddHook(hook);
        }