From: <ju...@us...> - 2008-05-15 01:32:57
|
Revision: 3058 http://urakawa.svn.sourceforge.net/urakawa/?rev=3058&view=rev Author: julienq Date: 2008-05-14 18:32:56 -0700 (Wed, 14 May 2008) Log Message: ----------- Wrapping works but drawing is not so nice... Modified Paths: -------------- trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/Block.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/Strip.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs trunk/urakawa/application/Obi/Obi/ProjectView/StripCursor.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/TOCView.Designer.cs trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.Designer.cs Modified: trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/AudioBlock.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -33,6 +33,7 @@ // // mWaveform // + this.mWaveform.AccessibleRole = System.Windows.Forms.AccessibleRole.None; this.mWaveform.Cursor = System.Windows.Forms.Cursors.IBeam; this.mWaveform.Location = new System.Drawing.Point(3, 3); this.mWaveform.Name = "mWaveform"; @@ -41,10 +42,10 @@ this.mWaveform.TabIndex = 1; this.mWaveform.Text = "waveform1"; this.mWaveform.DoubleClick += new System.EventHandler(this.mWaveform_DoubleClick); + this.mWaveform.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mWaveform_MouseMove); this.mWaveform.Click += new System.EventHandler(this.mWaveform_Click); + this.mWaveform.KeyUp += new System.Windows.Forms.KeyEventHandler(this.mWaveform_KeyUp); this.mWaveform.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mWaveform_MouseDown); - this.mWaveform.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mWaveform_MouseMove); - this.mWaveform.KeyUp += new System.Windows.Forms.KeyEventHandler(this.mWaveform_KeyUp); this.mWaveform.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mWaveform_MouseUp); this.mWaveform.KeyDown += new System.Windows.Forms.KeyEventHandler(this.mWaveform_KeyDown); // @@ -52,6 +53,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.Controls.Add(this.mWaveform); + this.DoubleBuffered = true; this.Name = "AudioBlock"; this.Controls.SetChildIndex(this.mWaveform, 0); this.Controls.SetChildIndex(this.mLabel, 0); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/Block.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/Block.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/Block.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -48,6 +48,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.HotPink; this.Controls.Add(this.mLabel); + this.DoubleBuffered = true; this.Margin = new System.Windows.Forms.Padding(0, 0, 3, 3); this.Name = "Block"; this.Size = new System.Drawing.Size(104, 104); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/ProjectView.designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -32,13 +32,13 @@ this.mFindInTextSplitter = new System.Windows.Forms.SplitContainer(); this.mTOCSplitter = new System.Windows.Forms.SplitContainer(); this.mMetadataSplitter = new System.Windows.Forms.SplitContainer(); - this.mPanelInfoLabelButton = new System.Windows.Forms.Button(); - this.mNoProjectLabel = new System.Windows.Forms.Label(); this.mTOCView = new Obi.ProjectView.TOCView(); this.mMetadataView = new Obi.ProjectView.MetadataView(); + this.mPanelInfoLabelButton = new System.Windows.Forms.Button(); this.mStripsView = new Obi.ProjectView.StripsView(); this.mFindInText = new Obi.ProjectView.FindInText(); this.mTransportBar = new Obi.ProjectView.TransportBar(); + this.mNoProjectLabel = new System.Windows.Forms.Label(); this.mTransportBarSplitter.Panel1.SuspendLayout(); this.mTransportBarSplitter.Panel2.SuspendLayout(); this.mTransportBarSplitter.SuspendLayout(); @@ -132,33 +132,6 @@ this.mMetadataSplitter.SplitterDistance = 379; this.mMetadataSplitter.TabIndex = 0; // - // mPanelInfoLabelButton - // - this.mPanelInfoLabelButton.AccessibleName = "Panel Splitter"; - this.mPanelInfoLabelButton.AccessibleRole = System.Windows.Forms.AccessibleRole.None; - this.mPanelInfoLabelButton.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.mPanelInfoLabelButton.AutoSize = true; - this.mPanelInfoLabelButton.BackColor = System.Drawing.Color.Transparent; - this.mPanelInfoLabelButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.mPanelInfoLabelButton.Location = new System.Drawing.Point(-5, -1); - this.mPanelInfoLabelButton.Name = "mPanelInfoLabelButton"; - this.mPanelInfoLabelButton.Size = new System.Drawing.Size(6, 6); - this.mPanelInfoLabelButton.TabIndex = 2; - this.mPanelInfoLabelButton.UseVisualStyleBackColor = false; - this.mPanelInfoLabelButton.Leave += new System.EventHandler(this.mPanelInfoLabelButton_Leave); - this.mPanelInfoLabelButton.Enter += new System.EventHandler(this.mPanelInfoLabelButton_Enter); - // - // mNoProjectLabel - // - this.mNoProjectLabel.Anchor = System.Windows.Forms.AnchorStyles.None; - this.mNoProjectLabel.AutoSize = true; - this.mNoProjectLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.mNoProjectLabel.Location = new System.Drawing.Point(442, 340); - this.mNoProjectLabel.Name = "mNoProjectLabel"; - this.mNoProjectLabel.Size = new System.Drawing.Size(81, 20); - this.mNoProjectLabel.TabIndex = 1; - this.mNoProjectLabel.Text = "No project"; - // // mTOCView // this.mTOCView.AutoScroll = true; @@ -180,6 +153,22 @@ this.mMetadataView.Size = new System.Drawing.Size(271, 244); this.mMetadataView.TabIndex = 0; // + // mPanelInfoLabelButton + // + this.mPanelInfoLabelButton.AccessibleName = "Panel Splitter"; + this.mPanelInfoLabelButton.AccessibleRole = System.Windows.Forms.AccessibleRole.None; + this.mPanelInfoLabelButton.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.mPanelInfoLabelButton.AutoSize = true; + this.mPanelInfoLabelButton.BackColor = System.Drawing.Color.Transparent; + this.mPanelInfoLabelButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.mPanelInfoLabelButton.Location = new System.Drawing.Point(-5, -1); + this.mPanelInfoLabelButton.Name = "mPanelInfoLabelButton"; + this.mPanelInfoLabelButton.Size = new System.Drawing.Size(6, 6); + this.mPanelInfoLabelButton.TabIndex = 2; + this.mPanelInfoLabelButton.UseVisualStyleBackColor = false; + this.mPanelInfoLabelButton.Leave += new System.EventHandler(this.mPanelInfoLabelButton_Leave); + this.mPanelInfoLabelButton.Enter += new System.EventHandler(this.mPanelInfoLabelButton_Enter); + // // mStripsView // this.mStripsView.BackColor = System.Drawing.Color.Transparent; @@ -208,6 +197,17 @@ this.mTransportBar.Size = new System.Drawing.Size(1060, 35); this.mTransportBar.TabIndex = 0; // + // mNoProjectLabel + // + this.mNoProjectLabel.Anchor = System.Windows.Forms.AnchorStyles.None; + this.mNoProjectLabel.AutoSize = true; + this.mNoProjectLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.mNoProjectLabel.Location = new System.Drawing.Point(442, 340); + this.mNoProjectLabel.Name = "mNoProjectLabel"; + this.mNoProjectLabel.Size = new System.Drawing.Size(81, 20); + this.mNoProjectLabel.TabIndex = 1; + this.mNoProjectLabel.Text = "No project"; + // // ProjectView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -215,6 +215,7 @@ this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.mNoProjectLabel); this.Controls.Add(this.mTransportBarSplitter); + this.DoubleBuffered = true; this.Name = "ProjectView"; this.Size = new System.Drawing.Size(964, 700); this.mTransportBarSplitter.Panel1.ResumeLayout(false); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/Strip.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/Strip.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/Strip.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -73,6 +73,7 @@ this.BackColor = System.Drawing.Color.LightSkyBlue; this.Controls.Add(this.mLabel); this.Controls.Add(this.mBlocksPanel); + this.DoubleBuffered = true; this.Margin = new System.Windows.Forms.Padding(0, 0, 0, 3); this.Name = "Strip"; this.Padding = new System.Windows.Forms.Padding(3); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/Strip.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -308,10 +308,23 @@ { mWrap = value; UpdateSize(); + if (mWrap) + { + mParentView.SizeChanged += new EventHandler(mParentView_SizeChanged); + } + else + { + mParentView.SizeChanged -= new EventHandler(mParentView_SizeChanged); + } } } + void mParentView_SizeChanged(object sender, EventArgs e) + { + UpdateSize(); + } + #region ISearchable Members public string ToMatch() @@ -325,7 +338,6 @@ private void AddCursor(int index) { StripCursor cursor = new StripCursor(this); - cursor.Size = new Size(12, mBlocksPanel.Height); cursor.BackColor = Color.SkyBlue; mBlocksPanel.Controls.Add(cursor); mBlocksPanel.Controls.SetChildIndex(cursor, index); @@ -418,11 +430,25 @@ // Update the size of the strip to use the available width of the view private void UpdateSize() { - // Compute the minimum width of the block panel - int minBlockPanelWidth = 0; - foreach (Control c in mBlocksPanel.Controls) minBlockPanelWidth += c.Width; - MinimumSize = new Size(minBlockPanelWidth + mBlocksPanel.Margin.Left + mBlocksPanel.Margin.Right, MinimumSize.Height); - System.Diagnostics.Debug.Print(">-< Strip minimum size is " + MinimumSize); + // System.Diagnostics.Debug.Print("<-> Update size"); + if (mWrap) + { + MinimumSize = new Size(ParentView.Width, MinimumSize.Height); + Width = ParentView.Width; + mBlocksPanel.AutoSize = true; + mBlocksPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; + mBlocksPanel.WrapContents = true; + Height = mBlocksPanel.Location.Y + mBlocksPanel.Height + mBlocksPanel.Margin.Bottom; + } + else + { + mBlocksPanel.AutoSize = false; + mBlocksPanel.WrapContents = false; + // Compute the minimum width of the block panel + int minBlockPanelWidth = 0; + foreach (Control c in mBlocksPanel.Controls) minBlockPanelWidth += c.Width; + MinimumSize = new Size(minBlockPanelWidth + mBlocksPanel.Margin.Left + mBlocksPanel.Margin.Right, MinimumSize.Height); + } } private void Strip_SizeChanged(object sender, EventArgs e) Modified: trunk/urakawa/application/Obi/Obi/ProjectView/StripCursor.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/StripCursor.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/StripCursor.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -33,7 +33,8 @@ // StripCursor // this.AccessibleName = "Strip Cursor"; - this.Margin = new System.Windows.Forms.Padding(0); + this.Margin = new System.Windows.Forms.Padding(0, 0, 0, 3); + this.Size = new System.Drawing.Size(12, 104); this.TabStop = false; this.ResumeLayout(false); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/StripsView.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -50,6 +50,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.mLayoutPanel); + this.DoubleBuffered = true; this.Name = "StripsView"; this.Size = new System.Drawing.Size(398, 297); this.Enter += new System.EventHandler(this.StripsView_Enter); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/TOCView.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/TOCView.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/TOCView.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -54,6 +54,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.Controls.Add(this.mTOCTree); + this.DoubleBuffered = true; this.Name = "TOCView"; this.ResumeLayout(false); Modified: trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.Designer.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.Designer.cs 2008-05-15 00:49:53 UTC (rev 3057) +++ trunk/urakawa/application/Obi/Obi/ProjectView/TransportBar.Designer.cs 2008-05-15 01:32:56 UTC (rev 3058) @@ -364,10 +364,11 @@ this.Controls.Add(this.mStopButton); this.Controls.Add(this.mPlayButton); this.Controls.Add(this.mPauseButton); + this.DoubleBuffered = true; this.Name = "TransportBar"; this.Size = new System.Drawing.Size(945, 35); + this.Leave += new System.EventHandler(this.TransportBar_Leave); this.Enter += new System.EventHandler(this.TransportBar_Enter); - this.Leave += new System.EventHandler(this.TransportBar_Leave); this.ResumeLayout(false); this.PerformLayout(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |