[Monodevelop-patches-list] r488 - trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Jan 15 01:40:33 EST 2004


Author: jluke
Date: 2004-01-15 01:40:33 -0500 (Thu, 15 Jan 2004)
New Revision: 488

Modified:
   trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
Log:
mnemonics fix


Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs	2004-01-15 06:23:32 UTC (rev 487)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs	2004-01-15 06:40:33 UTC (rev 488)
@@ -1,34 +1,34 @@
-// <file>
-//     <copyright see="prj:///doc/copyright.txt"/>
-//     <license see="prj:///doc/license.txt"/>
-//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-//     <version value="$version"/>
-// </file>
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Text;
+// <file>
+//     <copyright see="prj:///doc/copyright.txt"/>
+//     <license see="prj:///doc/license.txt"/>
+//     <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+//     <version value="$version"/>
+// </file>
+
+using System;
+using System.IO;
+using System.Collections;
+using System.Text;
 using Gtk;
-using Pango;
-
-using ICSharpCode.SharpDevelop.Internal.ExternalTool;
-using ICSharpCode.Core.Properties;
-using ICSharpCode.Core.Services;
-
-using ICSharpCode.Core.AddIns.Codons;
-using ICSharpCode.SharpDevelop.Gui.Dialogs;
-
-namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels
-{
-	/// <summary>
-	/// General texteditor options panel.
-	/// </summary>
-	public class GeneralTextEditorPanel : AbstractOptionPanel
-	{
+using Pango;
+
+using ICSharpCode.SharpDevelop.Internal.ExternalTool;
+using ICSharpCode.Core.Properties;
+using ICSharpCode.Core.Services;
+
+using ICSharpCode.Core.AddIns.Codons;
+using ICSharpCode.SharpDevelop.Gui.Dialogs;
+
+namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels
+{
+	/// <summary>
+	/// General texteditor options panel.
+	/// </summary>
+	public class GeneralTextEditorPanel : AbstractOptionPanel
+	{
 		FontDescription selectedFont = FontDescription.FromString ("Courier New");
-		//selectedFont.Size = 10;
-		
+		//selectedFont.Size = 10;
+		
 		int encoding = Encoding.UTF8.CodePage;
 		int selectedIndex = 0;
 		
@@ -36,9 +36,9 @@
 		CheckButton enableCodeCompletionCheckBox;
 		CheckButton enableFoldingCheckBox;
 		Entry fontNameDisplayTextBox;
-		CheckButton enableAAFontRenderingCheckBox;
-		
-		public override void LoadPanelContents()
+		CheckButton enableAAFontRenderingCheckBox;
+		
+		public override void LoadPanelContents()
 		{
 			VBox mainVBox = new VBox (false, 0);
 			Frame genOptions = new Frame ("General Options");
@@ -46,108 +46,104 @@
 			Frame encOptions = new Frame ("File encoding");
 			
 			VBox genVBox = new VBox (true, 0);
-			enableCodeCompletionCheckBox = new CheckButton ();
-			enableCodeCompletionCheckBox.Label = "Enable Code Completion";
+			enableCodeCompletionCheckBox = new CheckButton ("Enable code _completion");
 			enableCodeCompletionCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("EnableCodeCompletion", true);
 			genVBox.PackStart (enableCodeCompletionCheckBox);
 			
-			enableFoldingCheckBox = new CheckButton ();
-			enableFoldingCheckBox.Label = "Enable Code Folding";
+			enableFoldingCheckBox = new CheckButton ("Enable code _folding");
 			enableFoldingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("EnableFolding", true);
 			genVBox.PackStart (enableFoldingCheckBox);
 			genOptions.Add (genVBox);
 			
-			enableDoublebufferingCheckBox = new CheckButton ();
-			enableDoublebufferingCheckBox.Label = "Enable Double Buffering";
+			enableDoublebufferingCheckBox = new CheckButton ("Enable double _buffering");
 			enableDoublebufferingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("DoubleBuffer", true);
-			genVBox.PackStart (enableDoublebufferingCheckBox);
+			genVBox.PackStart (enableDoublebufferingCheckBox);
 			
 			VBox fontVBox = new VBox (true, 0);
 			fontVBox.PackStart (new Label ("Text Font:"));
 			
 			HBox hb = new HBox (false, 0);
-			fontNameDisplayTextBox = new Entry ();
+			fontNameDisplayTextBox = new Entry ();
 			fontNameDisplayTextBox.Text = ((IProperties)CustomizationObject).GetProperty("DefaultFont", selectedFont).ToString();
 			hb.PackStart (fontNameDisplayTextBox);
 			
-			Button browseButton = new Button ("_Select");
+			Button browseButton = new Button ("_Select");
 			browseButton.Clicked += new EventHandler(SelectFontEvent);
 			hb.PackStart (browseButton);
-			fontVBox.PackStart (hb);
+			fontVBox.PackStart (hb);
 			
-			enableAAFontRenderingCheckBox = new CheckButton ();
-			enableAAFontRenderingCheckBox.Label = "_Render font aliased";
+			enableAAFontRenderingCheckBox = new CheckButton ("_Render font aliased");
 			enableAAFontRenderingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("UseAntiAliasFont", false);
 			fontVBox.PackStart (enableAAFontRenderingCheckBox);
-			fontOptions.Add (fontVBox);
+			fontOptions.Add (fontVBox);
 			
 			VBox encVBox = new VBox (true, 0);
 			OptionMenu textEncodingComboBox = new OptionMenu ();
 			textEncodingComboBox.Changed += new EventHandler (OnOptionChanged);
 			
-			Menu m = new Menu ();
-			foreach (String name in CharacterEncodings.Names) {
-				m.Append (new MenuItem (name));
+			Menu m = new Menu ();
+			foreach (String name in CharacterEncodings.Names) {
+				m.Append (new MenuItem (name));
 			}
 			textEncodingComboBox.Menu = m;
 			encVBox.PackStart (new Label ("Choose _encoding"));
 			encVBox.PackStart (textEncodingComboBox);
 			encOptions.Add (encVBox);
-			
-			int i = 0;
-			try {
-				i = CharacterEncodings.GetEncodingIndex((Int32)((IProperties)CustomizationObject).GetProperty("Encoding", encoding));
-			} catch {
-				i = CharacterEncodings.GetEncodingIndex(encoding);
+			
+			int i = 0;
+			try {
+				i = CharacterEncodings.GetEncodingIndex((Int32)((IProperties)CustomizationObject).GetProperty("Encoding", encoding));
+			} catch {
+				i = CharacterEncodings.GetEncodingIndex(encoding);
 			}
-			
-			selectedIndex = i;
-			encoding = CharacterEncodings.GetEncodingByIndex(i).CodePage;
-			
+			
+			selectedIndex = i;
+			encoding = CharacterEncodings.GetEncodingByIndex(i).CodePage;
+			
 			selectedFont = FontDescription.FromString (fontNameDisplayTextBox.Text);
 			
 			mainVBox.PackStart (genOptions, false, true, 0);
 			mainVBox.PackStart (fontOptions, false, true, 0);
 			mainVBox.PackStart (encOptions, false, true, 0);
-			this.Add (mainVBox);
-		}
-		
-		public override bool StorePanelContents()
-		{
-			((IProperties) CustomizationObject).SetProperty ("DoubleBuffer", enableDoublebufferingCheckBox.Active);
-			((IProperties) CustomizationObject).SetProperty ("UseAntiAliasFont",     enableAAFontRenderingCheckBox.Active);
-			((IProperties) CustomizationObject).SetProperty ("EnableCodeCompletion", enableCodeCompletionCheckBox.Active);
-			((IProperties) CustomizationObject).SetProperty ("EnableFolding",        enableFoldingCheckBox.Active);
-			((IProperties) CustomizationObject).SetProperty ("DefaultFont",          selectedFont);
-			((IProperties) CustomizationObject).SetProperty ("Encoding",             CharacterEncodings.GetCodePageByIndex (selectedIndex));
-			return true;
-		}
-		
-		//static Font ParseFont(string font)
-		//{
-		//	string[] descr = font.Split(new char[]{',', '='});
-		//	return new Font(descr[1], Single.Parse(descr[3]));
-		//}
-		
-		void SelectFontEvent(object sender, EventArgs e)
-		{
-			FontSelectionDialog fdialog = new FontSelectionDialog ("Select a font");
+			this.Add (mainVBox);
+		}
+		
+		public override bool StorePanelContents()
+		{
+			((IProperties) CustomizationObject).SetProperty ("DoubleBuffer", enableDoublebufferingCheckBox.Active);
+			((IProperties) CustomizationObject).SetProperty ("UseAntiAliasFont",     enableAAFontRenderingCheckBox.Active);
+			((IProperties) CustomizationObject).SetProperty ("EnableCodeCompletion", enableCodeCompletionCheckBox.Active);
+			((IProperties) CustomizationObject).SetProperty ("EnableFolding",        enableFoldingCheckBox.Active);
+			((IProperties) CustomizationObject).SetProperty ("DefaultFont",          selectedFont);
+			((IProperties) CustomizationObject).SetProperty ("Encoding",             CharacterEncodings.GetCodePageByIndex (selectedIndex));
+			return true;
+		}
+		
+		//static Font ParseFont(string font)
+		//{
+		//	string[] descr = font.Split(new char[]{',', '='});
+		//	return new Font(descr[1], Single.Parse(descr[3]));
+		//}
+		
+		void SelectFontEvent(object sender, EventArgs e)
+		{
+			FontSelectionDialog fdialog = new FontSelectionDialog ("Select a font");
 				fdialog.SetFontName (selectedFont.ToString ());
 				
 				int response = fdialog.Run ();
-				fdialog.Hide ();
-				if (response == (int) ResponseType.Ok) {
-					FontDescription newFont  = FontDescription.FromString (fdialog.FontName);
-					fontNameDisplayTextBox.Text = newFont.ToString();
-					selectedFont  = newFont;
-					((IProperties)CustomizationObject).SetProperty("DefaultFont",          selectedFont);
-					
-				}
+				fdialog.Hide ();
+				if (response == (int) ResponseType.Ok) {
+					FontDescription newFont  = FontDescription.FromString (fdialog.FontName);
+					fontNameDisplayTextBox.Text = newFont.ToString();
+					selectedFont  = newFont;
+					((IProperties)CustomizationObject).SetProperty("DefaultFont",          selectedFont);
+					
+				}
 		}
 		
 		private void OnOptionChanged (object o, EventArgs args)
 		{
 			selectedIndex = ((OptionMenu) o).History;
-		}
-	}
-}
+		}
+	}
+}




More information about the Monodevelop-patches-list mailing list