示例#1
0
        public HXMEditor(EditorHXMFile datafile, StandardUI host, SaveHandler saveHandler)
        {
            InitializeComponent();

            robotPanel      = new EditorPanels.RobotPanel(transactionManager, 0);
            robotPanel.Dock = DockStyle.Fill;
            RobotTabPage.Controls.Add(robotPanel);
            components.Add(robotPanel);
            polymodelPanel      = new EditorPanels.PolymodelPanel(transactionManager, 1, host.DefaultPigFile, host.DefaultPalette, datafile);
            polymodelPanel.Dock = DockStyle.Fill;
            ModelTabPage.Controls.Add(polymodelPanel);
            components.Add(polymodelPanel);

            this.datafile = datafile;
            this.host     = host;
            palette       = host.DefaultPalette;
            modelRenderer = new ModelRenderer(datafile.BaseHAM, host.DefaultPigFile, palette);

            string currentFilename = "Untitled";

            if (saveHandler != null)
            {
                currentFilename = saveHandler.GetUIName();
            }

            this.saveHandler = saveHandler;
            this.Text        = string.Format("{0} - HXM Editor", currentFilename);

            transactionManager.undoEvent += DoUndoEvent;
        }
示例#2
0
        public HXMEditor(EditorHXMFile datafile, StandardUI host, string filename)
        {
            InitializeComponent();
            //can't use GLControls with designer? eh?
            glControl1          = new GLControl();
            glControl1.Location = new System.Drawing.Point(pictureBox3.Location.X, pictureBox3.Location.Y);
            glControl1.Size     = pictureBox3.Size;
            glControl1.Load    += glControl1_Load;
            glControl1.Paint   += glControl1_Paint;
            glControl1.Visible  = true;
            glControl1.Enabled  = true;
            tabPage7.Controls.Add(glControl1);
            tabPage7.PerformLayout();
            pictureBox3.Enabled = false;
            pictureBox3.Visible = false;

            robotPanel      = new EditorPanels.RobotPanel();
            robotPanel.Dock = DockStyle.Fill;
            RobotTabPage.Controls.Add(robotPanel);
            components.Add(robotPanel);

            this.datafile = datafile;
            this.host     = host;
            palette       = host.DefaultPalette;
            modelRenderer = new ModelRenderer(datafile.BaseHAM, host.DefaultPigFile, palette);
            this.Text     = string.Format("{0} - HXM Editor", currentFilename);
        }