chronojump r369 - in trunk: . build/data build/data/locale/es/LC_MESSAGES glade src src/gui



Author: xaviblas
Date: Mon Mar 10 16:21:19 2008
New Revision: 369
URL: http://svn.gnome.org/viewvc/chronojump?rev=369&view=rev

Log:
0.62-svn4
sort in treeviewperson
sort in load person, and load person from other session (all columns)
load person from other session now has a combo outside (all, none)


Modified:
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/locale/es/LC_MESSAGES/chronojump.mo
   trunk/build/data/version.txt
   trunk/changelog.txt
   trunk/glade/chronojump.glade
   trunk/src/gui/chronojump.cs
   trunk/src/gui/person.cs
   trunk/src/treeViewPerson.cs
   trunk/src/util.cs
   trunk/src/utilGtk.cs
   trunk/version.txt

Modified: trunk/build/data/chronojump.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/chronojump_mini.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/locale/es/LC_MESSAGES/chronojump.mo
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/version.txt
==============================================================================
--- trunk/build/data/version.txt	(original)
+++ trunk/build/data/version.txt	Mon Mar 10 16:21:19 2008
@@ -1 +1 @@
-0.62-svn3
+0.62-svn4

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Mon Mar 10 16:21:19 2008
@@ -1,5 +1,11 @@
 CHRONOJUMP DETAILED CHANGELOG:
 
+10 mar 2008
+	0.62-svn4
+	sort in treeviewperson
+	sort in load person, and load person from other session (all columns)
+	load person from other session now has a combo outside (all, none)
+
 25 feb 2008 (2)
 	restored Makefile
 	added missing src/gui/generic.cs

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Mon Mar 10 16:21:19 2008
@@ -1255,6 +1255,61 @@
       </child>
 
       <child>
+	<widget class="GtkHBox" id="hbox_combo_select_checkboxes_hide">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">6</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label503">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Select</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox_combo_select_checkboxes">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<placeholder/>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+
+      <child>
 	<widget class="GtkHBox" id="hbox_search_filter_hide">
 	  <property name="visible">True</property>
 	  <property name="homogeneous">False</property>
@@ -1313,26 +1368,6 @@
       </child>
 
       <child>
-	<widget class="GtkCheckButton" id="checkbutton_sort_by_creation_date">
-	  <property name="visible">True</property>
-	  <property name="can_focus">True</property>
-	  <property name="label" translatable="yes">sort by creation date</property>
-	  <property name="use_underline">True</property>
-	  <property name="relief">GTK_RELIEF_NORMAL</property>
-	  <property name="focus_on_click">True</property>
-	  <property name="active">False</property>
-	  <property name="inconsistent">False</property>
-	  <property name="draw_indicator">True</property>
-	  <signal name="clicked" handler="on_checkbutton_sort_by_creation_date_clicked" last_modification_time="Sat, 02 Oct 2004 22:58:54 GMT"/>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">False</property>
-	  <property name="fill">False</property>
-	</packing>
-      </child>
-
-      <child>
 	<widget class="GtkScrolledWindow" id="scrolledwindow6">
 	  <property name="visible">True</property>
 	  <property name="can_focus">True</property>

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Mon Mar 10 16:21:19 2008
@@ -842,7 +842,7 @@
 		TreeModel model;
 		TreeIter iter;
 		if (tv.Selection.GetSelected (out model, out iter)) {
-			string selectedID = (string) model.GetValue (iter, 1); //name, ID
+			string selectedID = (string) model.GetValue (iter, 0); //ID, Name
 			currentPerson = SqlitePersonSession.PersonSelect(Convert.ToInt32(selectedID), currentSession.UniqueID);
 			Console.WriteLine("CurrentPerson: id:{0}, name:{1}", currentPerson.UniqueID, currentPerson.Name);
 			return true;
@@ -863,7 +863,7 @@
 
 		// you get the iter and the model if something is selected
 		if (((TreeSelection)o).GetSelected(out model, out iter)) {
-			string selectedID = (string) model.GetValue (iter, 1); //name, ID
+			string selectedID = (string) model.GetValue (iter, 0); //ID, Name
 		
 			currentPerson = SqlitePersonSession.PersonSelect(Convert.ToInt32(selectedID), currentSession.UniqueID);
 			Console.WriteLine("CurrentPerson: id:{0}, name:{1}", currentPerson.UniqueID, currentPerson.Name);

Modified: trunk/src/gui/person.cs
==============================================================================
--- trunk/src/gui/person.cs	(original)
+++ trunk/src/gui/person.cs	Mon Mar 10 16:21:19 2008
@@ -34,7 +34,7 @@
 	[Widget] protected Gtk.Window person_recuperate;
 	
 	[Widget] protected Gtk.CheckButton checkbutton_sorted_by_creation_date;
-	protected bool sortByCreationDate = false;
+//	protected bool sortByCreationDate = false;
 	
 	protected TreeStore store;
 	protected string selected;
@@ -45,6 +45,7 @@
 	[Widget] protected Gtk.Entry entry_search_filter;
 	
 	[Widget] protected Gtk.Box hbox_from_session_hide; //used in person recuperate multiple (hided in current class)
+	[Widget] protected Gtk.Box hbox_combo_select_checkboxes_hide; //used in person recuperate multiple (hided in current class)
 	[Widget] protected Gtk.Box hbox_search_filter_hide; //used in person recuperateWindow (hided in inherited class)
 	
 	static PersonRecuperateWindow PersonRecuperateWindowBox;
@@ -53,7 +54,10 @@
 	protected int sessionID;
 	
 	protected Person currentPerson;
-	
+
+	protected int columnId = 0;
+	protected int firstColumn = 0;
+
 	protected PersonRecuperateWindow () {
 	}
 
@@ -72,13 +76,16 @@
 		button_recuperate.Sensitive = false;
 	
 		hbox_from_session_hide.Hide(); //used in person recuperate multiple (hided in current class)
+		hbox_combo_select_checkboxes_hide.Hide(); //used in person recuperate multiple (hided in current class)
 		
-		createTreeView(treeview_person_recuperate, 0);
 		store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof (string), 
 				typeof (string), typeof(string), typeof(string) );
+		createTreeView(treeview_person_recuperate, 0);
 		treeview_person_recuperate.Model = store;
 		fillTreeView(treeview_person_recuperate, store, "");
 
+		treeview_person_recuperate.Model = store;
+
 		treeview_person_recuperate.Selection.Changed += onSelectionEntry;
 	}
 	
@@ -94,25 +101,55 @@
 	
 	protected void createTreeView (Gtk.TreeView tv, int count) {
 		tv.HeadersVisible=true;
-		tv.AppendColumn ( Catalog.GetString("ID"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Name"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Sex"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Height"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Weight"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Date of Birth"), new CellRendererText(), "text", count++);
-		tv.AppendColumn ( Catalog.GetString("Description"), new CellRendererText(), "text", count++);
+		
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("ID"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Name"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Sex"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Height"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Weight"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Date of Birth"), count++);
+		UtilGtk.CreateCols(tv, store, Catalog.GetString("Description"), count++);
+
+		//sort non textual cols	
+		store.SetSortFunc (firstColumn + 0, UtilGtk.IdColumnCompare);
+		store.SetSortFunc (firstColumn + 3, heightColumnCompare);
+		store.SetSortFunc (firstColumn + 4, weightColumnCompare);
+		store.SetSortFunc (firstColumn + 5, birthColumnCompare);
+	}
+	
+	public int heightColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2)     {
+		int val1 = 0;
+		int val2 = 0;
+		val1 = Convert.ToInt32(model.GetValue(iter1, firstColumn + 3));
+		val2 = Convert.ToInt32(model.GetValue(iter2, firstColumn + 3));
+		
+		return (val1-val2);
+	}
+
+	public int weightColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2)     {
+		int val1 = 0;
+		int val2 = 0;
+		val1 = Convert.ToInt32(model.GetValue(iter1, firstColumn + 4));
+		val2 = Convert.ToInt32(model.GetValue(iter2, firstColumn + 4));
+		
+		return (val1-val2);
+	}
+
+	public int birthColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2)     {
+		DateTime val1; 
+		DateTime val2; 
+		val1 = Util.DateAsDateTime(model.GetValue(iter1, firstColumn + 5).ToString());
+		val2 = Util.DateAsDateTime(model.GetValue(iter2, firstColumn + 5).ToString());
+		
+		return DateTime.Compare(val1, val2);
 	}
-	
+
 	protected void fillTreeView (Gtk.TreeView tv, TreeStore store, string searchFilterName) {
 		string [] myPersons;
 		
 		int except = sessionID;
 		int inSession = -1;	//search persons for recuperating in all sessions
-		string mySort = "name";
-		if(sortByCreationDate) {
-			mySort = "uniqueID";
-		}
-		myPersons = SqlitePerson.SelectAllPersonsRecuperable(mySort, except, inSession, searchFilterName); 
+		myPersons = SqlitePerson.SelectAllPersonsRecuperable("uniqueID", except, inSession, searchFilterName); 
 		
 		
 		foreach (string session in myPersons) {
@@ -149,20 +186,7 @@
 			button_recuperate.Sensitive = false;
 		}
 	}
-	
-	protected virtual void on_checkbutton_sort_by_creation_date_clicked(object o, EventArgs args) {
-		if (sortByCreationDate) { sortByCreationDate = false; }
-		else { sortByCreationDate = true; }
-		
-		store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof (string), 
-				typeof (string), typeof(string), typeof(string) );
-		treeview_person_recuperate.Model = store;
-		
-		fillTreeView(treeview_person_recuperate,store, entry_search_filter.Text.ToString());
-			
-		button_recuperate.Sensitive = false;
-	}
-	
+
 	protected virtual void onSelectionEntry (object o, EventArgs args)
 	{
 		TreeModel model;
@@ -220,6 +244,9 @@
 			fillTreeView(treeview_person_recuperate,store, entry_search_filter.Text.ToString());
 				
 			statusbar1.Push( 1, Catalog.GetString("Loaded") + " " + currentPerson.Name );
+		
+			//no posible to recuperate until one person is selected
+			button_recuperate.Sensitive = false;
 		}
 	}
 	
@@ -250,6 +277,15 @@
 	
 	[Widget] Gtk.Box hbox_combo_sessions;
 	[Widget] Gtk.ComboBox combo_sessions;
+	[Widget] Gtk.Box hbox_combo_select_checkboxes;
+	[Widget] Gtk.ComboBox combo_select_checkboxes;
+	
+	
+	private static string [] comboCheckboxesOptions = {
+		Catalog.GetString("All"),
+		Catalog.GetString("None"),
+		Catalog.GetString("Selected"),
+	};
 	
 	PersonsRecuperateFromOtherSessionWindow (Gtk.Window parent, int sessionID) {
 		Glade.XML gladeXML;
@@ -266,13 +302,15 @@
 		
 		this.sessionID = sessionID;
 	
+		firstColumn = 1;
+	
 		createComboSessions();
-		
+		createComboSelectCheckboxes();
 		createCheckboxes(treeview_person_recuperate);
-		createTreeView(treeview_person_recuperate, 1);
 		
 		store = new TreeStore( typeof (bool), typeof (string), typeof (string), typeof (string), typeof (string), 
 				typeof (string), typeof(string), typeof(string) );
+		createTreeView(treeview_person_recuperate, 1);
 		treeview_person_recuperate.Model = store;
 		
 		string myText = UtilGtk.ComboGetActive(combo_sessions);
@@ -326,6 +364,54 @@
 		}
 	}
 	
+	private void createComboSelectCheckboxes() {
+		combo_select_checkboxes = ComboBox.NewText ();
+		UtilGtk.ComboUpdate(combo_select_checkboxes, comboCheckboxesOptions, "");
+		
+		//combo_select_checkboxes.DisableActivate ();
+		combo_select_checkboxes.Changed += new EventHandler (on_combo_select_checkboxes_changed);
+
+		hbox_combo_select_checkboxes.PackStart(combo_select_checkboxes, true, true, 0);
+		hbox_combo_select_checkboxes.ShowAll();
+		combo_select_checkboxes.Sensitive = true;
+	}
+	
+	private void on_combo_select_checkboxes_changed(object o, EventArgs args) {
+		string myText = UtilGtk.ComboGetActive(combo_select_checkboxes);
+			
+		if (myText != "" & myText != Catalog.GetString("Selected")) {
+			try {
+				markSelected(myText);
+			} catch {
+				Console.WriteLine("Do later!!");
+			}
+		}
+	}
+	
+	public void markSelected(string selected) {
+		Gtk.TreeIter iter;
+		bool okIter = store.GetIterFirst(out iter);
+		if(okIter) {
+			if(selected == Catalog.GetString("All")) {
+				do {
+					//if(isNotAVGOrSD(iter)) {
+						store.SetValue (iter, 0, true);
+						//addRowToMarkedRows(treeview.Model.GetPath(iter).ToString());
+					//}
+				} while ( store.IterNext(ref iter) );
+			} else if(selected == Catalog.GetString("None")) {
+				do {
+					store.SetValue (iter, 0, false);
+					//deleteRowFromMarkedRows(treeview.Model.GetPath(iter).ToString());
+				} while ( store.IterNext(ref iter) );
+			}
+		}
+			
+		//check if there are rows checked for having sensitive or not in recuperate button
+		buttonRecuperateChangeSensitiveness();
+	}
+	
+	
 	void createCheckboxes(TreeView tv) 
 	{
 		CellRendererToggle crt = new CellRendererToggle();
@@ -349,17 +435,9 @@
 			bool val = (bool) store.GetValue (iter, column);
 			Console.WriteLine ("toggled {0} with value {1}", args.Path, !val);
 
-			if(args.Path == "0") {
-				if (store.GetIterFirst(out iter)) {
-					val = (bool) store.GetValue (iter, column);
-					store.SetValue (iter, column, !val);
-					while ( store.IterNext(ref iter) ){
-						store.SetValue (iter, column, !val);
-					}
-				}
-			} else {
-				store.SetValue (iter, column, !val);
-			}
+			store.SetValue (iter, column, !val);
+		
+			combo_select_checkboxes.Active = UtilGtk.ComboMakeActive(comboCheckboxesOptions, Catalog.GetString("Selected"));
 
 			//check if there are rows checked for having sensitive or not in recuperate button
 			buttonRecuperateChangeSensitiveness();
@@ -372,14 +450,8 @@
 		string [] myPersons;
 		
 		int except = sessionID;
-		string mySort = "name";
-		if(sortByCreationDate) {
-			mySort = "uniqueID";
-		}
-		myPersons = SqlitePerson.SelectAllPersonsRecuperable(mySort, except, inSession, ""); //"" is searchFilterName (not implemented on recuperate multiple)
+		myPersons = SqlitePerson.SelectAllPersonsRecuperable("uniqueID", except, inSession, ""); //"" is searchFilterName (not implemented on recuperate multiple)
 
-		//add a string for first row (for checking or unchecking all)
-		myPersons = addAllPersonsCheckboxName(myPersons);	
 		 
 		foreach (string session in myPersons) {
 			string [] myStringFull = session.Split(new char[] {':'});
@@ -391,34 +463,6 @@
 		}
 	}
 
-	protected override void on_checkbutton_sort_by_creation_date_clicked(object o, EventArgs args) {
-		if (sortByCreationDate) { sortByCreationDate = false; }
-		else { sortByCreationDate = true; }
-		
-		string myText = UtilGtk.ComboGetActive(combo_sessions);
-		if(myText != "") {
-			store = new TreeStore( typeof (bool), typeof (string), typeof (string), typeof (string), typeof (string), 
-				typeof (string), typeof(string), typeof(string) );
-			treeview_person_recuperate.Model = store;
-		
-			string [] myStringFull = myText.Split(new char[] {':'});
-
-			//fill the treeview passing the uniqueID of selected session as the reference for loading persons
-			fillTreeView( treeview_person_recuperate, store, Convert.ToInt32(myStringFull[0]) );
-		}
-	}
-	
-	protected string [] addAllPersonsCheckboxName(string [] myPersons) {
-		string [] myPersonsReturn = new string[myPersons.Length +1];
-		int count = 0;
-		myPersonsReturn [count ++] = ":" + Catalog.GetString("MARK ALL/NONE") + ": : : : : ";
-		
-		foreach (string session in myPersons) {
-			myPersonsReturn [count ++] = session;
-		}
-		return myPersonsReturn;
-	}
-	
 	//protected override void on_treeview_person_recuperate_cursor_changed (object o, EventArgs args)
 	protected override void onSelectionEntry (object o, EventArgs args)
 	{
@@ -473,7 +517,7 @@
 			//val = (bool) store.GetValue (iter, 0);
 			//Console.WriteLine("Row {0}, value {1}", count++, val);
 			count ++;
-			while ( store.IterNext(ref iter) ){
+			do {
 				val = (bool) store.GetValue (iter, 0);
 
 				//if checkbox of person is true
@@ -494,8 +538,8 @@
 					inserted ++;
 				}
 				
-			}
-	
+			} while ( store.IterNext(ref iter) );
+
 			if(inserted > 0) {
 				//update the treeview (only one time)
 				string myText = UtilGtk.ComboGetActive(combo_sessions);
@@ -517,6 +561,9 @@
 				}
 			}
 		}
+		
+		//check if there are rows checked for having sensitive or not in recuperate button
+		buttonRecuperateChangeSensitiveness();
 	}
 }
 

Modified: trunk/src/treeViewPerson.cs
==============================================================================
--- trunk/src/treeViewPerson.cs	(original)
+++ trunk/src/treeViewPerson.cs	Mon Mar 10 16:21:19 2008
@@ -40,7 +40,7 @@
 		this.treeview = treeview;
 
 		store = getStore(2); 
-		string [] columnsString = { Catalog.GetString("person"), "ID" };
+		string [] columnsString = { "ID", Catalog.GetString("person")};
 		treeview.Model = store;
 		prepareHeaders(columnsString);
 	}
@@ -61,10 +61,22 @@
 		treeview.HeadersVisible=true;
 		int i=0;
 		foreach(string myCol in columnsString) {
-			treeview.AppendColumn (Catalog.GetString(myCol), new CellRendererText(), "text", i++);
+			//treeview.AppendColumn (Catalog.GetString(myCol), new CellRendererText(), "text", i++);
+			UtilGtk.CreateCols(treeview, store, Catalog.GetString(myCol), i++);
+			if(i == 1)
+				store.SetSortFunc (0, UtilGtk.IdColumnCompare);
 		}
 	}
 	
+	public int idColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2)     {
+		int val1 = 0;
+		int val2 = 0;
+		val1 = Convert.ToInt32(model.GetValue(iter1, 0));
+		val2 = Convert.ToInt32(model.GetValue(iter2, 0));
+		
+		return (val1-val2);
+	}
+
 	public void RemoveColumns() {
 		Gtk.TreeViewColumn [] myColumns = treeview.Columns;
 		foreach (Gtk.TreeViewColumn column in myColumns) {
@@ -77,9 +89,9 @@
 		foreach (string person in myPersons) {
 			string [] myStringFull = person.Split(new char[] {':'});
 			string [] myData = new String [2];
-			//first name, then ID
-			myData[1] = myStringFull[0].ToString();
-			myData[0] = myStringFull[1].ToString();
+			//first ID, then Name
+			myData[0] = myStringFull[0].ToString();
+			myData[1] = myStringFull[1].ToString();
 			store.AppendValues (myData);
 		}	
 			
@@ -108,7 +120,7 @@
 		if(iterOk) {
 			int count = 0;
 			do {
-				if(Convert.ToInt32 ((string) treeview.Model.GetValue (iter, 1)) == uniqueID) {
+				if(Convert.ToInt32 ((string) treeview.Model.GetValue (iter, 0)) == uniqueID) {
 					found = count;
 				}
 				count ++;
@@ -129,7 +141,7 @@
 			do {
 				//search until find when jumperName is lexicographically > than current row
 				if(String.Compare(jumperName.ToUpper(), 
-							((string) treeview.Model.GetValue (iter, 0)).ToUpper()) < 0 ) {
+							((string) treeview.Model.GetValue (iter, 1)).ToUpper()) < 0 ) {
 					found = count;
 					break;
 				}
@@ -142,12 +154,12 @@
 		if(found != -1) {
 			//store.Insert (out iter2, found);
 			iter2 = store.InsertNode (found);
-			//first name, then ID
-			store.SetValue (iter2, 0, jumperName);
-			store.SetValue (iter2, 1, jumperID);
+			//first ID, then Name
+			store.SetValue (iter2, 0, jumperID);
+			store.SetValue (iter2, 1, jumperName);
 		} else {
-			//first name, then ID
-			iter2 = store.AppendValues (jumperName, jumperID);
+			//first ID, then Name
+			iter2 = store.AppendValues (jumperID, jumperName);
 		}
 			
 		//scroll treeview if needed

Modified: trunk/src/util.cs
==============================================================================
--- trunk/src/util.cs	(original)
+++ trunk/src/util.cs	Mon Mar 10 16:21:19 2008
@@ -814,4 +814,5 @@
 
 		return foundLevelName;
 	}
+	
 }

Modified: trunk/src/utilGtk.cs
==============================================================================
--- trunk/src/utilGtk.cs	(original)
+++ trunk/src/utilGtk.cs	Mon Mar 10 16:21:19 2008
@@ -93,4 +93,20 @@
 		myCombo.AppendText (myData);
 	}
 
+	public static void CreateCols (Gtk.TreeView tv, Gtk.TreeStore store, string name, int verticalPos) {
+		Gtk.TreeViewColumn myCol = new Gtk.TreeViewColumn (name, new CellRendererText(), "text", verticalPos);
+		myCol.SortColumnId = verticalPos;
+		myCol.SortIndicator = true;
+		tv.AppendColumn ( myCol );
+	}
+
+	public static int IdColumnCompare (TreeModel model, TreeIter iter1, TreeIter iter2)     {
+		int val1 = 0;
+		int val2 = 0;
+		val1 = Convert.ToInt32(model.GetValue(iter1, 0));
+		val2 = Convert.ToInt32(model.GetValue(iter2, 0));
+		
+		return (val1-val2);
+	}
+
 }

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Mon Mar 10 16:21:19 2008
@@ -1 +1 @@
-0.62-svn3
+0.62-svn4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]