[Monodevelop-patches-list] r765 - in trunk/MonoDevelop: data/resources/glade src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Feb 3 16:56:33 EST 2004
Author: dkor
Date: 2004-02-03 16:56:32 -0500 (Tue, 03 Feb 2004)
New Revision: 765
Modified:
trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade
trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
Log:
Glading of the GeneralTextEditorPanel
Modified: trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade 2004-02-03 21:46:58 UTC (rev 764)
+++ trunk/MonoDevelop/data/resources/glade/texteditoraddin.glade 2004-02-03 21:56:32 UTC (rev 765)
@@ -2,6 +2,7 @@
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
+<requires lib="gnome"/>
<widget class="GtkDialog" id="GotoLineDialog">
<property name="visible">True</property>
@@ -1292,4 +1293,456 @@
</child>
</widget>
+<widget class="GtkWindow" id="GeneralTextEditorPanel">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">GeneralTextEditorPanel</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox37">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox38">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="genOptions">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>General Options-</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">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="hbox20">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label38">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox41">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="enableCodeCompletionCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable code _completion-</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enableFoldingCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable code _folding-</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="enableDoublebufferingCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Enable double buffering-</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </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">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox39">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="fontOptions">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Font-</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">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="hbox21">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label39">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox42">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="textFontLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Text Font:-</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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">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="hbox23">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label47">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GnomeFontPicker" id="fontNameDisplayTextBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property>
+ <property name="show_size">True</property>
+ <property name="use_font_in_label">False</property>
+ <property name="label_font_size">14</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="browseButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Select-</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ </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="GtkCheckButton" id="enableAAFontRenderingCheckBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Render font aliased-</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </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">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="encodingBox">
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="encOptions">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>File encoding-</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">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="hbox22">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label40">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox43">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="encVBox">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Choose _encoding-</property>
+ <property name="use_underline">True</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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkOptionMenu" id="textEncodingComboBox">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="history">-1</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </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">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs 2004-02-03 21:46:58 UTC (rev 764)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/TextEditor/Gui/OptionPanels/GeneralTextEditorPanel.cs 2004-02-03 21:56:32 UTC (rev 765)
@@ -10,6 +10,8 @@
using System.Collections;
using System.Text;
using Gtk;
+using Gnome;
+using MonoDevelop.Gui.Widgets;
using Pango;
using ICSharpCode.SharpDevelop.Internal.ExternalTool;
@@ -22,128 +24,130 @@
namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.OptionPanels
{
/// <summary>
- /// General texteditor options panel.
+ /// General texteditor options panelS.
/// </summary>
public class GeneralTextEditorPanel : AbstractOptionPanel
{
- FontDescription selectedFont = FontDescription.FromString ("Courier New");
- //selectedFont.Size = 10;
+
+ GeneralTextEditorPanelWidget widget;
- int encoding = Encoding.UTF8.CodePage;
- int selectedIndex = 0;
-
- CheckButton enableDoublebufferingCheckBox;
- CheckButton enableCodeCompletionCheckBox;
- CheckButton enableFoldingCheckBox;
- Entry fontNameDisplayTextBox;
- CheckButton enableAAFontRenderingCheckBox;
-
public override void LoadPanelContents()
{
- VBox mainVBox = new VBox (false, 0);
- Frame genOptions = new Frame ("General Options");
- Frame fontOptions = new Frame ("Font");
- Frame encOptions = new Frame ("File encoding");
-
- VBox genVBox = new VBox (true, 0);
- enableCodeCompletionCheckBox = new CheckButton ("Enable code _completion");
- enableCodeCompletionCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("EnableCodeCompletion", true);
- genVBox.PackStart (enableCodeCompletionCheckBox);
-
- enableFoldingCheckBox = new CheckButton ("Enable code _folding");
- enableFoldingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("EnableFolding", true);
- genVBox.PackStart (enableFoldingCheckBox);
- genOptions.Add (genVBox);
-
- enableDoublebufferingCheckBox = new CheckButton ("Enable double _buffering");
- enableDoublebufferingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("DoubleBuffer", true);
- 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.Text = ((IProperties)CustomizationObject).GetProperty("DefaultFont", selectedFont).ToString();
- hb.PackStart (fontNameDisplayTextBox);
-
- Button browseButton = new Button ("_Select");
- browseButton.Clicked += new EventHandler(SelectFontEvent);
- hb.PackStart (browseButton);
- fontVBox.PackStart (hb);
-
- enableAAFontRenderingCheckBox = new CheckButton ("_Render font aliased");
- enableAAFontRenderingCheckBox.Active = ((IProperties)CustomizationObject).GetProperty("UseAntiAliasFont", false);
- fontVBox.PackStart (enableAAFontRenderingCheckBox);
- 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));
- }
- 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);
- }
-
- 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);
+ Add (widget = new GeneralTextEditorPanelWidget ((IProperties) CustomizationObject));
}
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));
+ widget.Store ((IProperties) CustomizationObject);
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 ());
+
+ class GeneralTextEditorPanelWidget : GladeWidgetExtract
+ {
+ StringParserService StringParserService = (
+ StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
+// int encoding = Encoding.UTF8.CodePage;
+// int selectedIndex = 0;
+
+ [Glade.Widget] Label genOptions, fontOptions, textFontLabel;
+// encOptions, encVBox; // if you uncoment change to "," above
+ [Glade.Widget] CheckButton enableCodeCompletionCheckBox,
+ enableFoldingCheckBox, enableDoublebufferingCheckBox,
+ enableAAFontRenderingCheckBox;
+// [Glade.Widget] OptionMenu textEncodingComboBox;
+ [Glade.Widget] Button browseButton;
+ [Glade.Widget] FontPicker fontNameDisplayTextBox;
+ [Glade.Widget] VBox encodingBox;
+
+ public GeneralTextEditorPanelWidget (IProperties CustomizationObject) : base ("texteditoraddin.glade", "GeneralTextEditorPanel")
+ {
+ encodingBox.Destroy(); // this is a really dirty way of hiding encodingBox, but Hide() doesn't work
+ genOptions.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.GeneralOptionsGroupBox}" ) + "</b>";
+ fontOptions.Markup = "<b> " + StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.FontGroupBox}" ) + "</b>";
+// encOptions.Markup = "<b> " + StringParserService.Parse(
+// "${res:Dialog.Options.IDEOptions.TextEditor.General.FontGroupBox.FileEncodingGroupBox}" ) + "</b>";
+
+ enableCodeCompletionCheckBox.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.CodeCompletionCheckBox}");
+ enableCodeCompletionCheckBox.Active = ((IProperties) CustomizationObject).GetProperty(
+ "EnableCodeCompletion", true);
- 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);
-
- }
+ enableFoldingCheckBox.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.FoldingCheckBox}");
+ enableFoldingCheckBox.Active = ((IProperties) CustomizationObject).GetProperty("EnableFolding", true);
+
+ enableDoublebufferingCheckBox.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.DoubleBufferCheckBox}");
+ enableDoublebufferingCheckBox.Active = ((IProperties) CustomizationObject).GetProperty(
+ "DoubleBuffer", true);
+
+ textFontLabel.TextWithMnemonic = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.TextfontLabel}");
+
+ fontNameDisplayTextBox.FontName = ((IProperties) CustomizationObject).GetProperty("DefaultFont", "Courier 12").ToString();
+ browseButton.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.SelectButtonText}");
+ browseButton.Clicked += new EventHandler(SelectEvent);
+
+ enableAAFontRenderingCheckBox.Label = StringParserService.Parse(
+ "${res:Dialog.Options.IDEOptions.TextEditor.General.AntialiasedFontCheckBox}");
+ enableAAFontRenderingCheckBox.Active = ((IProperties) CustomizationObject).GetProperty(
+ "UseAntiAliasFont", false);
+
+// encVBox.TextWithMnemonic = StringParserService.Parse(
+// "${res:Dialog.Options.IDEOptions.TextEditor.General.FontGroupBox.FileEncodingLabel}");
+
+// Menu m = new Menu ();
+// foreach (String name in CharacterEncodings.Names) {
+// m.Append (new MenuItem (name));
+// }
+// textEncodingComboBox.Menu = m;
+
+// int i = 0;
+// try {
+// Console.WriteLine("Getting encoding Property");
+// i = CharacterEncodings.GetEncodingIndex(
+// (Int32)((IProperties) CustomizationObject).GetProperty("Encoding", encoding));
+// } catch {
+// Console.WriteLine("Getting encoding Default");
+// i = CharacterEncodings.GetEncodingIndex(encoding);
+// }
+
+// selectedIndex = i;
+// encoding = CharacterEncodings.GetEncodingByIndex(i).CodePage;
+
+// textEncodingComboBox.Changed += new EventHandler (OnOptionChanged);
+ }
+
+ public void Store (IProperties CustomizationObject)
+ {
+ ((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", fontNameDisplayTextBox.FontName);
+// Console.WriteLine (CharacterEncodings.GetEncodingByIndex (selectedIndex).CodePage);
+// ((IProperties) CustomizationObject).SetProperty (
+// "Encoding",CharacterEncodings.GetEncodingByIndex (selectedIndex).CodePage);
+ }
+
+// private void OnOptionChanged (object o, EventArgs args)
+// {
+// Console.WriteLine (selectedIndex);
+// selectedIndex = ((OptionMenu) o).History;
+// }
+
+ private void SelectEvent(object sender, EventArgs e)
+ {
+ fontNameDisplayTextBox.Click();
+ }
}
-
- private void OnOptionChanged (object o, EventArgs args)
- {
- selectedIndex = ((OptionMenu) o).History;
- }
}
}
More information about the Monodevelop-patches-list
mailing list