Author: danw
Date: 2005-07-12 09:45:21 -0400 (Tue, 12 Jul 2005)
New Revision: 47209
Removed:
trunk/stetic/glue/custom.c
trunk/stetic/libstetic/wrapper/Bin.cs
Modified:
trunk/stetic/ChangeLog
trunk/stetic/glue/Makefile.am
trunk/stetic/libstetic/ClassDescriptor.cs
trunk/stetic/libstetic/GladeUtils.cs
trunk/stetic/libstetic/ItemDescriptor.cs
trunk/stetic/libstetic/ItemGroup.cs
trunk/stetic/libstetic/Makefile.am
trunk/stetic/libstetic/PropertyDescriptor.cs
trunk/stetic/libstetic/wrapper/CheckButton.cs
trunk/stetic/libstetic/wrapper/Container.cs
trunk/stetic/libstetic/wrapper/Custom.cs
trunk/stetic/libstetic/wrapper/Expander.cs
trunk/stetic/libstetic/wrapper/Frame.cs
trunk/stetic/libstetic/wrapper/Label.cs
trunk/stetic/libstetic/wrapper/MessageDialog.cs
trunk/stetic/libstetic/wrapper/RadioButton.cs
trunk/stetic/libstetic/wrapper/ScrolledWindow.cs
trunk/stetic/libstetic/wrapper/Viewport.cs
trunk/stetic/libstetic/wrapper/Widget.cs
trunk/stetic/libstetic/wrapper/Window.cs
trunk/stetic/libstetic/wrapper/objects.xml
trunk/stetic/stetic/ContextMenu.cs
trunk/stetic/stetic/PropertyEditor.cs
trunk/stetic/stetic/PropertyGrid.cs
Log:
* libstetic/ClassDescriptor.cs: fix some names with underscores to
use camelCase instead.
(ClassDescriptor): If a class has no wrapper typed specified, use
its parent's wrapper type. Allow a "cname" attribute, to override
the CName property, so we can use a different class at design time
than we do at runtime (eg, for MessageDialog). Remove the
never-necessary "commands" node and no-longer-necessary
"internal-properties" node. Count the number of "important"
itemgroups.
(NewInstance): move the widget-name-generation code here from
Widget, and apply it to every property on the object with the
init-with-name attribute.
(ImportantGroups): return the number of "important" itemgroups
* libstetic/GladeUtils.cs (ExtractWrapperProperties, GetProps):
update for ItemGroup being enumerable.
(ExportWidget): use the ClassDescriptor's CName, not the wrapped
type's name.
* libstetic/ItemDescriptor.cs (ItemDescriptor, IsInternal): note
when properties are internal.
* libstetic/ItemGroup.cs: make this IEnumerable, clean up a bit
* libstetic/PropertyDescriptor.cs (PropertyDescriptor,
InitWithName): note when properties have the init-with-name
attribute set.
* libstetic/wrapper/objects.xml: Move all internal-properties
properties to internal="true" properties in itemgroups. Set
init-with-name where appropriate. Remove now-redundant
wrapper="..." attributes. Remove <commands> node from Gtk.Label.
Fix Custom and GtkMessageDialog with cname attributes.
* libstetic/wrapper/Bin.cs: gone; Container can handle all of
this now.
* libstetic/wrapper/Expander.cs:
* libstetic/wrapper/Frame.cs:
* libstetic/wrapper/ScrolledWindow.cs:
* libstetic/wrapper/Viewport.cs: inherit from Container now, since
Bin is gone
* libstetic/wrapper/CheckButton.cs (Wrap): Remove Label setting,
which now happens via init-with-name.
* libstetic/wrapper/Container.cs (Wrap): when initializing a
container, if it has no children, add a placeholder.
* libstetic/wrapper/Custom.cs: Remove references to C glue since
we can now do this entirely in C# via the "cname" property. Move
all of the properties into Stetic.Custom and remove
Stetic.Wrapper.Custom.
* libstetic/wrapper/Label.cs (Wrap): remove; LabelProp gets
initialized via init-with-name now
* libstetic/wrapper/MessageDialog.cs: create a new class
Stetic.MessageDialog that subclasses Gtk.Dialog (and update the
objects.xml entry to use that). The old solution of just creating
a special Gtk.Dialog in CreateInstance() doesn't work any more.
* libstetic/wrapper/RadioButton.cs (Wrap): remove the Label
setting, which now happens via init-with-name
* libstetic/wrapper/Widget.cs (Wrap): remove the Name setting,
which now happens in ClassDescriptor.
* libstetic/wrapper/Window.cs: inherit from Container, since Bin
is now gone, and remove Title setting, which now happens via
init-with-name
* stetic/PropertyEditor.cs: fix a bug in int properties with
neither a min nor a max specified.
* stetic/PropertyGrid.cs (AppendItemGroups): use
ClassDescriptor.ImportantGroups rather than assuming the first
ItemGroup should be expanded and the later ones shouldn't.
* glue/custom.c: no longer needed
Modified: trunk/stetic/ChangeLog
===================================================================
--- trunk/stetic/ChangeLog 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/ChangeLog 2005-07-12 13:45:21 UTC (rev 47209)
@@ -1,3 +1,86 @@
+2005-07-12 Dan Winship <[EMAIL PROTECTED]>
+
+ * libstetic/ClassDescriptor.cs: fix some names with underscores to
+ use camelCase instead.
+ (ClassDescriptor): If a class has no wrapper typed specified, use
+ its parent's wrapper type. Allow a "cname" attribute, to override
+ the CName property, so we can use a different class at design time
+ than we do at runtime (eg, for MessageDialog). Remove the
+ never-necessary "commands" node and no-longer-necessary
+ "internal-properties" node. Count the number of "important"
+ itemgroups.
+ (NewInstance): move the widget-name-generation code here from
+ Widget, and apply it to every property on the object with the
+ init-with-name attribute.
+ (ImportantGroups): return the number of "important" itemgroups
+
+ * libstetic/GladeUtils.cs (ExtractWrapperProperties, GetProps):
+ update for ItemGroup being enumerable.
+ (ExportWidget): use the ClassDescriptor's CName, not the wrapped
+ type's name.
+
+ * libstetic/ItemDescriptor.cs (ItemDescriptor, IsInternal): note
+ when properties are internal.
+
+ * libstetic/ItemGroup.cs: make this IEnumerable, clean up a bit
+
+ * libstetic/PropertyDescriptor.cs (PropertyDescriptor,
+ InitWithName): note when properties have the init-with-name
+ attribute set.
+
+ * libstetic/wrapper/objects.xml: Move all internal-properties
+ properties to internal="true" properties in itemgroups. Set
+ init-with-name where appropriate. Remove now-redundant
+ wrapper="..." attributes. Remove <commands> node from Gtk.Label.
+ Fix Custom and GtkMessageDialog with cname attributes.
+
+ * libstetic/wrapper/Bin.cs: gone; Container can handle all of
+ this now.
+
+ * libstetic/wrapper/Expander.cs:
+ * libstetic/wrapper/Frame.cs:
+ * libstetic/wrapper/ScrolledWindow.cs:
+ * libstetic/wrapper/Viewport.cs: inherit from Container now, since
+ Bin is gone
+
+ * libstetic/wrapper/CheckButton.cs (Wrap): Remove Label setting,
+ which now happens via init-with-name.
+
+ * libstetic/wrapper/Container.cs (Wrap): when initializing a
+ container, if it has no children, add a placeholder.
+
+ * libstetic/wrapper/Custom.cs: Remove references to C glue since
+ we can now do this entirely in C# via the "cname" property. Move
+ all of the properties into Stetic.Custom and remove
+ Stetic.Wrapper.Custom.
+
+ * libstetic/wrapper/Label.cs (Wrap): remove; LabelProp gets
+ initialized via init-with-name now
+
+ * libstetic/wrapper/MessageDialog.cs: create a new class
+ Stetic.MessageDialog that subclasses Gtk.Dialog (and update the
+ objects.xml entry to use that). The old solution of just creating
+ a special Gtk.Dialog in CreateInstance() doesn't work any more.
+
+ * libstetic/wrapper/RadioButton.cs (Wrap): remove the Label
+ setting, which now happens via init-with-name
+
+ * libstetic/wrapper/Widget.cs (Wrap): remove the Name setting,
+ which now happens in ClassDescriptor.
+
+ * libstetic/wrapper/Window.cs: inherit from Container, since Bin
+ is now gone, and remove Title setting, which now happens via
+ init-with-name
+
+ * stetic/PropertyEditor.cs: fix a bug in int properties with
+ neither a min nor a max specified.
+
+ * stetic/PropertyGrid.cs (AppendItemGroups): use
+ ClassDescriptor.ImportantGroups rather than assuming the first
+ ItemGroup should be expanded and the later ones shouldn't.
+
+ * glue/custom.c: no longer needed
+
2005-07-11 Dan Winship <[EMAIL PROTECTED]>
* libstetic/wrapper/objects.xml: add some missing properties
Modified: trunk/stetic/glue/Makefile.am
===================================================================
--- trunk/stetic/glue/Makefile.am 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/glue/Makefile.am 2005-07-12 13:45:21 UTC (rev 47209)
@@ -6,6 +6,5 @@
libsteticglue_la_LIBADD = $(GTK_LIBS)
libsteticglue_la_SOURCES = \
- custom.c \
misc.c \
paramspec.c
\ No newline at end of file
Deleted: trunk/stetic/glue/custom.c
===================================================================
--- trunk/stetic/glue/custom.c 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/glue/custom.c 2005-07-12 13:45:21 UTC (rev 47209)
@@ -1,79 +0,0 @@
-#include <gtk/gtkdrawingarea.h>
-
-/* This is done in C, because it's tiny, and it's much simpler to make
- * glade import/export work if the registered name of the class is just
- * "Custom", and GLib.Object won't let us do that.
- */
-
-typedef struct {
- GtkDrawingArea parent;
-} Custom;
-
-typedef struct {
- GtkDrawingAreaClass parent_class;
-} CustomClass;
-
-GType custom_get_type (void);
-Custom *custom_new (void);
-static void custom_realize (GtkWidget *widget);
-static void custom_set_property (GObject *object, guint prop_id, const GValue
*value, GParamSpec *pspec);
-
-G_DEFINE_TYPE (Custom, custom, GTK_TYPE_DRAWING_AREA)
-
-static void
-custom_class_init (CustomClass *klass)
-{
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->set_property = custom_set_property;
- widget_class->realize = custom_realize;
-
- g_object_class_install_property (object_class, 1,
- g_param_spec_string
("last_modification_time",
- NULL, NULL, NULL,
-
G_PARAM_WRITABLE));
-}
-
-static void
-custom_init (Custom *custom)
-{
- ;
-}
-
-Custom *
-custom_new (void)
-{
- return g_object_new (custom_get_type (), NULL);
-}
-
-static void
-custom_set_property (GObject *object, guint prop_id, const GValue *value,
GParamSpec *pspec)
-{
-}
-
-/* from glade */
-static char * custom_bg_xpm[] = {
-"8 8 4 1",
-" c None",
-". c #BBBBBB",
-"+ c #D6D6D6",
-"@ c #6B5EFF",
-".+..+...",
-"+..@@@..",
-"[EMAIL PROTECTED]",
-"[EMAIL PROTECTED]",
-"[EMAIL PROTECTED]",
-".++@@@..",
-"..++....",
-"..++...."};
-
-static void
-custom_realize (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (custom_parent_class)->realize (widget);
-
- GdkPixmap *pixmap;
- pixmap = gdk_pixmap_create_from_xpm_d (widget->window, NULL, NULL,
custom_bg_xpm);
- gdk_window_set_back_pixmap (widget->window, pixmap, FALSE);
-}
Modified: trunk/stetic/libstetic/ClassDescriptor.cs
===================================================================
--- trunk/stetic/libstetic/ClassDescriptor.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/ClassDescriptor.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -10,24 +10,40 @@
Type wrapped, wrapper;
GLib.GType gtype;
- MethodInfo ctor_minfo;
+ MethodInfo ctorMethodInfo;
ConstructorInfo cinfo;
- bool use_gtype_ctor;
+ bool useGTypeCtor;
- string label, category;
+ string label, category, cname;
Gdk.Pixbuf icon;
bool deprecated, hexpandable, vexpandable;
- ItemGroup internal_props = ItemGroup.Empty;
- ItemGroup commands = ItemGroup.Empty;
+ ArrayList groups = new ArrayList ();
+ int importantGroups;
ItemGroup contextMenu = ItemGroup.Empty;
- ArrayList groups = new ArrayList ();
public ClassDescriptor (Assembly assembly, XmlElement elem)
{
wrapped = Type.GetType (elem.GetAttribute ("type"),
true);
- wrapper = Type.GetType (elem.GetAttribute ("wrapper"),
true);
+ if (elem.HasAttribute ("wrapper"))
+ wrapper = Type.GetType (elem.GetAttribute
("wrapper"), true);
+ else {
+ for (Type type = wrapped.BaseType; type !=
null; type = type.BaseType) {
+ ClassDescriptor parent =
Registry.LookupClass (type);
+ if (parent != null) {
+ wrapper = parent.WrapperType;
+ break;
+ }
+ }
+ if (wrapper == null)
+ throw new ArgumentException ("No
wrapper type for class {0}", wrapped.FullName);
+ }
+
gtype = (GLib.GType)wrapped;
+ if (elem.HasAttribute ("cname"))
+ cname = elem.GetAttribute ("cname");
+ else
+ cname = gtype.ToString ();
label = elem.GetAttribute ("label");
category = elem.GetAttribute ("palette-category");
@@ -46,42 +62,40 @@
if (elem.HasAttribute ("vexpandable"))
vexpandable = true;
- ctor_minfo = wrapper.GetMethod ("CreateInstance",
- BindingFlags.Static |
BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly,
- null, new Type[0],
null);
- if (ctor_minfo == null) {
+ ctorMethodInfo = wrapper.GetMethod ("CreateInstance",
+ BindingFlags.Static
| BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly,
+ null, new Type[0],
null);
+ if (ctorMethodInfo == null) {
cinfo = wrapped.GetConstructor (new Type[0]);
if (cinfo == null) {
- use_gtype_ctor = true;
+ useGTypeCtor = true;
cinfo = wrapped.GetConstructor (new
Type[] { typeof (IntPtr) });
}
}
- XmlElement internal_elem = elem["internal-properties"];
- if (internal_elem != null)
- internal_props = new ItemGroup (internal_elem,
this);
-
- XmlElement commands_elem = elem["commands"];
- if (commands_elem != null)
- commands = new ItemGroup (commands_elem, this);
-
- XmlElement groups_elem = elem["itemgroups"];
- if (groups_elem != null) {
- foreach (XmlElement group_elem in
groups_elem.SelectNodes ("./itemgroup")) {
+ XmlElement groupsElem = elem["itemgroups"];
+ if (groupsElem != null) {
+ foreach (XmlElement groupElem in
groupsElem.SelectNodes ("itemgroup")) {
ItemGroup itemgroup;
- if (group_elem.HasAttribute ("ref")) {
- string refname =
group_elem.GetAttribute ("ref");
+ if (groupElem.HasAttribute ("ref")) {
+ string refname =
groupElem.GetAttribute ("ref");
itemgroup =
Registry.LookupItemGroup (refname);
} else
- itemgroup = new ItemGroup
(group_elem, this);
+ itemgroup = new ItemGroup
(groupElem, this);
groups.Add (itemgroup);
+
+ if (groupElem.HasAttribute
("important")) {
+ if (groupElem.GetAttribute
("important") == "true")
+ importantGroups++;
+ } else if (groups.Count == 1)
+ importantGroups++;
}
}
- XmlElement context_elem = elem["contextmenu"];
- if (context_elem != null)
- contextMenu = new ItemGroup (context_elem,
this);
+ XmlElement contextElem = elem["contextmenu"];
+ if (contextElem != null)
+ contextMenu = new ItemGroup (contextElem, this);
else
contextMenu = ItemGroup.Empty;
}
@@ -106,7 +120,7 @@
public string CName {
get {
- return gtype.ToString ();
+ return cname;
}
}
@@ -149,37 +163,39 @@
[DllImport("libgobject-2.0-0.dll")]
static extern IntPtr g_object_new (IntPtr gtype, IntPtr dummy);
+ int counter;
+
public object NewInstance (IStetic stetic)
{
object inst;
- if (ctor_minfo != null)
- inst = ctor_minfo.Invoke (null, new object[0]);
- else if (!use_gtype_ctor)
+ if (ctorMethodInfo != null)
+ inst = ctorMethodInfo.Invoke (null, new
object[0]);
+ else if (!useGTypeCtor)
inst = cinfo.Invoke (null, new object[0]);
else {
IntPtr raw = g_object_new (gtype.Val,
IntPtr.Zero);
inst = cinfo.Invoke (new object[] { raw });
}
+ string name = wrapped.Name.ToLower () +
(++counter).ToString ();
+ foreach (ItemGroup group in groups) {
+ foreach (ItemDescriptor item in group) {
+ PropertyDescriptor prop = item as
PropertyDescriptor;
+ if (prop != null && prop.InitWithName)
+ prop.SetValue (inst, name);
+ }
+ }
+
ObjectWrapper.Create (stetic, inst, false);
return inst;
}
public ItemDescriptor this[string name] {
get {
- ItemDescriptor item;
-
- item = internal_props[name];
- if (item != null)
- return item;
- item = commands[name];
- if (item != null)
- return item;
-
if (groups != null) {
foreach (ItemGroup group in groups) {
- item = group[name];
+ ItemDescriptor item =
group[name];
if (item != null)
return item;
}
@@ -195,6 +211,12 @@
}
}
+ public int ImportantGroups {
+ get {
+ return importantGroups;
+ }
+ }
+
public ItemGroup ContextMenu {
get {
return contextMenu;
Modified: trunk/stetic/libstetic/GladeUtils.cs
===================================================================
--- trunk/stetic/libstetic/GladeUtils.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/GladeUtils.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -220,7 +220,7 @@
props[prop.GetAttribute ("name")] = prop;
foreach (ItemGroup group in klass.ItemGroups) {
- foreach (ItemDescriptor item in group.Items) {
+ foreach (ItemDescriptor item in group) {
PropertyDescriptor prop = item as
PropertyDescriptor;
if (prop == null)
continue;
@@ -387,12 +387,11 @@
XmlDocument doc)
{
Type wrappedType = wrapper.Wrapped.GetType ();
- string className = ((GLib.GType)wrappedType).ToString
();
- string id = ((Gtk.Widget)wrapper.Wrapped).Name;
+ ClassDescriptor klass = Registry.LookupClass
(wrappedType);
XmlElement elem = doc.CreateElement ("widget");
- elem.SetAttribute ("class", className);
- elem.SetAttribute ("id", id);
+ elem.SetAttribute ("class", klass.CName);
+ elem.SetAttribute ("id",
((Gtk.Widget)wrapper.Wrapped).Name);
GetProps (wrapper, elem);
return elem;
@@ -400,8 +399,10 @@
static public void GetProps (ObjectWrapper wrapper, XmlElement
parent_elem)
{
- foreach (ItemGroup group in Registry.LookupClass
(wrapper.Wrapped.GetType ()).ItemGroups) {
- foreach (ItemDescriptor item in group.Items) {
+ ClassDescriptor klass = Registry.LookupClass
(wrapper.Wrapped.GetType ());
+
+ foreach (ItemGroup group in klass.ItemGroups) {
+ foreach (ItemDescriptor item in group) {
PropertyDescriptor prop = item as
PropertyDescriptor;
if (prop == null)
continue;
Modified: trunk/stetic/libstetic/ItemDescriptor.cs
===================================================================
--- trunk/stetic/libstetic/ItemDescriptor.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/ItemDescriptor.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -7,11 +7,13 @@
public abstract class ItemDescriptor {
Hashtable deps, visdeps;
+ bool isInternal;
protected ItemDescriptor () {}
protected ItemDescriptor (XmlElement elem, ItemGroup group,
ClassDescriptor klass)
{
+ isInternal = elem.HasAttribute ("internal");
deps = AddSubprops (elem.SelectNodes ("./disabled-if"),
group, klass);
visdeps = AddSubprops (elem.SelectNodes
("./invisible-if"), group, klass);
}
@@ -89,5 +91,11 @@
}
return true;
}
+
+ public bool IsInternal {
+ get {
+ return isInternal;
+ }
+ }
}
}
Modified: trunk/stetic/libstetic/ItemGroup.cs
===================================================================
--- trunk/stetic/libstetic/ItemGroup.cs 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/libstetic/ItemGroup.cs 2005-07-12 13:45:21 UTC (rev 47209)
@@ -1,50 +1,67 @@
using System;
-using System.Reflection;
+using System.Collections;
using System.Xml;
namespace Stetic {
- public struct ItemGroup {
- public string Label, Name;
- public ItemDescriptor[] Items;
-
+ public struct ItemGroup : IEnumerable {
public static ItemGroup Empty;
static ItemGroup ()
{
Empty = new ItemGroup ();
- Empty.Items = new ItemDescriptor[0];
+ Empty.items = new ItemDescriptor[0];
}
public ItemGroup (XmlElement elem, ClassDescriptor klass)
{
- Label = elem.GetAttribute ("label");
- Name = elem.GetAttribute ("name");
+ label = elem.GetAttribute ("label");
+ name = elem.GetAttribute ("name");
XmlNodeList nodes = elem.ChildNodes;
- Items = new ItemDescriptor[nodes.Count];
+ items = new ItemDescriptor[nodes.Count];
for (int i = 0; i < nodes.Count; i++) {
XmlElement item =
(XmlElement)elem.ChildNodes[i];
string refname = item.GetAttribute ("ref");
if (refname != "") {
if (refname.IndexOf ('.') != -1)
- Items[i] = Registry.LookupItem
(refname);
+ items[i] = Registry.LookupItem
(refname);
else
- Items[i] = klass[refname];
+ items[i] = klass[refname];
continue;
}
if (item.Name == "property")
- Items[i] = new PropertyDescriptor
((XmlElement)item, this, klass);
+ items[i] = new PropertyDescriptor
((XmlElement)item, this, klass);
else if (item.Name == "command")
- Items[i] = new CommandDescriptor
((XmlElement)item, this, klass);
+ items[i] = new CommandDescriptor
((XmlElement)item, this, klass);
else
throw new ApplicationException ("Bad
item name " + item.Name + " in " + klass.WrapperType.Name);
}
}
+ string label, name;
+ ItemDescriptor[] items;
+
+ public string Label {
+ get {
+ return label;
+ }
+ }
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+
+ public IEnumerator GetEnumerator ()
+ {
+ return items.GetEnumerator ();
+ }
+
public ItemDescriptor this [string name] {
get {
- foreach (ItemDescriptor item in Items) {
+ foreach (ItemDescriptor item in items) {
if (item != null && item.Name == name)
return item;
}
Modified: trunk/stetic/libstetic/Makefile.am
===================================================================
--- trunk/stetic/libstetic/Makefile.am 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/libstetic/Makefile.am 2005-07-12 13:45:21 UTC (rev 47209)
@@ -36,7 +36,6 @@
editor/String.cs \
editor/Text.cs \
editor/ThemedIcon.cs \
- wrapper/Bin.cs \
wrapper/Box.cs \
wrapper/Button.cs \
wrapper/CheckButton.cs \
Modified: trunk/stetic/libstetic/PropertyDescriptor.cs
===================================================================
--- trunk/stetic/libstetic/PropertyDescriptor.cs 2005-07-12 13:42:54 UTC
(rev 47208)
+++ trunk/stetic/libstetic/PropertyDescriptor.cs 2005-07-12 13:45:21 UTC
(rev 47209)
@@ -8,7 +8,7 @@
public class PropertyDescriptor : ItemDescriptor {
PropertyInfo memberInfo, propertyInfo;
- bool isWrapperProperty, hasDefault, gladeOverride;
+ bool isWrapperProperty, hasDefault, gladeOverride, initWithName;
ParamSpec pspec;
Type editorType;
string label, description, gladeName;
@@ -75,6 +75,9 @@
if (elem.HasAttribute ("glade-name"))
gladeName = elem.GetAttribute ("glade-name");
+
+ if (elem.HasAttribute ("init-with-name"))
+ initWithName = true;
}
PropertyDescriptor (Type objectType, string propertyName)
@@ -255,5 +258,11 @@
return null;
}
}
+
+ public bool InitWithName {
+ get {
+ return initWithName;
+ }
+ }
}
}
Deleted: trunk/stetic/libstetic/wrapper/Bin.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Bin.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Bin.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -1,40 +0,0 @@
-using System;
-using System.Xml;
-
-namespace Stetic.Wrapper {
-
- public class Bin : Container {
-
- public override void Wrap (object obj, bool initialized)
- {
- base.Wrap (obj, initialized);
- if (!initialized && bin.Child == null)
- AddPlaceholder ();
- }
-
- public override void GladeImport (XmlElement elem)
- {
- base.GladeImport (elem);
- if (elem["child"] == null)
- AddPlaceholder ();
- }
-
- Gtk.Bin bin {
- get {
- return (Gtk.Bin)Wrapped;
- }
- }
-
- public override bool HExpandable {
- get {
- return ChildHExpandable (bin.Child);
- }
- }
- public override bool VExpandable {
- get {
- return ChildVExpandable (bin.Child);
- }
- }
- }
-}
-
Modified: trunk/stetic/libstetic/wrapper/CheckButton.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/CheckButton.cs 2005-07-12 13:42:54 UTC
(rev 47208)
+++ trunk/stetic/libstetic/wrapper/CheckButton.cs 2005-07-12 13:45:21 UTC
(rev 47209)
@@ -5,15 +5,6 @@
public class CheckButton : Container {
- public override void Wrap (object obj, bool initialized)
- {
- base.Wrap (obj, initialized);
- if (!initialized) {
- Gtk.CheckButton checkbutton =
(Gtk.CheckButton)obj;
- checkbutton.Label = checkbutton.Name;
- }
- }
-
public override Widget GladeImportChild (XmlElement child_elem)
{
hasLabel = false;
Modified: trunk/stetic/libstetic/wrapper/Container.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Container.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Container.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -10,6 +10,10 @@
public override void Wrap (object obj, bool initialized)
{
base.Wrap (obj, initialized);
+
+ if (!initialized && container.Children.Length == 0)
+ AddPlaceholder ();
+
container.Removed += ChildRemoved;
container.SizeAllocated += SizeAllocated;
Modified: trunk/stetic/libstetic/wrapper/Custom.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Custom.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Custom.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -1,41 +1,37 @@
using System;
-using System.Collections;
-using System.Runtime.InteropServices;
namespace Stetic {
public class Custom : Gtk.DrawingArea {
- static Custom ()
- {
- GLib.GType.Register (GType, typeof (Stetic.Custom));
- }
+ public Custom () {}
- public Custom (IntPtr raw) : base(raw) {}
+ public Custom (IntPtr raw) : base (raw) {}
- [DllImport("libsteticglue")]
- static extern IntPtr custom_new();
+ // from glade
+ static private string[] custom_bg_xpm = {
+ "8 8 4 1",
+ " c None",
+ ". c #BBBBBB",
+ "+ c #D6D6D6",
+ "@ c #6B5EFF",
+ ".+..+...",
+ "+..@@@..",
+ "[EMAIL PROTECTED]",
+ "[EMAIL PROTECTED]",
+ "[EMAIL PROTECTED]",
+ ".++@@@..",
+ "..++....",
+ "..++...."
+ };
- public Custom () : base (IntPtr.Zero)
+ protected override void OnRealized ()
{
- Raw = custom_new ();
- }
+ base.OnRealized ();
- ~Custom () { Dispose (); }
-
- [DllImport("libsteticglue")]
- static extern IntPtr custom_get_type();
-
- public static new GLib.GType GType {
- get {
- return new GLib.GType (custom_get_type ());
- }
+ Gdk.Pixmap pixmap, mask;
+ pixmap = Gdk.Pixmap.CreateFromXpmD (GdkWindow, out
mask, new Gdk.Color (99, 99, 99), custom_bg_xpm);
+ GdkWindow.SetBackPixmap (pixmap, false);
}
- }
-}
-namespace Stetic.Wrapper {
-
- public class Custom : Widget {
-
string creationFunction, string1, string2;
int int1, int2;
@@ -48,6 +44,15 @@
}
}
+ public string LastModificationTime {
+ get {
+ return null;
+ }
+ set {
+ ;
+ }
+ }
+
public string String1 {
get {
return string1;
Modified: trunk/stetic/libstetic/wrapper/Expander.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Expander.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Expander.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -4,7 +4,7 @@
namespace Stetic.Wrapper {
- public class Expander : Bin {
+ public class Expander : Container {
public static new Gtk.Expander CreateInstance ()
{
Modified: trunk/stetic/libstetic/wrapper/Frame.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Frame.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Frame.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -4,7 +4,7 @@
namespace Stetic.Wrapper {
- public class Frame : Bin {
+ public class Frame : Container {
public override void Wrap (object obj, bool initialized)
{
@@ -15,7 +15,7 @@
frame.Shadow = Gtk.ShadowType.None;
Gtk.Alignment align = new Gtk.Alignment (0, 0,
1, 1);
align.LeftPadding = 12;
- Bin align_wrapper = (Bin)ObjectWrapper.Create
(stetic, align);
+ Container align_wrapper =
(Container)ObjectWrapper.Create (stetic, align);
align_wrapper.AddPlaceholder ();
ReplaceChild (frame.Child,
(Gtk.Widget)align_wrapper.Wrapped);
}
Modified: trunk/stetic/libstetic/wrapper/Label.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Label.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Label.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -12,15 +12,6 @@
Wrap (new Gtk.Label (text), true);
}
- public override void Wrap (object obj, bool initialized)
- {
- base.Wrap (obj, initialized);
- if (!initialized) {
- Gtk.Label label = (Gtk.Label)Wrapped;
- label.LabelProp = label.Name;
- }
- }
-
string mnem;
public string MnemonicWidget {
get {
Modified: trunk/stetic/libstetic/wrapper/MessageDialog.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/MessageDialog.cs 2005-07-12 13:42:54 UTC
(rev 47208)
+++ trunk/stetic/libstetic/wrapper/MessageDialog.cs 2005-07-12 13:45:21 UTC
(rev 47209)
@@ -1,60 +1,50 @@
using System;
-namespace Stetic.Wrapper {
+namespace Stetic {
- public class MessageDialog : Dialog {
+ public class MessageDialog : Gtk.Dialog {
- Gtk.Label label, secondaryLabel;
- Gtk.Image icon;
-
- public static new Gtk.Dialog CreateInstance ()
+ public MessageDialog ()
{
- return new Gtk.Dialog ();
- }
+ Resizable = false;
+ HasSeparator = false;
+ BorderWidth = 12;
- public override void Wrap (object obj, bool initialized)
- {
- base.Wrap (obj, initialized);
- if (!initialized) {
- dialog.Resizable = false;
- dialog.BorderWidth = 12;
+ label = new Gtk.Label ();
+ label.LineWrap = true;
+ label.Selectable = true;
+ label.UseMarkup = true;
+ label.SetAlignment (0.0f, 0.0f);
- label = new Gtk.Label ();
- label.LineWrap = true;
- label.Selectable = true;
- label.UseMarkup = true;
- label.SetAlignment (0.0f, 0.0f);
+ secondaryLabel = new Gtk.Label ();
+ secondaryLabel.LineWrap = true;
+ secondaryLabel.Selectable = true;
+ secondaryLabel.UseMarkup = true;
+ secondaryLabel.SetAlignment (0.0f, 0.0f);
- secondaryLabel = new Gtk.Label ();
- secondaryLabel.LineWrap = true;
- secondaryLabel.Selectable = true;
- secondaryLabel.UseMarkup = true;
- secondaryLabel.SetAlignment (0.0f, 0.0f);
+ icon = new Gtk.Image (Gtk.Stock.DialogInfo,
Gtk.IconSize.Dialog);
+ icon.SetAlignment (0.5f, 0.0f);
- icon = new Gtk.Image (Gtk.Stock.DialogInfo,
Gtk.IconSize.Dialog);
- icon.SetAlignment (0.5f, 0.0f);
+ Gtk.StockItem item = Gtk.Stock.Lookup (icon.Stock);
+ Title = item.Label;
- Gtk.HBox hbox = new Gtk.HBox (false, 12);
- Gtk.VBox vbox = new Gtk.VBox (false, 12);
+ Gtk.HBox hbox = new Gtk.HBox (false, 12);
+ Gtk.VBox vbox = new Gtk.VBox (false, 12);
- vbox.PackStart (label, false, false, 0);
- vbox.PackStart (secondaryLabel, true, true, 0);
+ vbox.PackStart (label, false, false, 0);
+ vbox.PackStart (secondaryLabel, true, true, 0);
- hbox.PackStart (icon, false, false, 0);
- hbox.PackStart (vbox, true, true, 0);
+ hbox.PackStart (icon, false, false, 0);
+ hbox.PackStart (vbox, true, true, 0);
- dialog.VBox.PackStart (hbox, false, false, 0);
- hbox.ShowAll ();
+ VBox.PackStart (hbox, false, false, 0);
+ hbox.ShowAll ();
- Buttons = Gtk.ButtonsType.OkCancel;
- }
+ Buttons = Gtk.ButtonsType.OkCancel;
}
- private Gtk.Dialog dialog {
- get {
- return (Gtk.Dialog)Wrapped;
- }
- }
+ Gtk.Label label, secondaryLabel;
+ Gtk.Image icon;
public Gtk.MessageType MessageType {
get {
@@ -69,7 +59,7 @@
}
set {
Gtk.StockItem item = Gtk.Stock.Lookup
(icon.Stock);
- bool setTitle = (dialog.Title == "") ||
(dialog.Title == item.Label);
+ bool setTitle = (Title == "") || (Title ==
item.Label);
if (value == Gtk.MessageType.Info)
icon.Stock = Gtk.Stock.DialogInfo;
@@ -82,7 +72,7 @@
if (setTitle) {
item = Gtk.Stock.Lookup (icon.Stock);
- dialog.Title = item.Label;
+ Title = item.Label;
}
}
}
@@ -113,9 +103,9 @@
return buttons;
}
set {
- Gtk.Widget[] oldButtons =
dialog.ActionArea.Children;
+ Gtk.Widget[] oldButtons = ActionArea.Children;
foreach (Gtk.Widget w in oldButtons)
- dialog.ActionArea.Remove (w);
+ ActionArea.Remove (w);
buttons = value;
switch (buttons) {
@@ -124,25 +114,25 @@
break;
case Gtk.ButtonsType.Ok:
- dialog.AddButton (Gtk.Stock.Ok,
Gtk.ResponseType.Ok);
+ AddButton (Gtk.Stock.Ok,
Gtk.ResponseType.Ok);
break;
case Gtk.ButtonsType.Close:
- dialog.AddButton (Gtk.Stock.Close,
Gtk.ResponseType.Close);
+ AddButton (Gtk.Stock.Close,
Gtk.ResponseType.Close);
break;
case Gtk.ButtonsType.Cancel:
- dialog.AddButton (Gtk.Stock.Cancel,
Gtk.ResponseType.Cancel);
+ AddButton (Gtk.Stock.Cancel,
Gtk.ResponseType.Cancel);
break;
case Gtk.ButtonsType.YesNo:
- dialog.AddButton (Gtk.Stock.No,
Gtk.ResponseType.No);
- dialog.AddButton (Gtk.Stock.Yes,
Gtk.ResponseType.Yes);
+ AddButton (Gtk.Stock.No,
Gtk.ResponseType.No);
+ AddButton (Gtk.Stock.Yes,
Gtk.ResponseType.Yes);
break;
case Gtk.ButtonsType.OkCancel:
- dialog.AddButton (Gtk.Stock.Cancel,
Gtk.ResponseType.Cancel);
- dialog.AddButton (Gtk.Stock.Ok,
Gtk.ResponseType.Ok);
+ AddButton (Gtk.Stock.Cancel,
Gtk.ResponseType.Cancel);
+ AddButton (Gtk.Stock.Ok,
Gtk.ResponseType.Ok);
break;
}
}
Modified: trunk/stetic/libstetic/wrapper/RadioButton.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/RadioButton.cs 2005-07-12 13:42:54 UTC
(rev 47208)
+++ trunk/stetic/libstetic/wrapper/RadioButton.cs 2005-07-12 13:45:21 UTC
(rev 47209)
@@ -13,10 +13,9 @@
base.Wrap (obj, initialized);
Gtk.RadioButton radiobutton = (Gtk.RadioButton)Wrapped;
- if (!initialized) {
- radiobutton.Label = radiobutton.Name;
+ if (!initialized)
Group = GroupManager.LastGroup;
- } else if (radiobutton.Group == null)
+ else if (radiobutton.Group == null)
Group = radiobutton.Name;
}
Modified: trunk/stetic/libstetic/wrapper/ScrolledWindow.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/ScrolledWindow.cs 2005-07-12 13:42:54 UTC
(rev 47208)
+++ trunk/stetic/libstetic/wrapper/ScrolledWindow.cs 2005-07-12 13:45:21 UTC
(rev 47209)
@@ -3,7 +3,7 @@
namespace Stetic.Wrapper {
- public class ScrolledWindow : Bin {
+ public class ScrolledWindow : Container {
public override void Wrap (object obj, bool initialized)
{
Modified: trunk/stetic/libstetic/wrapper/Viewport.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Viewport.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Viewport.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -3,7 +3,7 @@
namespace Stetic.Wrapper {
- public class Viewport : Bin {
+ public class Viewport : Container {
public Viewport ()
{
Modified: trunk/stetic/libstetic/wrapper/Widget.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Widget.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Widget.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -6,8 +6,6 @@
public class Widget : Object {
- static Hashtable counters = new Hashtable ();
-
public override void Wrap (object obj, bool initialized)
{
base.Wrap (obj, initialized);
@@ -15,14 +13,6 @@
if (!(Wrapped is Gtk.Window))
Wrapped.ShowAll ();
- Type type = GetType ();
- if (!counters.Contains (type))
- counters[type] = 1;
-
- if (!initialized)
- Wrapped.Name = type.Name.ToLower () +
((int)counters[type]).ToString ();
- counters[type] = (int)counters[type] + 1;
-
Wrapped.PopupMenu += PopupMenu;
InterceptClicks (Wrapped);
Modified: trunk/stetic/libstetic/wrapper/Window.cs
===================================================================
--- trunk/stetic/libstetic/wrapper/Window.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/Window.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -4,7 +4,7 @@
namespace Stetic.Wrapper {
- public class Window : Bin {
+ public class Window : Container {
public override void Wrap (object obj, bool initialized)
{
@@ -14,8 +14,6 @@
base.Wrap (obj, initialized);
if (!initialized) {
- window.Title = window.Name;
-
if (window.Child is Placeholder)
window.Child.SetSizeRequest (200, 200);
}
Modified: trunk/stetic/libstetic/wrapper/objects.xml
===================================================================
--- trunk/stetic/libstetic/wrapper/objects.xml 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/libstetic/wrapper/objects.xml 2005-07-12 13:45:21 UTC (rev
47209)
@@ -2,9 +2,6 @@
<objects xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<object type="Gtk.Widget,gtk-sharp" wrapper="Stetic.Wrapper.Widget">
- <internal-properties>
- <property name="Name" />
- </internal-properties>
<itemgroups>
<itemgroup label="Common Widget Properties">
<property name="WidthRequest" />
@@ -17,6 +14,7 @@
<property name="HasFocus" />
<property name="Events" />
<property name="ExtensionEvents" />
+ <property name="Name" internal="true" init-with-name="true" />
</itemgroup>
</itemgroups>
@@ -71,17 +69,20 @@
<object type="Gtk.Container,gtk-sharp" wrapper="Stetic.Wrapper.Container"
/>
<object type="Gtk.Container+ContainerChild,gtk-sharp"
wrapper="Stetic.Wrapper.Container+ContainerChild">
- <internal-properties>
- <property name="AutoSize" label="Auto Size"
- description="If set, the other packing properties for
this cell will be automatically adjusted as other widgets are added to and
removed from the container" />
- </internal-properties>
+ <itemgroups>
+ <itemgroup label="Container Layout">
+ <property name="AutoSize" label="Auto Size"
+ description="If set, the other packing properties for
this cell will be automatically adjusted as other widgets are added to and
removed from the container"
+ internal="true" />
+ </itemgroup>
+ </itemgroups>
</object>
<object type="Gtk.Window,gtk-sharp" wrapper="Stetic.Wrapper.Window"
label="Window" icon="window.png" palette-category="window">
<itemgroups>
<itemgroup label="Window Properties">
- <property name="Title" />
+ <property name="Title" init-with-name="true" />
<property name="Icon" editor="Stetic.Editor.ImageFile" />
<property name="Type" glade-override="true" />
<property name="TypeHint" glade-override="true" />
@@ -110,7 +111,7 @@
</itemgroups>
</object>
- <object type="Gtk.Misc,gtk-sharp" wrapper="Stetic.Wrapper.Widget">
+ <object type="Gtk.Misc,gtk-sharp">
<itemgroups>
<itemgroup label="Miscellaneous Alignment Properties">
<property name="Xpad" />
@@ -131,7 +132,7 @@
</itemgroup>
</itemgroups>
</object>
- <object type="Gtk.Paned+PanedChild,gtk-sharp"
wrapper="Stetic.Wrapper.Container+ContainerChild">
+ <object type="Gtk.Paned+PanedChild,gtk-sharp">
<itemgroups>
<itemgroup label="Pane Child Layout">
<property name="Resize" />
@@ -179,7 +180,7 @@
</itemgroups>
</object>
- <object type="Gtk.Alignment,gtk-sharp" wrapper="Stetic.Wrapper.Bin"
+ <object type="Gtk.Alignment,gtk-sharp"
label="Alignment" icon="alignment.png" palette-category="container">
<itemgroups>
<itemgroup label="Alignment Properties">
@@ -197,7 +198,7 @@
</itemgroups>
</object>
- <object type="Gtk.Arrow,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.Arrow,gtk-sharp"
label="Arrow" icon="arrow.png" palette-category="widget">
<itemgroups>
<itemgroup label="Arrow Properties">
@@ -209,7 +210,7 @@
</itemgroups>
</object>
- <object type="Gtk.Bin,gtk-sharp" wrapper="Stetic.Wrapper.Bin" />
+ <object type="Gtk.Bin,gtk-sharp" />
<object type="Gtk.Box,gtk-sharp" wrapper="Stetic.Wrapper.Box">
<itemgroups>
@@ -244,7 +245,7 @@
</itemgroups>
</object>
- <object type="Gtk.ButtonBox,gtk-sharp" wrapper="Stetic.Wrapper.Box">
+ <object type="Gtk.ButtonBox,gtk-sharp">
<itemgroups>
<itemgroup label="Button Box Properties">
<property name="LayoutStyle" />
@@ -253,7 +254,7 @@
</itemgroup>
</itemgroups>
</object>
- <object type="Gtk.ButtonBox+ButtonBoxChild,gtk-sharp"
wrapper="Stetic.Wrapper.Container+ContainerChild">
+ <object type="Gtk.ButtonBox+ButtonBoxChild,gtk-sharp">
<itemgroups>
<itemgroup label="Button Box Child Layout">
<property name="PackType" />
@@ -270,9 +271,6 @@
<object type="Gtk.Button,gtk-sharp" wrapper="Stetic.Wrapper.Button"
label="Button" icon="button.png" palette-category="widget">
- <internal-properties>
- <property name="HasResponseId" />
- </internal-properties>
<itemgroups>
<itemgroup label="Button Properties">
<property name="Type" label="Button Type"
@@ -309,6 +307,7 @@
<invisible-if name="Type" value="StockItem" />
<invisible-if name="Type" value="Custom" />
</property>
+ <property name="HasResponseId" internal="true" />
<property name="ResponseId" label="Response Id"
glade-name="response_id"
description="The response ID to emit when this button
is clicked."
editor="Stetic.Editor.ResponseId">
@@ -326,13 +325,11 @@
</itemgroups>
</object>
- <object type="Gtk.Calendar,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.Calendar,gtk-sharp"
label="Calendar" icon="calendar.png" palette-category="widget">
- <internal-properties>
- <property name="DisplayOptions" glade-name="display_options" />
- </internal-properties>
<itemgroups>
<itemgroup label="Calendar Properties">
+ <property name="DisplayOptions" glade-name="display_options"
internal="true" />
<property name="ShowHeading" />
<property name="ShowDayNames" />
<property name="ShowWeekNumbers" />
@@ -345,27 +342,21 @@
<object type="Gtk.CheckButton,gtk-sharp"
wrapper="Stetic.Wrapper.CheckButton"
label="Check Box" icon="checkbutton.png" palette-category="widget"
hexpandable="true">
- <internal-properties>
- <property name="HasLabel" />
- </internal-properties>
- <commands>
- <command name="RemoveLabel" label="Remove Label"
- description="Remove the button's label">
- <disabled-if name="HasLabel" value="false" />
- </command>
- <command name="RestoreLabel" label="Restore Label"
- description="Restore the button's label">
- <disabled-if name="HasLabel" value="true" />
- </command>
- </commands>
<itemgroups>
<itemgroup label="Check Box Properties">
- <property name="Label" initial="Name" />
+ <property name="Label" init-with-name="true" />
<property name="Active" />
<property name="Inconsistent" />
<property name="DrawIndicator" />
- <command ref="RemoveLabel" />
- <command ref="RestoreLabel" />
+ <property name="HasLabel" internal="true" />
+ <command name="RemoveLabel" label="Remove Label"
+ description="Remove the button's label">
+ <disabled-if name="HasLabel" value="false" />
+ </command>
+ <command name="RestoreLabel" label="Restore Label"
+ description="Restore the button's label">
+ <disabled-if name="HasLabel" value="true" />
+ </command>
</itemgroup>
<itemgroup ref="Gtk.Button.Extra" />
<itemgroup ref="Gtk.Widget" />
@@ -378,15 +369,13 @@
<object type="Gtk.MenuItem,gtk-sharp" wrapper="Stetic.Wrapper.MenuItem"
label="Menu Item" icon="menuitem.png">
- <internal-properties>
- <property name="HasSubmenu" />
- </internal-properties>
<itemgroups>
<itemgroup label="Menu Item Properties">
<property name="Label" glade-name="label" label="Label"
description="The text of the menu item" />
<property name="UseUnderline" glade-name="use_underline"
label="Use Underline"
description="If set, an underline in the text
indicates the next character should be used for the mnemonic accelerator key" />
+ <property name="HasSubmenu" internal="true" />
<property name="Accelerator" editor="Stetic.Editor.Accelerator">
<disabled-if name="HasSubmenu" value="true" />
</property>
@@ -416,7 +405,7 @@
</glade-transform>
</object>
- <object type="Gtk.CheckMenuItem,gtk-sharp"
wrapper="Stetic.Wrapper.MenuItem"
+ <object type="Gtk.CheckMenuItem,gtk-sharp"
label="Check Menu Item" icon="checkmenuitem.png">
<itemgroups>
<itemgroup label="Check Menu Item Properties">
@@ -432,13 +421,11 @@
<object type="Gtk.ColorButton,gtk-sharp"
wrapper="Stetic.Wrapper.ColorButton"
label="Color Button" icon="colorbutton.png"
palette-category="widget">
- <internal-properties>
- <property name="UseAlpha" />
- </internal-properties>
<itemgroups>
<itemgroup label="Color Button Properties">
<property name="Title" />
<property name="Color" />
+ <property name="UseAlpha" internal="true" />
<property name="Alpha" min="-1" max="65535" />
</itemgroup>
<itemgroup ref="Gtk.Button.Extra" />
@@ -483,7 +470,7 @@
description="The buttons to display" />
<property name="HelpButton" label="Help Button"
description="Whether or not to display a 'Help'
button" />
- <property name="Icon" />
+ <property name="Icon" editor="Stetic.Editor.ImageFile" />
<property name="WindowPosition" />
<property name="Modal" glade-override="true" />
<property name="BorderWidth" />
@@ -503,7 +490,7 @@
</itemgroups>
</object>
- <object type="Gtk.DrawingArea,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.DrawingArea,gtk-sharp"
label="Drawing Area" icon="drawingarea.png"
palette-category="widget"
hexpandable="true" vexpandable="true">
<itemgroups>
@@ -511,7 +498,7 @@
</itemgroups>
</object>
- <object type="Gtk.Entry,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.Entry,gtk-sharp"
label="Entry" icon="entry.png" palette-category="widget"
hexpandable="true">
<itemgroups>
@@ -532,7 +519,7 @@
</itemgroups>
</object>
- <object type="Gtk.EventBox,gtk-sharp" wrapper="Stetic.Wrapper.Bin"
+ <object type="Gtk.EventBox,gtk-sharp"
label="Event Box" icon="eventbox.png" palette-category="widget">
<itemgroups>
<itemgroup label="Event Box Properties">
@@ -549,7 +536,7 @@
<itemgroups>
<itemgroup label="Expander Properties">
<property name="Expanded" />
- <property name="Label" initial="Name"/>
+ <property name="Label" init-with-name="true"/>
<property name="UseMarkup" />
<property name="UseUnderline" />
<property name="Spacing" />
@@ -592,7 +579,7 @@
</itemgroups>
</object>
- <object type="Gtk.HBox,gtk-sharp" wrapper="Stetic.Wrapper.Box"
+ <object type="Gtk.HBox,gtk-sharp"
label="HBox" icon="hbox.png" palette-category="container">
<itemgroups>
<itemgroup ref="Gtk.Box" />
@@ -601,7 +588,7 @@
<contextmenu ref="Gtk.Box" />
</object>
- <object type="Gtk.HButtonBox,gtk-sharp" wrapper="Stetic.Wrapper.Box"
+ <object type="Gtk.HButtonBox,gtk-sharp"
label="HButtonBox" icon="hbuttonbox.png"
palette-category="container"
hexpandable="true">
<itemgroups>
@@ -627,7 +614,7 @@
</glade-transform>
</object>
- <object type="Gtk.HPaned,gtk-sharp" wrapper="Stetic.Wrapper.Paned"
+ <object type="Gtk.HPaned,gtk-sharp"
label="HPaned" icon="hpaned.png" palette-category="container"
hexpandable="true">
<itemgroups>
@@ -654,7 +641,7 @@
</itemgroups>
</object>
- <object type="Gtk.HSeparator,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.HSeparator,gtk-sharp"
label="Horizontal Separator" icon="hseparator.png"
palette-category="container"
hexpandable="true">
<itemgroups>
@@ -702,7 +689,7 @@
label="Label" icon="label.png" palette-category="widget">
<itemgroups>
<itemgroup label="Label Properties">
- <property name="LabelProp" />
+ <property name="LabelProp" init-with-name="true" />
<property name="UseMarkup" />
<property name="UseUnderline" />
<property name="Wrap" />
@@ -719,22 +706,22 @@
</itemgroups>
</object>
- <object type="Gtk.MenuBar,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.MenuBar,gtk-sharp"
label="Menu Bar" icon="menubar.png" palette-category="widget">
<itemgroups>
<itemgroup ref="Gtk.Widget" important="false" />
</itemgroups>
</object>
- <object type="Gtk.Menu,gtk-sharp" wrapper="Stetic.Wrapper.Container"
+ <object type="Gtk.Menu,gtk-sharp"
label="Menu" icon="menu.png">
<itemgroups>
<itemgroup ref="Gtk.Widget" important="false" />
</itemgroups>
</object>
- <object type="Gtk.Menu+MenuChild,gtk-sharp"
wrapper="Stetic.Wrapper.Container+ContainerChild" />
+ <object type="Gtk.Menu+MenuChild,gtk-sharp" />
- <object type="Gtk.MessageDialog,gtk-sharp"
wrapper="Stetic.Wrapper.MessageDialog"
+ <object type="Stetic.MessageDialog" cname="GtkMessageDialog"
wrapper="Stetic.Wrapper.Window"
label="Message Dialog" icon="messagedialog.png"
palette-category="window">
<itemgroups>
<itemgroup label="Message Dialog Properties">
@@ -747,7 +734,7 @@
description="The secondary message text" />
<property name="Buttons" label="Buttons"
description="The buttons to offer" />
- <property name="Icon" />
+ <property name="Icon" editor="Stetic.Editor.ImageFile" />
<property name="WindowPosition" />
<property name="Modal" glade-override="true" />
<property name="BorderWidth" />
@@ -797,7 +784,7 @@
description="Insert a blank page after this one" />
</contextmenu>
</object>
- <object type="Gtk.Notebook+NotebookChild,gtk-sharp"
wrapper="Stetic.Wrapper.Container+ContainerChild">
+ <object type="Gtk.Notebook+NotebookChild,gtk-sharp">
<itemgroups>
<itemgroup label="Notebook Child Layout">
<property name="Position" />
@@ -820,7 +807,7 @@
</itemgroups>
</object>
- <object type="Gtk.ProgressBar,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.ProgressBar,gtk-sharp"
label="Progress Bar" icon="progressbar.png"
palette-category="widget"
hexpandable="true">
<itemgroups>
@@ -838,7 +825,7 @@
hexpandable="true">
<itemgroups>
<itemgroup label="Radio Button Properties">
- <property name="Label" />
+ <property name="Label" init-with-name="true" />
<property name="Group" label="Group"
description="The name of the radio button group that
this button belongs to"
editor="Stetic.Editor.GroupPicker" />
@@ -905,14 +892,14 @@
</itemgroups>
</object>
- <object type="Gtk.SeparatorMenuItem,gtk-sharp"
wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.SeparatorMenuItem,gtk-sharp"
label="Separator Menu Item" icon="hseparator.png">
<itemgroups>
<itemgroup ref="Gtk.Widget" important="false" />
</itemgroups>
</object>
- <object type="Gtk.SeparatorToolItem,gtk-sharp"
wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.SeparatorToolItem,gtk-sharp"
label="Toolbar Separator" icon="vseparator.png"
palette-category="toolbaritem">
<itemgroups>
<itemgroup label="Toolbar Separator Properties">
@@ -945,7 +932,7 @@
</itemgroups>
</object>
- <object type="Gtk.Statusbar,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.Statusbar,gtk-sharp"
label="Statusbar" icon="statusbar.png" palette-category="widget"
hexpandable="true">
<itemgroups>
@@ -1038,10 +1025,6 @@
</glade-transform>
</object>
<object type="Gtk.Table+TableChild,gtk-sharp"
wrapper="Stetic.Wrapper.Table+TableChild">
- <internal-properties>
- <property name="XOptions" />
- <property name="YOptions" />
- </internal-properties>
<itemgroups>
<itemgroup label="Table Child Layout">
<property name="TopAttach" />
@@ -1051,6 +1034,8 @@
<property name="XPadding" />
<property name="YPadding" />
<property ref="Gtk.Container+ContainerChild.AutoSize" />
+ <property name="XOptions" internal="true" />
+ <property name="YOptions" internal="true" />
<property name="XExpand" label="Expand Horizontally"
description="Whether or not the table cell should
expand horizontally">
<disabled-if name="AutoSize" value="true" />
@@ -1107,7 +1092,7 @@
</itemgroups>
</object>
- <object type="Gtk.ToggleButton,gtk-sharp" wrapper="Stetic.Wrapper.Button"
+ <object type="Gtk.ToggleButton,gtk-sharp"
label="Toggle Button" icon="togglebutton.png"
palette-category="widget">
<itemgroups>
<itemgroup label="Toggle Button Properties">
@@ -1151,13 +1136,11 @@
</itemgroups>
</object>
<object type="Gtk.Toolbar+ToolbarChild,gtk-sharp"
wrapper="Stetic.Wrapper.Toolbar+ToolbarChild">
- <internal-properties>
- <property name="ToolItem" />
- </internal-properties>
<itemgroups>
<itemgroup label="Tool Bar Child Properties">
<property name="Homogeneous" />
<property name="Expand" />
+ <property name="ToolItem" internal="true" />
<property name="ToolItem.IsImportant" />
<property name="ToolItem.VisibleHorizontal" />
<property name="ToolItem.VisibleVertical" />
@@ -1179,7 +1162,7 @@
</itemgroups>
</object>
- <object type="Gtk.TreeView,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.TreeView,gtk-sharp"
label="Tree View" icon="treeview.png" palette-category="widget"
hexpandable="true" vexpandable="true">
<itemgroups>
@@ -1198,7 +1181,7 @@
</itemgroups>
</object>
- <object type="Gtk.VBox,gtk-sharp" wrapper="Stetic.Wrapper.Box"
+ <object type="Gtk.VBox,gtk-sharp"
label="VBox" icon="vbox.png" palette-category="container">
<itemgroups>
<itemgroup ref="Gtk.Box" />
@@ -1207,7 +1190,7 @@
<contextmenu ref="Gtk.Box" />
</object>
- <object type="Gtk.VButtonBox,gtk-sharp" wrapper="Stetic.Wrapper.Box"
+ <object type="Gtk.VButtonBox,gtk-sharp"
label="VButtonBox" icon="vbuttonbox.png"
palette-category="container"
vexpandable="true">
<itemgroups>
@@ -1227,7 +1210,7 @@
</itemgroups>
</object>
- <object type="Gtk.VPaned,gtk-sharp" wrapper="Stetic.Wrapper.Paned"
+ <object type="Gtk.VPaned,gtk-sharp"
label="VPaned" icon="vpaned.png" palette-category="container"
vexpandable="true">
<itemgroups>
@@ -1254,7 +1237,7 @@
</itemgroups>
</object>
- <object type="Gtk.VSeparator,gtk-sharp" wrapper="Stetic.Wrapper.Widget"
+ <object type="Gtk.VSeparator,gtk-sharp"
label="Vertical Separator" icon="vseparator.png"
palette-category="container"
vexpandable="true">
<itemgroups>
@@ -1262,11 +1245,12 @@
</itemgroups>
</object>
- <object type="Stetic.Custom" wrapper="Stetic.Wrapper.Custom"
+ <object type="Stetic.Custom" cname="Custom"
label="Custom Widget" icon="custom.png" palette-category="widget">
<itemgroups>
<itemgroup label="Custom Widget Properties">
<property name="CreationFunction"
glade-name="creation_function" />
+ <property name="LastModificationTime"
glade-name="last_modification_time" internal="true" />
<property name="String1" glade-name="string1" />
<property name="String2" glade-name="string2" />
<property name="Int1" glade-name="int1" />
Modified: trunk/stetic/stetic/ContextMenu.cs
===================================================================
--- trunk/stetic/stetic/ContextMenu.cs 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/stetic/ContextMenu.cs 2005-07-12 13:45:21 UTC (rev 47209)
@@ -46,7 +46,7 @@
ClassDescriptor klass = Registry.LookupClass
(wrapper.Wrapped.GetType ());
if (klass != null) {
- foreach (CommandDescriptor cmd in
klass.ContextMenu.Items) {
+ foreach (CommandDescriptor cmd in
klass.ContextMenu) {
item = new MenuItem (cmd.Label);
if (cmd.Enabled (wrapper.Wrapped,
context)) {
item.Activated += delegate
(object o, EventArgs args) {
Modified: trunk/stetic/stetic/PropertyEditor.cs
===================================================================
--- trunk/stetic/stetic/PropertyEditor.cs 2005-07-12 13:42:54 UTC (rev
47208)
+++ trunk/stetic/stetic/PropertyEditor.cs 2005-07-12 13:45:21 UTC (rev
47209)
@@ -52,7 +52,7 @@
if (prop.PropertyType.IsEnum) {
editorType = typeof
(Stetic.Editor.Enumeration);
min = max = null;
- } else if (prop.PropertyType == typeof (int) &&
((int)min == -1)) {
+ } else if (prop.PropertyType == typeof (int) &&
min != null && ((int)min == -1)) {
editorType = typeof
(Stetic.Editor.OptIntRange);
min = 0;
} else {
Modified: trunk/stetic/stetic/PropertyGrid.cs
===================================================================
--- trunk/stetic/stetic/PropertyGrid.cs 2005-07-12 13:42:54 UTC (rev 47208)
+++ trunk/stetic/stetic/PropertyGrid.cs 2005-07-12 13:45:21 UTC (rev 47209)
@@ -141,16 +141,17 @@
void AppendItemGroups (ClassDescriptor klass, object obj)
{
- bool first = true;
+ int nImportantGroups = klass.ImportantGroups;
foreach (ItemGroup igroup in klass.ItemGroups) {
- AppendGroup (igroup.Label, first);
- foreach (ItemDescriptor item in igroup.Items) {
+ AppendGroup (igroup.Label, nImportantGroups-- >
0);
+ foreach (ItemDescriptor item in igroup) {
+ if (item.IsInternal)
+ continue;
if (item is PropertyDescriptor)
AppendProperty
((PropertyDescriptor)item, obj);
else if (item is CommandDescriptor)
AppendCommand
((CommandDescriptor)item, obj);
}
- first = false;
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches