public void Initialize (Widget container, PropertyDescriptor property, object obj) { this.container = container; layout = new Pango.Layout (container.PangoContext); layout.Width = -1; Pango.FontDescription des = container.Style.FontDescription.Copy(); layout.FontDescription = des; this.property = property; this.obj = obj; Initialize (); }
public IPropertyEditor CreateEditor (PropertyDescriptor prop) { PropertyEditorCell cell = PropertyEditorCell.GetPropertyCell (prop); cell.Initialize (this, prop, null); session = cell.StartEditing (new Gdk.Rectangle (), StateType.Normal); if (session == null) return new DummyEditor (); Gtk.Widget w = (Gtk.Widget) session.Editor as Gtk.Widget; w.ShowAll (); return session.Editor; }
public CecilPropertyDescriptor (XmlElement elem, Stetic.ItemGroup group, Stetic.ClassDescriptor klass, PropertyDescriptor prop): base (elem, group, klass) { this.name = prop.Name; this.type = prop.PropertyType; this.canWrite = prop.CanWrite; if (type.IsValueType) initialValue = Activator.CreateInstance (type); this.label = prop.Label; this.description = prop.Description; this.maximum = prop.Maximum; this.minimum = prop.Minimum; this.initWithName = prop.InitWithName; this.translatable = prop.Translatable; }
public void Initialize (Widget container, PropertyDescriptor property, object obj) { this.container = container; if (layout != null) { layout.Dispose (); } layout = new Pango.Layout (container.PangoContext); layout.Width = -1; Pango.FontDescription des = container.Style.FontDescription.Copy(); des.Size = 10 * (int) Pango.Scale.PangoScale; layout.FontDescription = des; this.property = property; this.obj = obj; Initialize (); }
public void SetData(object instance, PropertyDescriptor property, PropertyEditorCell editor) { this.instance = instance; this.property = property; if (property == null) this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal]; else this.CellBackground = null; visible = property != null ? property.VisibleFor (instance): true; sensitive = property != null ? property.EnabledFor (instance) && property.VisibleFor (instance): true; editorCell = editor; }
void AppendProperty(TreeIter piter, PropertyDescriptor prop, InstanceData idata) { TreeIter iter; if (piter.Equals (TreeIter.Zero)) iter = store.AppendValues (prop.Label, prop, false, idata); else iter = store.AppendValues (piter, prop.Label, prop, false, idata); if (prop.HasDependencies) sensitives[prop] = prop; if (prop.HasVisibility) invisibles[prop] = prop; propertyRows [prop] = store.GetStringFromIter (iter); }
protected void AppendProperty(TreeIter piter, PropertyDescriptor prop, object instance) { AppendProperty (piter, prop, new InstanceData (instance)); }
protected virtual void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) { object oval = prop.GetValue (Wrapped); if (oval == null || (prop.HasDefault && prop.IsDefaultValue (oval))) return; CodeExpression val = ctx.GenerateValue (oval, prop.RuntimePropertyType, prop.Translatable && prop.IsTranslated (Wrapped)); CodeExpression cprop; TypedPropertyDescriptor tprop = prop as TypedPropertyDescriptor; if (tprop == null || tprop.GladeProperty == prop) { cprop = new CodePropertyReferenceExpression (var, prop.Name); } else { cprop = new CodePropertyReferenceExpression (var, tprop.GladeProperty.Name); cprop = new CodePropertyReferenceExpression (cprop, prop.Name); } ctx.Statements.Add (new CodeAssignStatement (cprop, val)); }
public EditSession (Gtk.Widget container, object instance, PropertyDescriptor property, IPropertyEditor currentEditor) { this.property = property; this.obj = instance; this.container = container; this.currentEditor = currentEditor; currentEditor.ValueChanged += OnValueChanged; initialVal = currentEditor.Value; }
public void Initialize (PropertyDescriptor property) { this.property = property; }
public static PropertyEditorCell GetPropertyCell (PropertyDescriptor property) { Type editorType = property.EditorType; if (editorType == null) editorType = GetEditorForType (property.PropertyType); if (editorType == null) return Default; if (typeof(IPropertyEditor).IsAssignableFrom (editorType)) { if (!typeof(Gtk.Widget).IsAssignableFrom (editorType)) throw new Exception ("The property editor '" + editorType + "' must be a Gtk Widget"); return Default; } PropertyEditorCell cell = (PropertyEditorCell) cellCache [editorType]; if (cell != null) return cell; if (!typeof(PropertyEditorCell).IsAssignableFrom (editorType)) throw new Exception ("The property editor '" + editorType + "' must be a subclass of Stetic.PropertyEditorCell or implement Stetic.IPropertyEditor"); cell = (PropertyEditorCell) Activator.CreateInstance (editorType); cellCache [editorType] = cell; return cell; }
public void Initialize (PropertyDescriptor prop) { Text = "(" + prop.PropertyType.Name + ")"; }
public PropertyEditor (PropertyDescriptor prop) : base (false, 0) { propEditor = CreateEditor (prop); Add ((Gtk.Widget) propEditor); }
public PropertyGridHeader () { name = (PropertyDescriptor)Registry.LookupClassByName ("Gtk.Widget") ["Name"]; AppendProperty (name); Gtk.HBox box = new Gtk.HBox (false, 6); image = new Gtk.Image (); box.PackStart (image, false, false, 0); label = new Gtk.Label (); box.PackStart (label, false, false, 0); box.ShowAll (); AppendPair ("Widget Class", box, null); }
protected void AppendProperty (PropertyDescriptor prop) { PropertyEditor rep = new PropertyEditor (prop); // FIXME: Make sure all notify events are based on prop names, not propspec editors[prop.Name] = rep; AppendPair (prop.Label, rep, prop.Description); rep.ShowAll (); if (prop.HasDependencies) sensitives[prop] = prop; if (prop.HasVisibility) invisibles[prop] = prop; }