public MainForm() { InitializeComponent(); // Load global settings this.mGlobalSettings = new GlobalSettings(); this.mLocalSettings = LocalSettings.GetInstance(); // Restore the size Size = mLocalSettings.m_size; if ((Size.Height < 100) || (Size.Width < 200)) { Size lsize = new Size(); lsize.Height = 500; lsize.Width = 800; this.Size = lsize; } //register the viewer manager classes //qq there must be a better way of doing this, it seems a bit // odd. Could use reflection. Might be a little slow or have // unexpected side-effects. It's nice to be able to control // the order the tabs appear in, too. ViewTabActions.Tag = ActionsViewer.InitialiseViewer(this); ViewTabXML.Tag = XMLViewer.InitialiseViewer(this); ViewTabFlat.Tag = FlatViewer.InitialiseViewer(this); ViewTabImg.Tag = ImageViewer.InitialiseViewer(this); ViewTabBump.Tag = BumpViewer.InitialiseViewer(this); ViewTabSteering.Tag = SteeringViewer.InitialiseViewer(this); ViewTabCamera.Tag = CameraViewer.InitialiseViewer(this); ViewTabGrid.Tag = GridViewer.InitialiseViewer(this); ViewTab3D.Tag = ThreeDeeViewer.InitialiseViewer(this); ViewTabVRAM.Tag = VRAMViewer.InitialiseViewer(this); ViewTab3dEditor.Tag = ThreeDeeEditor.InitialiseViewer(this); ViewTabHistory.Tag = HistoryViewer.InitialiseViewer(this); //auto-load last level if (mLocalSettings.LastOpenedFile != null) { LoadInternal(mLocalSettings.LastOpenedType, mLocalSettings.LastOpenedFile); } }