Example #1
0
        protected override XmlElement WriteProperties(ObjectWriter writer)
        {
            XmlElement elem = base.WriteProperties(writer);

            if (imageInfo != null)
            {
                if (writer.Format == FileFormat.Glade)
                {
                    // The generated pixbuf property doesn't have a valid value, it needs to be replaced.
                    GladeUtils.ExtractProperty(elem, "pixbuf", "");
                    switch (imageInfo.Source)
                    {
                    case ImageSource.File:
                        GladeUtils.SetProperty(elem, "pixbuf", imageInfo.Name);
                        break;

                    case ImageSource.Theme:
                        GladeUtils.SetProperty(elem, "stock", imageInfo.Name);
                        GladeUtils.SetProperty(elem, "icon_size", ((int)imageInfo.ThemeIconSize).ToString());
                        break;

                    default:
                        throw new System.NotSupportedException("Image source not supported by Glade.");
                    }
                }
            }
            return(elem);
        }
Example #2
0
        protected override XmlElement WriteProperties(ObjectWriter writer)
        {
            XmlElement elem = base.WriteProperties(writer);

            if (type != ButtonType.StockItem && imageInfo != null)
            {
                if (writer.Format == FileFormat.Glade)
                {
                    switch (imageInfo.Source)
                    {
                    case ImageSource.File:
                        GladeUtils.SetProperty(elem, "icon", imageInfo.Name);
                        break;

                    case ImageSource.Theme:
                        GladeUtils.SetProperty(elem, "stock_id", imageInfo.Name);
                        break;

                    default:
                        throw new System.NotSupportedException("Image source not supported by Glade.");
                    }
                }
            }
            return(elem);
        }
Example #3
0
        protected override XmlElement WriteProperties(ObjectWriter writer)
        {
            XmlElement elem = base.WriteProperties(writer);

            if (Type == ButtonType.StockItem)
            {
                GladeUtils.SetProperty(elem, "label", stockId);
            }
            return(elem);
        }
        protected override XmlElement WriteProperties(ObjectWriter writer)
        {
            XmlElement elem  = base.WriteProperties(writer);
            string     group = GroupManager.GladeGroupName(Wrapped);

            if (group != Wrapped.Name)
            {
                GladeUtils.SetProperty(elem, "group", group);
            }
            return(elem);
        }