[Monodevelop-patches-list] r769 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Gui/Dialogs
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Feb 3 19:14:39 EST 2004
Author: benm
Date: 2004-02-03 19:14:38 -0500 (Tue, 03 Feb 2004)
New Revision: 769
Modified:
trunk/MonoDevelop/data/resources/glade/Base.glade
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
Log:
make this look good...once and for all
Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade 2004-02-03 23:38:03 UTC (rev 768)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade 2004-02-04 00:14:38 UTC (rev 769)
@@ -5,6 +5,8 @@
<requires lib="gnome"/>
<widget class="GtkDialog" id="TreeViewOptionDialog">
+ <property name="width_request">700</property>
+ <property name="height_request">550</property>
<property name="visible">True</property>
<property name="title" translatable="yes">dialog1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
@@ -63,20 +65,67 @@
<widget class="GtkHBox" id="DisplayBox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">7</property>
<child>
- <widget class="GtkTreeView" id="TreeView">
+ <widget class="GtkVBox" id="vbox31">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label33">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Cat_egories:</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</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">TreeView</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="TreeView">
+ <property name="width_request">187</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ </widget>
+ </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="padding">6</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@@ -85,71 +134,84 @@
<widget class="GtkVBox" id="optionPanel">
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">12</property>
<child>
- <widget class="GtkHBox" id="hbox20">
+ <widget class="GtkVBox" id="vbox30">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkImage" id="panelImage">
+ <widget class="GtkHBox" id="hbox20">
<property name="visible">True</property>
- <property name="stock">gtk-properties</property>
- <property name="icon_size">4</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="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkImage" id="panelImage">
+ <property name="visible">True</property>
+ <property name="stock">gtk-preferences</property>
+ <property name="icon_size">3</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="GtkLabel" id="optionTitle">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><span weight="bold" size="x-large">Title</span></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.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>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="optionTitle">
+ <widget class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
- <property name="label" translatable="yes">label38</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.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>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
- <property name="padding">0</property>
+ <property name="padding">6</property>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
</packing>
</child>
<child>
- <widget class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
<widget class="GtkNotebook" id="mainBook">
<property name="visible">True</property>
<property name="show_tabs">False</property>
@@ -228,7 +290,7 @@
</child>
</widget>
<packing>
- <property name="padding">0</property>
+ <property name="padding">6</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs 2004-02-03 23:38:03 UTC (rev 768)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TreeViewOptions.cs 2004-02-04 00:14:38 UTC (rev 769)
@@ -19,65 +19,27 @@
using ICSharpCode.Core.AddIns.Codons;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs
-{
- /*
- public class GradientHeaderPanel : Label
- {
- public GradientHeaderPanel(int fontSize) : this()
- {
- Font = new Font("Tahoma", fontSize);
- }
-
- public GradientHeaderPanel() : base()
- {
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- ResizeRedraw = true;
- Text = String.Empty;
- }
-
- protected override void OnPaintBackground(PaintEventArgs pe)
- {
- base.OnPaintBackground(pe);
- Graphics g = pe.Graphics;
-
- g.FillRectangle(new LinearGradientBrush(new Point(0, 0), new Point(Width, Height),
- SystemColors.Window, SystemColors.Control),
- new Rectangle(0, 0, Width, Height));
- }
- }*/
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs {
/// <summary>
/// TreeView options are used, when more options will be edited (for something like
/// IDE Options + Plugin Options)
/// </summary>
- public class TreeViewOptions
- {
- //protected GradientHeaderPanel optionsPanelLabel;
+ public class TreeViewOptions {
- protected ArrayList OptionPanels = new ArrayList();
-
+ protected ArrayList OptionPanels = new ArrayList ();
protected IProperties properties = null;
-
- protected Font plainFont = null;
- protected Font boldFont = null;
Gtk.TreeStore treeStore;
[Glade.Widget] Gtk.TreeView TreeView;
[Glade.Widget] Gtk.Label optionTitle;
- [Glade.Widget] Gtk.Button okbutton;
- [Glade.Widget] Gtk.Button cancelbutton;
[Glade.Widget] Gtk.Notebook mainBook;
[Glade.Widget] Gtk.Image panelImage;
[Glade.Widget] Gtk.Dialog TreeViewOptionDialog;
- PixbufList imglist;
+ StringParserService StringParserService = (StringParserService) ServiceManager.Services.GetService (typeof (StringParserService));
- ResourceService IconService = (ResourceService)ServiceManager.Services.GetService (typeof (IResourceService));
- StringParserService StringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
-
public IProperties Properties {
get {
return properties;
@@ -90,15 +52,13 @@
}
}
- protected void AcceptEvent(object sender, EventArgs e)
+ protected void AcceptEvent (object sender, EventArgs e)
{
foreach (AbstractOptionPanel pane in OptionPanels) {
- if (!pane.ReceiveDialogMessage(DialogMessage.OK)) {
+ if (!pane.ReceiveDialogMessage (DialogMessage.OK))
return;
- }
}
TreeViewOptionDialog.Hide ();
- //DialogResult = DialogResult.OK;
}
public int Run ()
@@ -114,7 +74,7 @@
descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated);
mainBook.CurrentPage = mainBook.PageNum (descriptor.DialogPanel.Control);
if (descriptor.DialogPanel.Icon == null) {
- panelImage.Stock = Gtk.Stock.Properties;
+ panelImage.Stock = Gtk.Stock.Preferences;
} else {
//FIXME: this needs to actually switch over the ImageType and use that instead of this *hack*
if (descriptor.DialogPanel.Icon.Stock != null)
@@ -122,7 +82,7 @@
else
panelImage.Pixbuf = descriptor.DialogPanel.Icon.Pixbuf;
}
- optionTitle.Markup = "<b>" + descriptor.Label + "</b>";
+ optionTitle.Markup = "<span weight=\"bold\" size=\"x-large\">" + descriptor.Label + "</span>";
TreeViewOptionDialog.ShowAll ();
}
}
@@ -139,13 +99,13 @@
Gtk.TreeIter i;
if (iter.Equals (Gtk.TreeIter.Zero)) {
- i = treeStore.AppendValues (descriptor.Label, descriptor, imglist[2]);
+ i = treeStore.AppendValues (descriptor.Label, descriptor);
} else {
- i = treeStore.AppendValues(iter, descriptor.Label, descriptor, imglist[2]);
-
+ i = treeStore.AppendValues (iter, descriptor.Label, descriptor);
}
+
if (descriptor.DialogPanelDescriptors != null) {
- AddNodes(customizer, i, descriptor.DialogPanelDescriptors);
+ AddNodes (customizer, i, descriptor.DialogPanelDescriptors);
}
}
}
@@ -163,30 +123,12 @@
TreeView.ExpandToPath (new_path);
TreeView.Selection.SelectPath (new_path);
} else {
- treeStore.Foreach (new Gtk.TreeModelForeachFunc (killArrows));
- treeStore.SetValue (iter, 2, imglist[3]);
SetOptionPanelTo ((IDialogPanelDescriptor)treeStore.GetValue (iter, 1));
}
}
}
-
- bool killArrows (Gtk.TreeModel mdl, Gtk.TreePath path, Gtk.TreeIter iter)
+ public TreeViewOptions (IProperties properties, IAddInTreeNode node)
{
- treeStore.SetValue (iter, 2, imglist[2]);
- return false;
- }
-
- protected void InitImageList()
- {
- imglist = new PixbufList();
- imglist.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
- imglist.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
- imglist.Add(IconService.GetBitmap("Icons.16x16.Empty") );
- imglist.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow"));
- }
-
- public TreeViewOptions(IProperties properties, IAddInTreeNode node)
- {
this.properties = properties;
Glade.XML treeViewXml = new Glade.XML (null, "Base.glade", "TreeViewOptionDialog", null);
@@ -194,13 +136,11 @@
TreeViewOptionDialog.Title = StringParserService.Parse("${res:Dialog.Options.TreeViewOptions.DialogName}");
- InitImageList ();
-
this.InitializeComponent();
- if (node != null) {
- AddNodes(properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));
- }
+ if (node != null)
+ AddNodes (properties, Gtk.TreeIter.Zero, node.BuildChildItems(this));
+
SelectFirstNode ();
}
@@ -210,33 +150,12 @@
SelectNode (null, null);
}
- protected void InitializeComponent()
+ protected void InitializeComponent ()
{
- treeStore = new Gtk.TreeStore (typeof(string), typeof(IDialogPanelDescriptor), typeof (Gdk.Pixbuf));
- TreeView.Model = treeStore;
-
- Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
- column.Title = "items";
+ treeStore = new Gtk.TreeStore (typeof (string), typeof (IDialogPanelDescriptor));
- Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
- pix_render.PixbufExpanderOpen = imglist[1];
- pix_render.PixbufExpanderClosed = imglist[0];
-
- column.PackStart (pix_render, false);
- column.AddAttribute (pix_render, "pixbuf", 2);
- Gtk.CellRendererText text_render = new Gtk.CellRendererText ();
- column.PackStart (text_render, true);
- column.AddAttribute (text_render, "text", 0);
-
-
- Gtk.TreeViewColumn empty = new Gtk.TreeViewColumn ("a", new Gtk.CellRendererText (), "string", 0);
- TreeView.AppendColumn (empty);
- empty.Visible = false;
- TreeView.ExpanderColumn = empty;
-
- TreeView.AppendColumn (column);
- TreeView.HeadersVisible = false;
-
+ TreeView.Model = treeStore;
+ TreeView.AppendColumn ("", new Gtk.CellRendererText (), "text", 0);
TreeView.Selection.Changed += new EventHandler (SelectNode);
}
More information about the Monodevelop-patches-list
mailing list