Example #1
0
        public IDockContent DelegateHandler(string name)
        {
            string[] split = name.Split(':');
            switch (split[0])
            {
            case "Control":
                if (myButtonBar == null)
                {
                    myButtonBar = new ButtonBar("Control");
                }
                return(myButtonBar);

            case "Log":
            {
                foreach (LogView lv in myLogs)
                {
                    if (lv.viewName == name)
                    {
                        return(lv);
                    }
                }
                LogView t = new LogView("Log", "Log");
                myLogs.Add(t);
                return(t);
            }

            case "Registers":
                if (myNewRegisters == null)
                {
                    myNewRegisters = new Registers("Registers", "Registers");
                }
                return(myNewRegisters);

            case "Disassembly":
                if (myDisassembly == null)
                {
                    myDisassembly = new Disassembly("Disassembly", "Disassembly");
                }
                return(myDisassembly);

            case "Screen":
                if (myScreen == null)
                {
                    myScreen = new SpectrumScreen("Screen", "Screen");
                }
                return(myScreen);

            case "Breakpoints":
                if (myBreakpoints == null)
                {
                    myBreakpoints = new Breakpoint("Breakpoints", "Breakpoints");
                }
                return(myBreakpoints);

            case "SpritePatterns":
            {
                foreach (BaseDock sv in myDocks)
                {
                    if (sv.viewName == name)
                    {
                        return(sv);
                    }
                }
                SpriteView t = new SpriteView("Sprite Patterns", "SpritePatterns");
                myDocks.Add(t);
                return(t);
            }

            default:
                break;
            }
            return(null);
        }
Example #2
0
        public MainForm()
        {
            Program.myMainForm = this;
            //myDocks = new List<BaseDock>();
            InitializeComponent();

            sourceCodeView = new SourceCodeView();



            //spawn source window and dock it
            mySourceWindow          = new SourceWindow("", "");
            mySourceWindow.TopLevel = false;
            LeftsplitContainer.Panel1.Controls.Add(mySourceWindow);
            mySourceWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            mySourceWindow.Dock            = DockStyle.Fill;
            mySourceWindow.Show();

            //spawn log
            myLog          = new LogView("", "");
            myLog.TopLevel = false;
            LeftsplitContainer.Panel2.Controls.Add(myLog);
            myLog.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            myLog.Dock            = DockStyle.Fill;
            myLog.Show();



            //spawn register window
            myNewRegisters          = new Registers("", "");
            myNewRegisters.TopLevel = false;
            RightFlow.Controls.Add(myNewRegisters);
            myNewRegisters.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            //myNewRegisters.Dock = DockStyle.Fill;
            myNewRegisters.Show();

            //add dissasembly window
            myDisassembly          = new Disassembly("", "");
            myDisassembly.TopLevel = false;
            RightFlow.Controls.Add(myDisassembly);
            myDisassembly.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            myDisassembly.Dock            = DockStyle.Fill;
            myDisassembly.Show();


            //add watch window
            myWatchWindow          = new Watch();
            myWatchWindow.TopLevel = false;
            RightFlow.Controls.Add(myWatchWindow);
            myWatchWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            myWatchWindow.Dock            = DockStyle.Fill;
            myWatchWindow.Show();



            //this.IsMdiContainer = true;
            //this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
            //this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.Controls.Add(this.dockPanel);

            UpdateStatus();

            /*
             * if (File.Exists("layout.xml"))
             * {
             * dockPanel.LoadFromXml("layout.xml",DelegateHandler);
             * }
             * else
             * {
             * myButtonBar = new ButtonBar("Control");
             * myLogs.Add(new LogView("Log", "Log"));
             * myNewRegisters = new Registers("Registers", "Registers");
             * myDisassembly = new Disassembly("Disassembly", "Disassembly");
             * myScreen = new SpectrumScreen("Screen", "Screen");
             * myBreakpoints = new Breakpoint("Breakpoints", "Breakpoints");
             * myDocks.Add(new SpriteView("Sprite Patterns", "SpritePatterns"));
             *
             * myButtonBar.Show(this.dockPanel, DockState.DockTop);
             * myNewRegisters.Show(this.dockPanel, DockState.DockLeft);
             * myDisassembly.Show(this.dockPanel, DockState.DockRight);
             * myLogs[0].Show(this.dockPanel, DockState.DockBottom);
             * myBreakpoints.Show(this.dockPanel, DockState.DockLeft);
             * myScreen.Show(this.dockPanel, DockState.DockRight);
             * myDocks[0].Show(this.dockPanel, DockState.Float);
             * }
             */
            Program.telnetConnection.SendCommand("help", null);
            refreshScreen = false;


            if (!string.IsNullOrEmpty(TraceDataPath))
            {
                if (System.IO.File.Exists(TraceDataPath))
                {
                    TraceFile.ParseTraceData(TraceDataPath);
                    if (mySourceWindow != null)
                    {
                        mySourceWindow.InitSourceWindow(Path.GetDirectoryName(TraceDataPath));
                    }
                }
            }

            Invalidate();
        }