private void InitializeComponent()\r
{\r
this.components = new System.ComponentModel.Container();\r
- this.gbZoom = new System.Windows.Forms.GroupBox();\r
+ this.pnlDebug = new System.Windows.Forms.GroupBox();\r
this.cbMisc = new System.Windows.Forms.CheckBox();\r
this.lblDrawDistance = new System.Windows.Forms.Label();\r
this.tbDrawDistance = new System.Windows.Forms.TrackBar();\r
this.cbAA = new System.Windows.Forms.CheckBox();\r
this.chkWireFrame = new System.Windows.Forms.CheckBox();\r
this.ctxMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
- this.gbZoom.SuspendLayout();\r
+ this.pnlDebug.SuspendLayout();\r
((System.ComponentModel.ISupportInitialize)(this.tbDrawDistance)).BeginInit();\r
this.SuspendLayout();\r
// \r
- // gbZoom\r
- // \r
- this.gbZoom.Controls.Add(this.cbMisc);\r
- this.gbZoom.Controls.Add(this.lblDrawDistance);\r
- this.gbZoom.Controls.Add(this.tbDrawDistance);\r
- this.gbZoom.Controls.Add(this.button_driver);\r
- this.gbZoom.Controls.Add(this.textBox_driveramount);\r
- this.gbZoom.Controls.Add(this.label6);\r
- this.gbZoom.Controls.Add(this.comboBox_driver);\r
- this.gbZoom.Controls.Add(this.button1);\r
- this.gbZoom.Controls.Add(this.textBox_morphamount);\r
- this.gbZoom.Controls.Add(this.label5);\r
- this.gbZoom.Controls.Add(this.comboBox_morph);\r
- this.gbZoom.Controls.Add(this.textBox_sz);\r
- this.gbZoom.Controls.Add(this.textBox_sy);\r
- this.gbZoom.Controls.Add(this.label4);\r
- this.gbZoom.Controls.Add(this.textBox_sx);\r
- this.gbZoom.Controls.Add(this.label3);\r
- this.gbZoom.Controls.Add(this.label1);\r
- this.gbZoom.Controls.Add(this.textBox_z);\r
- this.gbZoom.Controls.Add(this.textBox_y);\r
- this.gbZoom.Controls.Add(this.comboBox1);\r
- this.gbZoom.Controls.Add(this.button_vparam);\r
- this.gbZoom.Controls.Add(this.textBox_x);\r
- this.gbZoom.Controls.Add(this.hsLOD);\r
- this.gbZoom.Controls.Add(this.hsSpecular);\r
- this.gbZoom.Controls.Add(this.hsDiffuse);\r
- this.gbZoom.Controls.Add(this.hsAmbient);\r
- this.gbZoom.Controls.Add(this.label2);\r
- this.gbZoom.Controls.Add(this.btnResetView);\r
- this.gbZoom.Controls.Add(this.cbAA);\r
- this.gbZoom.Controls.Add(this.chkWireFrame);\r
- this.gbZoom.Dock = System.Windows.Forms.DockStyle.Bottom;\r
- this.gbZoom.Location = new System.Drawing.Point(0, 337);\r
- this.gbZoom.Name = "gbZoom";\r
- this.gbZoom.Size = new System.Drawing.Size(779, 163);\r
- this.gbZoom.TabIndex = 8;\r
- this.gbZoom.TabStop = false;\r
- this.gbZoom.Enter += new System.EventHandler(this.gbZoom_Enter);\r
+ // pnlDebug\r
+ // \r
+ this.pnlDebug.Controls.Add(this.cbMisc);\r
+ this.pnlDebug.Controls.Add(this.lblDrawDistance);\r
+ this.pnlDebug.Controls.Add(this.tbDrawDistance);\r
+ this.pnlDebug.Controls.Add(this.button_driver);\r
+ this.pnlDebug.Controls.Add(this.textBox_driveramount);\r
+ this.pnlDebug.Controls.Add(this.label6);\r
+ this.pnlDebug.Controls.Add(this.comboBox_driver);\r
+ this.pnlDebug.Controls.Add(this.button1);\r
+ this.pnlDebug.Controls.Add(this.textBox_morphamount);\r
+ this.pnlDebug.Controls.Add(this.label5);\r
+ this.pnlDebug.Controls.Add(this.comboBox_morph);\r
+ this.pnlDebug.Controls.Add(this.textBox_sz);\r
+ this.pnlDebug.Controls.Add(this.textBox_sy);\r
+ this.pnlDebug.Controls.Add(this.label4);\r
+ this.pnlDebug.Controls.Add(this.textBox_sx);\r
+ this.pnlDebug.Controls.Add(this.label3);\r
+ this.pnlDebug.Controls.Add(this.label1);\r
+ this.pnlDebug.Controls.Add(this.textBox_z);\r
+ this.pnlDebug.Controls.Add(this.textBox_y);\r
+ this.pnlDebug.Controls.Add(this.comboBox1);\r
+ this.pnlDebug.Controls.Add(this.button_vparam);\r
+ this.pnlDebug.Controls.Add(this.textBox_x);\r
+ this.pnlDebug.Controls.Add(this.hsLOD);\r
+ this.pnlDebug.Controls.Add(this.hsSpecular);\r
+ this.pnlDebug.Controls.Add(this.hsDiffuse);\r
+ this.pnlDebug.Controls.Add(this.hsAmbient);\r
+ this.pnlDebug.Controls.Add(this.label2);\r
+ this.pnlDebug.Controls.Add(this.btnResetView);\r
+ this.pnlDebug.Controls.Add(this.cbAA);\r
+ this.pnlDebug.Controls.Add(this.chkWireFrame);\r
+ this.pnlDebug.Dock = System.Windows.Forms.DockStyle.Bottom;\r
+ this.pnlDebug.Location = new System.Drawing.Point(0, 337);\r
+ this.pnlDebug.Name = "pnlDebug";\r
+ this.pnlDebug.Size = new System.Drawing.Size(779, 163);\r
+ this.pnlDebug.TabIndex = 8;\r
+ this.pnlDebug.TabStop = false;\r
// \r
// cbMisc\r
// \r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
- this.Controls.Add(this.gbZoom);\r
+ this.Controls.Add(this.pnlDebug);\r
this.Name = "SceneWindow";\r
this.Size = new System.Drawing.Size(779, 500);\r
this.Load += new System.EventHandler(this.ControlLoaded);\r
- this.gbZoom.ResumeLayout(false);\r
- this.gbZoom.PerformLayout();\r
+ this.pnlDebug.ResumeLayout(false);\r
+ this.pnlDebug.PerformLayout();\r
((System.ComponentModel.ISupportInitialize)(this.tbDrawDistance)).EndInit();\r
this.ResumeLayout(false);\r
\r
\r
#endregion\r
\r
- public System.Windows.Forms.GroupBox gbZoom;\r
+ public System.Windows.Forms.GroupBox pnlDebug;\r
public System.Windows.Forms.ContextMenuStrip ctxMenu;\r
public System.Windows.Forms.CheckBox cbAA;\r
public System.Windows.Forms.CheckBox chkWireFrame;\r
namespace Radegast.Rendering\r
{\r
\r
- public partial class SceneWindow : DettachableControl\r
+ public partial class SceneWindow : RadegastTabControl\r
{\r
#region Public fields\r
/// <summary>\r
\r
#region Construction and disposal\r
public SceneWindow(RadegastInstance instance)\r
- : base()\r
+ : base(instance)\r
{\r
InitializeComponent();\r
Disposed += new EventHandler(frmPrimWorkshop_Disposed);\r
\r
this.Instance = instance;\r
this.Client = instance.Client;\r
-\r
+ \r
UseMultiSampling = cbAA.Checked = instance.GlobalSettings["use_multi_sampling"];\r
cbAA.CheckedChanged += cbAA_CheckedChanged;\r
\r
}\r
#endregion Construction and disposal\r
\r
+ #region Tab Events\r
+ public void RegisterTabEvents()\r
+ {\r
+ this.RadegastTab.TabAttached += new EventHandler(RadegastTab_TabAttached);\r
+ this.RadegastTab.TabDetached += new EventHandler(RadegastTab_TabDetached);\r
+ this.RadegastTab.TabClosed += new EventHandler(RadegastTab_TabClosed);\r
+ }\r
+\r
+ public void UnregisterTabEvents()\r
+ {\r
+ this.RadegastTab.TabAttached -= new EventHandler(RadegastTab_TabAttached);\r
+ this.RadegastTab.TabDetached -= new EventHandler(RadegastTab_TabDetached);\r
+ this.RadegastTab.TabClosed -= new EventHandler(RadegastTab_TabClosed);\r
+ }\r
+\r
+ void RadegastTab_TabDetached(object sender, EventArgs e)\r
+ {\r
+ instance.GlobalSettings["scene_window_docked"] = false;\r
+ pnlDebug.Visible = true;\r
+ }\r
+\r
+ void RadegastTab_TabAttached(object sender, EventArgs e)\r
+ {\r
+ instance.GlobalSettings["scene_window_docked"] = true;\r
+ pnlDebug.Visible = false;\r
+ }\r
+\r
+ void RadegastTab_TabClosed(object sender, EventArgs e)\r
+ {\r
+ if (this.RadegastTab != null)\r
+ {\r
+ UnregisterTabEvents();\r
+ }\r
+ }\r
+\r
+ #endregion Tab Events\r
+\r
#region Network messaage handlers\r
void Terrain_LandPatchReceived(object sender, LandPatchReceivedEventArgs e)\r
{\r
miscEnabled = cbMisc.Checked;\r
AvatarRenderingEnabled = miscEnabled;\r
}\r
-\r
-\r
}\r
}\r