[xiph-commits] r7320 - in trunk/oggdsf: sln/oggdsf_all

illiminable at dactyl.lonelymoon.com illiminable
Sun Jul 25 00:49:11 PDT 2004


src/lib/core/ogg/libVorbisComment src/tools/iOCE
Message-ID: <20040725074911.000AC9AAAB at dactyl.lonelymoon.com>

Author: illiminable
Date: Sun Jul 25 00:49:11 2004
New Revision: 7320

Modified:
trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.vcproj
trunk/oggdsf/src/tools/iOCE/frmMain.cs
trunk/oggdsf/src/tools/iOCE/frmMain.resx
Log:
* More GUI stuff.

Modified: trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln
===================================================================
--- trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-07-24 21:26:36 UTC (rev 7319)
+++ trunk/oggdsf/sln/oggdsf_all/oggdsf_all.sln	2004-07-25 07:49:07 UTC (rev 7320)
@@ -983,6 +983,7 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libVorbisComment", "..\..\src\lib\core\ogg\libVorbisComment\libVorbisComment.vcproj", "{DC4D86E2-72C1-4995-8FB1-0F08655E620A}"
ProjectSection(ProjectDependencies) = postProject
+		{223ACC19-608E-4E1B-A054-067F0CACB272} = {223ACC19-608E-4E1B-A054-067F0CACB272}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OOOggCommentDump", "..\..\src\tools\OOOggCommentDump\OOOggCommentDump.vcproj", "{43DE5FC7-7E6F-43FE-AD8A-FBBA7AF5D139}"

Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.vcproj
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.vcproj	2004-07-24 21:26:36 UTC (rev 7319)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.vcproj	2004-07-25 07:49:07 UTC (rev 7320)
@@ -33,10 +33,9 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
-				AdditionalDependencies="libOOOgg.lib"
OutputFile="$(OutDir)/libVorbisComment.dll"
LinkIncremental="2"
-				AdditionalLibraryDirectories="..\libOOOgg\Debug"
+				AdditionalLibraryDirectories=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/libVorbisComment.pdb"
SubSystem="2"

Modified: trunk/oggdsf/src/tools/iOCE/frmMain.cs
===================================================================
--- trunk/oggdsf/src/tools/iOCE/frmMain.cs	2004-07-24 21:26:36 UTC (rev 7319)
+++ trunk/oggdsf/src/tools/iOCE/frmMain.cs	2004-07-25 07:49:07 UTC (rev 7320)
@@ -52,11 +52,83 @@
locItem = new ListViewItem(locSubItems);
lsvUserComments.Items.Add(locItem);
}
+
+		}
+
+		private void editSelectedUserComment()
+		{
+			ListView.SelectedListViewItemCollection locSelected = lsvUserComments.SelectedItems;

+			if (locSelected.Count == 1)
+			{
+				ListViewItem locItem = locSelected[0];
+				ListViewItem.ListViewSubItemCollection locSubItems = locItem.SubItems;
+
+				frmAddComment locAddForm = new frmAddComment();
+				locAddForm.Text = "Edit Comment...";
+				locAddForm.Key = locSubItems[0].Text;
+				locAddForm.Value = locSubItems[1].Text;

+
+				locAddForm.ShowDialog();
+				if (locAddForm.wasOK == true)
+				{
+					String[] locSubItemStr = new String[2];
+					locSubItemStr[0] = locAddForm.Key;
+					locSubItemStr[1] = locAddForm.Value;
+					lsvUserComments.Items.Remove(locItem);
+					locItem = new ListViewItem(locSubItemStr);
+
+					lsvUserComments.Items.Add(locItem);
+				}
+			}


}
+
+		private void addUserComment()
+		{
+			ListViewItem locItem = null;
+
+			frmAddComment locAddForm = new frmAddComment();
+			locAddForm.ShowDialog();
+			if (locAddForm.wasOK == true)
+			{
+				String[] locSubItems = new String[2];
+				locSubItems[0] = locAddForm.Key;
+				locSubItems[1] = locAddForm.Value;
+				locItem = new ListViewItem(locSubItems);
+				lsvUserComments.Items.Add(locItem);
+			}
+		}
+
+		private void removeSelectedUserComment()
+		{
+			//Get the selection of items
+			ListView.SelectedListViewItemCollection locSelected = lsvUserComments.SelectedItems;
+
+			if (locSelected.Count == 1)
+			{
+				//Remember where we were selected from
+				int locIndex = lsvUserComments.SelectedIndices[0];
+
+				//Remove the selected item
+				lsvUserComments.Items.Remove(locSelected[0]);
+
+				//Hightlight a line again
+				if (locIndex < lsvUserComments.Items.Count)
+				{
+					//Highlight the line where we were
+					lsvUserComments.Items[locIndex].Selected = true;
+				}
+				else if (lsvUserComments.Items.Count != 0)
+				{
+					//Highlight the last line if we were previously the last line
+					lsvUserComments.Items[lsvUserComments.Items.Count - 1].Selected = true;
+				}
+			}
+
+		}
public frmMain()
{
//
@@ -209,8 +281,11 @@
this.lsvUserComments.MultiSelect = false;
this.lsvUserComments.Name = "lsvUserComments";
this.lsvUserComments.Size = new System.Drawing.Size(600, 128);
+			this.lsvUserComments.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.lsvUserComments.TabIndex = 2;
this.lsvUserComments.View = System.Windows.Forms.View.Details;
+			this.lsvUserComments.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lsvUserComments_KeyDown);
+			this.lsvUserComments.DoubleClick += new System.EventHandler(this.lsvUserComments_DoubleClick);
//
// colKey
//
@@ -291,64 +366,44 @@

private void cmdAdd_Click(object sender, System.EventArgs e)
{
-
-			ListViewItem locItem = null;
-
-			frmAddComment locAddForm = new frmAddComment();
-			locAddForm.ShowDialog();
-			if (locAddForm.wasOK == true)
-			{
-				String[] locSubItems = new String[2];
-				locSubItems[0] = locAddForm.Key;
-				locSubItems[1] = locAddForm.Value;
-				locItem = new ListViewItem(locSubItems);
-				lsvUserComments.Items.Add(locItem);
-			}
-
+			addUserComment();
}

private void cmdEdit_Click(object sender, System.EventArgs e)
{
-			ListView.SelectedListViewItemCollection locSelected = lsvUserComments.SelectedItems;
-
-
-
-			if (locSelected.Count == 1)
-			{
-				ListViewItem locItem = locSelected[0];
-				ListViewItem.ListViewSubItemCollection locSubItems = locItem.SubItems;
-
-				frmAddComment locAddForm = new frmAddComment();
-				locAddForm.Text = "Edit Comment...";
-				locAddForm.Key = locSubItems[0].Text;
-				locAddForm.Value = locSubItems[1].Text;
-
-
-				locAddForm.ShowDialog();
-				if (locAddForm.wasOK == true)
-				{
-					String[] locSubItemStr = new String[2];
-					locSubItemStr[0] = locAddForm.Key;
-					locSubItemStr[1] = locAddForm.Value;
-					lsvUserComments.Items.Remove(locItem);
-					locItem = new ListViewItem(locSubItemStr);
-
-					lsvUserComments.Items.Add(locItem);
-				}
-			}
+			editSelectedUserComment();
}

private void cmdRemove_Click(object sender, System.EventArgs e)
{
-			ListView.SelectedListViewItemCollection locSelected = lsvUserComments.SelectedItems;
-
-
-
-			if (locSelected.Count == 1)
-			{
-				ListViewItem locItem = locSelected[0];
-				lsvUserComments.Items.Remove(locItem);
+			removeSelectedUserComment();
+		}
+
+		private void lsvUserComments_DoubleClick(object sender, System.EventArgs e)
+		{
+			editSelectedUserComment();
+		}
+
+		private void lsvUserComments_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
+		{
+			switch(e.KeyCode) {
+
+				case Keys.Delete:
+					removeSelectedUserComment();
+					e.Handled = true;
+					break;
+				case Keys.Insert:
+					addUserComment();
+					e.Handled = true;
+					break;
+				case Keys.Enter:
+					editSelectedUserComment();
+					e.Handled = true;
+					break;
+
}
}
+
+
}
}

Modified: trunk/oggdsf/src/tools/iOCE/frmMain.resx
===================================================================
--- trunk/oggdsf/src/tools/iOCE/frmMain.resx	2004-07-24 21:26:36 UTC (rev 7319)
+++ trunk/oggdsf/src/tools/iOCE/frmMain.resx	2004-07-25 07:49:07 UTC (rev 7320)
@@ -178,10 +178,10 @@
<data name="cmdAdd.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
-  <data name="cmdAdd.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <data name="cmdAdd.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
-  <data name="cmdAdd.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <data name="cmdAdd.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="lsvUserComments.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -250,6 +250,9 @@
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
@@ -268,7 +271,4 @@
<data name="$this.Name">
<value>frmMain</value>
</data>
-  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>Private</value>
-  </data>
</root>
\ No newline at end of file



More information about the commits mailing list