コード例 #1
0
ファイル: ImageSelector.cs プロジェクト: noah1510/dotdevelop
        protected override void Initialize()
        {
            base.Initialize();

            if (Property.PropertyType != typeof(ImageInfo))
            {
                throw new ApplicationException("ImageSelector editor does not support editing values of type " + Property.PropertyType);
            }

            if (Instance == null)
            {
                return;
            }

            Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup(Instance);
            project   = w.Project;
            imageInfo = (ImageInfo)Value;
            if (imageInfo != null)
            {
                Image = imageInfo.GetThumbnail(project, ImageSize);
            }
            else
            {
                Image = null;
            }
        }
コード例 #2
0
ファイル: EditIconDialog.cs プロジェクト: orf53975/stetic
 protected void OnSelectImage(object s, EventArgs args)
 {
     using (SelectImageDialog dlg = new SelectImageDialog(dialog, project)) {
         if (dlg.Run() == (int)Gtk.ResponseType.Ok)
         {
             singleIcon        = dlg.Icon;
             imageLabel.Text   = singleIcon.Label;
             imageImage.Pixbuf = singleIcon.GetThumbnail(project, 16);
             UpdateButtons();
         }
     }
 }
コード例 #3
0
ファイル: ImageSelector.cs プロジェクト: Kalnor/monodevelop
		protected override void Initialize ()
		{
			base.Initialize ();
			
			if (Property.PropertyType != typeof(ImageInfo))
				throw new ApplicationException ("ImageSelector editor does not support editing values of type " + Property.PropertyType);
			
			if (Instance == null)
				return;

			Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (Instance);
			project = w.Project;
			imageInfo = (ImageInfo)Value;
			if (imageInfo != null)
				Image = imageInfo.GetThumbnail (project, ImageSize);
			else
				Image = null;
		}
コード例 #4
0
ファイル: EditIconDialog.cs プロジェクト: orf53975/stetic
        public EditIconDialog(IProject project, ProjectIconSet iconSet)
        {
            Glade.XML xml = new Glade.XML(null, "stetic.glade", "EditIconDialog", null);
            xml.Autoconnect(this);
            dialog.Response += OnResponse;

            this.project = project;
            this.iconSet = iconSet;

            nameEntry.Text = iconSet.Name;

            if (iconSet.Sources.Count == 0)
            {
                radioSingle.Active = true;
                imageLabel.Text    = "";
            }
            else if (iconSet.Sources.Count == 1 && iconSet.Sources[0].AllWildcarded)
            {
                radioSingle.Active = true;
                singleIcon         = iconSet.Sources[0].Image;
                if (singleIcon != null)
                {
                    imageLabel.Text   = singleIcon.Label;
                    imageImage.Pixbuf = singleIcon.GetThumbnail(project, 16);
                }
                else
                {
                    imageLabel.Text = "";
                }
            }
            else
            {
                radioMultiple.Active = true;
            }

            hboxSingle.Sensitive   = radioSingle.Active;
            hboxMultiple.Sensitive = !radioSingle.Active;

            // Build the tree

            sourceListStore  = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object));
            sourceList.Model = sourceListStore;

            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();

            Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf();
            col.Title = Catalog.GetString("Image");
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 0);

            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", 1);
            sourceList.AppendColumn(col);

            col        = new Gtk.TreeViewColumn();
            col.Expand = true;
            col.Title  = Catalog.GetString("Size");
            CellRendererComboBox crtb = new CellRendererComboBox();

            crtb.Changed += new ComboSelectionChangedHandler(OnSizeComboChanged);
            crtb.Values   = sizes;
            col.PackStart(crtb, true);
            col.AddAttribute(crtb, "text", 2);
            sourceList.AppendColumn(col);

            col           = new Gtk.TreeViewColumn();
            col.Expand    = true;
            col.Title     = Catalog.GetString("State");
            crtb          = new CellRendererComboBox();
            crtb.Changed += new ComboSelectionChangedHandler(OnStateComboChanged);
            crtb.Values   = states;
            col.PackStart(crtb, true);
            col.AddAttribute(crtb, "text", 3);
            sourceList.AppendColumn(col);

            col           = new Gtk.TreeViewColumn();
            col.Expand    = true;
            col.Title     = Catalog.GetString("Direction");
            crtb          = new CellRendererComboBox();
            crtb.Changed += new ComboSelectionChangedHandler(OnDirComboChanged);
            crtb.Values   = directions;
            col.PackStart(crtb, true);
            col.AddAttribute(crtb, "text", 4);
            sourceList.AppendColumn(col);

            foreach (ProjectIconSource source in iconSet.Sources)
            {
                AddSource(source);
            }

            UpdateButtons();
        }
コード例 #5
0
ファイル: EditIconDialog.cs プロジェクト: mono/stetic
        public EditIconDialog(IProject project, ProjectIconSet iconSet)
        {
            Glade.XML xml = new Glade.XML (null, "stetic.glade", "EditIconDialog", null);
            xml.Autoconnect (this);
            dialog.Response += OnResponse;

            this.project = project;
            this.iconSet = iconSet;

            nameEntry.Text = iconSet.Name;

            if (iconSet.Sources.Count == 0) {
                radioSingle.Active = true;
                imageLabel.Text = "";
            }
            else if (iconSet.Sources.Count == 1 && iconSet.Sources[0].AllWildcarded) {
                radioSingle.Active = true;
                singleIcon = iconSet.Sources[0].Image;
                if (singleIcon != null) {
                    imageLabel.Text = singleIcon.Label;
                    imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16);
                } else
                    imageLabel.Text = "";
            } else {
                radioMultiple.Active = true;
            }

            hboxSingle.Sensitive = radioSingle.Active;
            hboxMultiple.Sensitive = !radioSingle.Active;

            // Build the tree

            sourceListStore = new Gtk.ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object));
            sourceList.Model = sourceListStore;

            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();

            Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf ();
            col.Title = Catalog.GetString ("Image");
            col.PackStart (pr, false);
            col.AddAttribute (pr, "pixbuf", 0);

            Gtk.CellRendererText crt = new Gtk.CellRendererText ();
            col.PackStart (crt, true);
            col.AddAttribute (crt, "text", 1);
            sourceList.AppendColumn (col);

            col = new Gtk.TreeViewColumn ();
            col.Expand = true;
            col.Title = Catalog.GetString ("Size");
            CellRendererComboBox crtb = new CellRendererComboBox ();
            crtb.Changed += new ComboSelectionChangedHandler (OnSizeComboChanged);
            crtb.Values = sizes;
            col.PackStart (crtb, true);
            col.AddAttribute (crtb, "text", 2);
            sourceList.AppendColumn (col);

            col = new Gtk.TreeViewColumn ();
            col.Expand = true;
            col.Title = Catalog.GetString ("State");
            crtb = new CellRendererComboBox ();
            crtb.Changed += new ComboSelectionChangedHandler (OnStateComboChanged);
            crtb.Values = states;
            col.PackStart (crtb, true);
            col.AddAttribute (crtb, "text", 3);
            sourceList.AppendColumn (col);

            col = new Gtk.TreeViewColumn ();
            col.Expand = true;
            col.Title = Catalog.GetString ("Direction");
            crtb = new CellRendererComboBox ();
            crtb.Changed += new ComboSelectionChangedHandler (OnDirComboChanged);
            crtb.Values = directions;
            col.PackStart (crtb, true);
            col.AddAttribute (crtb, "text", 4);
            sourceList.AppendColumn (col);

            foreach (ProjectIconSource source in iconSet.Sources)
                AddSource (source);

            UpdateButtons ();
        }
コード例 #6
0
ファイル: EditIconDialog.cs プロジェクト: mono/stetic
 protected void OnSelectImage(object s, EventArgs args)
 {
     using (SelectImageDialog dlg = new SelectImageDialog (dialog, project)) {
         if (dlg.Run () == (int) Gtk.ResponseType.Ok) {
             singleIcon = dlg.Icon;
             imageLabel.Text = singleIcon.Label;
             imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16);
             UpdateButtons ();
         }
     }
 }