[Monodevelop-patches-list] r855 - in trunk/MonoDevelop: data/resources/glade src/AddIns/DisplayBindings/SourceEditor/Gui

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Feb 9 20:54:43 EST 2004


Author: jba
Date: 2004-02-09 20:54:43 -0500 (Mon, 09 Feb 2004)
New Revision: 855

Modified:
   trunk/MonoDevelop/data/resources/glade/EditorBindings.glade
   trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
Log:
enabled some source editor property setting in the PropertiesChanged event

Modified: trunk/MonoDevelop/data/resources/glade/EditorBindings.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/EditorBindings.glade	2004-02-10 01:13:43 UTC (rev 854)
+++ trunk/MonoDevelop/data/resources/glade/EditorBindings.glade	2004-02-10 01:54:43 UTC (rev 855)
@@ -883,6 +883,7 @@
 		      <child>
 			<widget class="GtkLabel" id="characterMarkersLabel">
 			  <property name="visible">True</property>
+			  <property name="sensitive">False</property>
 			  <property name="label" translatable="yes">Character Markers-</property>
 			  <property name="use_underline">False</property>
 			  <property name="use_markup">False</property>
@@ -937,6 +938,7 @@
 			      <child>
 				<widget class="GtkCheckButton" id="showSpaceCharsCheckBox">
 				  <property name="visible">True</property>
+				  <property name="sensitive">False</property>
 				  <property name="can_focus">True</property>
 				  <property name="label" translatable="yes">Show _spaces-</property>
 				  <property name="use_underline">True</property>
@@ -955,6 +957,7 @@
 			      <child>
 				<widget class="GtkCheckButton" id="showTabCharsCheckBox">
 				  <property name="visible">True</property>
+				  <property name="sensitive">False</property>
 				  <property name="can_focus">True</property>
 				  <property name="label" translatable="yes">Show _tabs-</property>
 				  <property name="use_underline">True</property>
@@ -973,6 +976,7 @@
 			      <child>
 				<widget class="GtkCheckButton" id="showEOLMarkersCheckBox">
 				  <property name="visible">True</property>
+				  <property name="sensitive">False</property>
 				  <property name="can_focus">True</property>
 				  <property name="label" translatable="yes">Show _EOL markers-</property>
 				  <property name="use_underline">True</property>
@@ -991,6 +995,7 @@
 			      <child>
 				<widget class="GtkCheckButton" id="showErrorsCheckBox">
 				  <property name="visible">True</property>
+				  <property name="sensitive">False</property>
 				  <property name="can_focus">True</property>
 				  <property name="label" translatable="yes">Show _invalid lines-</property>
 				  <property name="use_underline">True</property>

Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-02-10 01:13:43 UTC (rev 854)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorDisplayBinding.cs	2004-02-10 01:54:43 UTC (rev 855)
@@ -292,9 +292,72 @@
 #endregion
 		
 		void PropertiesChanged (object sender, PropertyEventArgs e)
-		{
-			se.View.ModifyFont (TextEditorProperties.Font);
-		}
+ 		{
+			string switchVal = (e != null) ? e.Key : null;
+			switch(switchVal)
+			{
+				case null:
+				case "DefaultFont":
+					// font
+					se.View.ModifyFont (TextEditorProperties.Font);
+					break;
+				
+				case "ShowLineNumbers":
+					// show line numbers
+					se.View.ShowLineNumbers = TextEditorProperties.ShowLineNumbers;
+					break;
+				
+				case "ShowBracketHighlight":
+					// hilight matching bracket
+					se.Buffer.CheckBrackets = TextEditorProperties.ShowMatchingBracket;
+					break;
+				
+				case "ShowVRuler":
+				case "VRulerRow":
+					// show column ruler after n cols
+					se.View.ShowMargin = TextEditorProperties.ShowVerticalRuler;
+					if (TextEditorProperties.VerticalRulerRow > -1) {
+						se.View.Margin = (uint) TextEditorProperties.VerticalRulerRow;
+					} else {
+						se.View.Margin = (uint) 80;		// FIXME: should i be doing this on a bad vruller setting?
+					}
+					break;
+				
+				case "IndentationSize":
+				case "TabIndent":
+					// tab width
+					if (TextEditorProperties.TabIndent > -1) {
+						se.View.TabsWidth = (uint) TextEditorProperties.TabIndent;
+					} else {
+						se.View.TabsWidth = (uint) 8;	// FIXME: should i be doing this on a bad tabindent setting?
+					}
+					break;
+					
+				case "TabsToSpaces":
+					// convert tabs to spaces
+					se.View.InsertSpacesInsteadOfTabs = TextEditorProperties.ConvertTabsToSpaces;
+					break;
+					
+				default:
+					System.Console.WriteLine(e.Key + " = " + e.NewValue + "(from " + e.OldValue + ")" );
+					// The items below can't be done (since there is no support for it in gtksourceview)
+					// CANTDO: show spaces				Key = "ShowSpaces"
+					// CANTDO: show tabs				Key = "ShowTabs"
+					// CANTDO eol makers				Key = "ShowEOLMarkers"
+					// CANTDO: show horizontal ruler	Key = "ShowHRuler"		
+					// CANTDO: underline errors			Key = "ShowErrors"
+					// CANTDO: indentation 				Key = "IndentStyle"
+					// DONOTDO: auto insert braces		Key = "AutoInsertCurlyBracket"
+					// TODO: Show Invalid Lines			Key = "ShowInvalidLines"
+					// TODO: CodeCompletion				Key = "EnableCodeCompletion"
+					// TODO: Code Folding				Key = "EnableFolding"
+					// TODO: Double Buffering			Key = "DoubleBuffer"
+					// TODO: can move past EOL 			Key = "CursorBehindEOL"
+					// TODO: auot insert template		Key = "AutoInsertTemplates"	
+					// TODO: hide mouse while typing 	Key = "HideMouseCursor"
+				break;
+			}
+ 		}
 
 	}
 }




More information about the Monodevelop-patches-list mailing list