scrolling hax

This commit is contained in:
Chris Forbes
2009-10-28 23:30:13 +13:00
parent 4d9903bd7c
commit b15bd4aa59
2 changed files with 20 additions and 4 deletions

View File

@@ -33,11 +33,13 @@
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.panel1 = new System.Windows.Forms.Panel();
this.surface1 = new SequenceEditor.Surface(); this.surface1 = new SequenceEditor.Surface();
this.toolStripContainer1.ContentPanel.SuspendLayout(); this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout(); this.toolStripContainer1.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// toolStripContainer1 // toolStripContainer1
@@ -45,7 +47,7 @@
// //
// toolStripContainer1.ContentPanel // toolStripContainer1.ContentPanel
// //
this.toolStripContainer1.ContentPanel.Controls.Add(this.surface1); this.toolStripContainer1.ContentPanel.Controls.Add(this.panel1);
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(708, 518); this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(708, 518);
this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStripContainer1.Location = new System.Drawing.Point(0, 0); this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
@@ -66,7 +68,7 @@
this.toolStripButton2}); this.toolStripButton2});
this.toolStrip1.Location = new System.Drawing.Point(3, 0); this.toolStrip1.Location = new System.Drawing.Point(3, 0);
this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(191, 25); this.toolStrip1.Size = new System.Drawing.Size(160, 25);
this.toolStrip1.TabIndex = 0; this.toolStrip1.TabIndex = 0;
// //
// toolStripButton1 // toolStripButton1
@@ -89,9 +91,19 @@
this.toolStripButton2.Text = "Save"; this.toolStripButton2.Text = "Save";
this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click); this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
// //
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.surface1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(708, 518);
this.panel1.TabIndex = 0;
//
// surface1 // surface1
// //
this.surface1.Dock = System.Windows.Forms.DockStyle.Fill; this.surface1.Dock = System.Windows.Forms.DockStyle.Top;
this.surface1.Location = new System.Drawing.Point(0, 0); this.surface1.Location = new System.Drawing.Point(0, 0);
this.surface1.Name = "surface1"; this.surface1.Name = "surface1";
this.surface1.Size = new System.Drawing.Size(708, 518); this.surface1.Size = new System.Drawing.Size(708, 518);
@@ -113,6 +125,7 @@
this.toolStripContainer1.PerformLayout(); this.toolStripContainer1.PerformLayout();
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.panel1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -120,10 +133,11 @@
#endregion #endregion
private System.Windows.Forms.ToolStripContainer toolStripContainer1; private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private Surface surface1;
private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1; private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ToolStripButton toolStripButton2; private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.Panel panel1;
private Surface surface1;
} }
} }

View File

@@ -204,6 +204,8 @@ namespace SequenceEditor
e.Graphics.FillRectangle(Brushes.Silver, toolPoint.Value.X, toolPoint.Value.Y, size.Width, size.Height); e.Graphics.FillRectangle(Brushes.Silver, toolPoint.Value.X, toolPoint.Value.Y, size.Width, size.Height);
e.Graphics.DrawString(toolText, Font, Brushes.Black, toolPoint.Value.X, toolPoint.Value.Y); e.Graphics.DrawString(toolText, Font, Brushes.Black, toolPoint.Value.X, toolPoint.Value.Y);
} }
Height = Math.Max( Parent.ClientSize.Height, y );
} }
} }