コード例 #1
0
        public DebuggerPanel(IDEWindow parent)
        {
            this.parent = parent;

            InitializeComponent();

            this.Icon = GraphicsResx.debug;

            this.numServerPort.Minimum = 1;
            this.numServerPort.Maximum = UInt16.MaxValue;
            numServerPort.Value = Math.Max(numServerPort.Minimum, Math.Min(numServerPort.Maximum, Convert.ToDecimal(SettingsManagement.LastGDBPort)));

            this.dropHardwareSelection.SelectedIndex = 0;
            this.dropHardwareSelection.SelectedIndex = dropHardwareSelection.Items.IndexOf(SettingsManagement.LastICEHardware);
            if (this.dropHardwareSelection.SelectedIndex < 0)
                this.dropHardwareSelection.SelectedIndex = 0;
            this.dropHardwareSelection.SelectedIndexChanged += new EventHandler(dropHardwareSelection_SelectedIndexChanged);

            numBitRate.Value = Math.Max(numBitRate.Minimum, Math.Min(numBitRate.Maximum, Convert.ToDecimal(SettingsManagement.LastJTAGFreq)));

            dropHardwareSelection_SelectedIndexChanged(null, null);

            this.txtAVaRICEOtherOpts.Text = SettingsManagement.LastICEOptions;
            this.txtJTAGPort.Text = SettingsManagement.LastJTAGPort;

            DisableButtons();

            if (CheckForAVARICE() == false)
            {
                this.Enabled = false;
            }
        }
コード例 #2
0
        public ExternalTool(string text, string cmd, string args, string dir, IDEWindow editor)
        {
            this.wind = editor;

            if (text == null)
                text = "";

            if (cmd == null)
                cmd = "";

            if (args == null)
                args = "";

            if (dir == null)
                dir = "";

            this.mbtn.Text = text;

            this.cmdStr = cmd;
            this.argsStr = args;
            this.dirStr = dir;

            this.mbtn.Click += new EventHandler(mbtn_Click);
        }
コード例 #3
0
ファイル: IDEWindow.cs プロジェクト: bh1rio/avr-project-ide
        private void IDEWindow_Load(object sender, EventArgs e)
        {
            curOpenWind = this;

            // fill external tools
            try
            {
                this.toolsToolStripMenuItem.DropDownItems.Add(ExternalTool.GetExternalToolsRoot(this));
            }
            catch (Exception ex)
            {
                messageWin.MessageBoxModify(TextBoxChangeMode.AppendNewLine, "Error Loading External Tools:, " + ex.Message);
            }

            SettingsManagement.LoadWindowState(this);

            Program.SplashScreen.BringToFront();
            Program.SplashScreen.Activate();

            bool useSavedDockSettings = false;
            // if workspace setting exists, load it
            string workspaceName = "workspace_version_" + Properties.Resources.PanelWorkspaceVersion + ".xml";
            if (File.Exists(SettingsManagement.AppDataPath + workspaceName))
            {
                DeserializeDockContent deserDockCont = new DeserializeDockContent(GetPanelFromPersistString);
                try
                {
                    dockPanel1.LoadFromXml(SettingsManagement.AppDataPath + workspaceName, deserDockCont);
                    useSavedDockSettings = true;
                }
                catch { }
            }

            if (useSavedDockSettings)
            {
                fileTreeWin.Show(dockPanel1);
                messageWin.Show(dockPanel1);
                searchWin.Show(dockPanel1);
                serialWin.Show(dockPanel1);
                usbWin.Show(dockPanel1);
                disassemViewer.Show(dockPanel1);
                hardwareExplorerWin.Show(dockPanel1);
                #if DEBUGGERWINTEST
                debuggerWin.Show(dockPanel1);
                #endif
            }
            else
            {
                // if an xml was not loaded, do the default config
                fileTreeWin.Show(dockPanel1, DockState.DockLeft);
                messageWin.Show(dockPanel1, DockState.DockBottom);
                searchWin.Show(dockPanel1, DockState.DockBottom);
                serialWin.Show(dockPanel1, DockState.DockBottom);
                usbWin.Show(dockPanel1, DockState.DockBottom);
                disassemViewer.Show(dockPanel1, DockState.DockBottom);
                hardwareExplorerWin.Show(dockPanel1, DockState.DockRightAutoHide);
                #if DEBUGGERWINTEST
                debuggerWin.Show(dockPanel1, DockState.DockRightAutoHide);
                #endif
            }

            Program.SplashScreen.Close();

            searchWin.Activate();

            if (project.IsReady == false && SettingsManagement.WelcomeWindowAtStart)
            {
                WelcomeWindow ww = new WelcomeWindow(project);
                ww.ShowDialog();
            }

            if (project.IsReady)
            {
                HandleNewOpenProj(project);
            }
        }
コード例 #4
0
ファイル: EditorPanel.cs プロジェクト: bh1rio/avr-project-ide
        public EditorPanel(ProjectFile file, AVRProject project, IDEWindow parent)
        {
            InitializeComponent();

            this.parent = parent;
            this.file = file;
            this.project = project;

            SettingsManagement.LoadEditorState(this);

            this.Icon = GraphicsResx.file;
        }
コード例 #5
0
        public static ToolStripMenuItem GetExternalToolsRoot(IDEWindow wind)
        {
            ToolStripMenuItem root = new ToolStripMenuItem("External Tools");

            root.Image = GraphicsResx.tool_icon_png;

            XmlDocument xDoc = new XmlDocument();

            if (File.Exists(SettingsManagement.AppDataPath + "ext_tools.xml") == false)
            {
                try
                {
                    File.WriteAllText(SettingsManagement.AppDataPath + "ext_tools.xml", Properties.Resources.ext_tools);
                    xDoc.Load(SettingsManagement.AppDataPath + "ext_tools.xml");
                }
                catch
                {
                    xDoc.LoadXml(Properties.Resources.ext_tools);
                }
            }
            else
            {
                try
                {
                    xDoc.Load(SettingsManagement.AppDataPath + "ext_tools.xml");
                }
                catch (XmlException ex)
                {
                    MessageBox.Show("Error while reading ext_tools.xml: " + ex.Message);
                    return root;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error while reading ext_tools.xml: " + ex.Message);
                    return root;
                }
            }

            try
            {
                XmlElement xDocEle = xDoc.DocumentElement;

                foreach (XmlElement xEle in xDocEle.GetElementsByTagName("Tool"))
                {
                    ExternalTool link = new ExternalTool(xEle.GetAttribute("text"), xEle.GetAttribute("cmd"), xEle.GetAttribute("args"), xEle.GetAttribute("dir"), wind);
                    link.mbtn.Image = GraphicsResx.tool_icon_png;
                    toolList.Add(link);
                    root.DropDownItems.Add(link.mbtn);
                }
            }
            catch (Exception ex)
            {
                ErrorReportWindow.Show(ex, "Error while creating external tool buttons");
            }

            return root;
        }