Inheritance: EventBox, IDesignArea
コード例 #1
0
        internal WidgetDesignerBackend(Gtk.Container container, int designWidth, int designHeight)
        {
            ShadowType       = ShadowType.None;
            HscrollbarPolicy = PolicyType.Automatic;
            VscrollbarPolicy = PolicyType.Automatic;

            resizableFixed = new ResizableFixed();
            resizableFixed.ObjectViewer = defaultObjectViewer;

            wrapper = ObjectWrapper.Lookup(container);
            Gtk.Window window = container as Gtk.Window;

            if (window != null)
            {
                try {
                    metacityPreview = CreateMetacityPreview(window);
                    preview         = metacityPreview;
                    if (wrapper != null)
                    {
                        wrapper.Notify += OnWindowPropChange;
                    }
                } catch {
                    // If metacity is not available, use a regular box.
                    EventBox eventBox = new EventBox();
                    eventBox.Add(container);
                    preview = eventBox;
                }
            }
            else
            {
                EventBox eventBox = new EventBox();
                eventBox.Add(container);
                preview = eventBox;
            }

            resizableFixed.Put(preview, container);

            if (designWidth != -1)
            {
                preview.WidthRequest       = designWidth;
                preview.HeightRequest      = designHeight;
                resizableFixed.AllowResize = true;
            }
            else
            {
                resizableFixed.AllowResize = false;
            }

            preview.SizeAllocated += new Gtk.SizeAllocatedHandler(OnResized);

            AddWithViewport(resizableFixed);

            if (wrapper != null)
            {
                wrapper.AttachDesigner(resizableFixed);
            }

            resizableFixed.SelectionChanged += OnSelectionChanged;
        }
コード例 #2
0
ファイル: WidgetDesignerBackend.cs プロジェクト: mono/stetic
        internal WidgetDesignerBackend(Gtk.Container container, int designWidth, int designHeight)
        {
            ShadowType = ShadowType.None;
            HscrollbarPolicy = PolicyType.Automatic;
            VscrollbarPolicy = PolicyType.Automatic;

            resizableFixed = new ResizableFixed ();
            resizableFixed.ObjectViewer = defaultObjectViewer;

            wrapper = ObjectWrapper.Lookup (container);
            Gtk.Window window = container as Gtk.Window;

            if (window != null) {
                try {
                    metacityPreview = CreateMetacityPreview (window);
                    preview = metacityPreview;
                    if (wrapper != null)
                        wrapper.Notify += OnWindowPropChange;
                } catch {
                    // If metacity is not available, use a regular box.
                    EventBox eventBox = new EventBox ();
                    eventBox.Add (container);
                    preview = eventBox;
                }

            } else {
                EventBox eventBox = new EventBox ();
                eventBox.Add (container);
                preview = eventBox;
            }

            resizableFixed.Put (preview, container);

            if (designWidth != -1) {
                preview.WidthRequest = designWidth;
                preview.HeightRequest = designHeight;
                resizableFixed.AllowResize = true;
            } else {
                resizableFixed.AllowResize = false;
            }

            preview.SizeAllocated += new Gtk.SizeAllocatedHandler (OnResized);

            AddWithViewport (resizableFixed);

            if (wrapper != null)
                wrapper.AttachDesigner (resizableFixed);

            resizableFixed.SelectionChanged += OnSelectionChanged;
        }
コード例 #3
0
 protected override void OnDestroyed()
 {
     if (preview != null)
     {
         if (wrapper != null)
         {
             wrapper.DetachDesigner(resizableFixed);
         }
         preview.SizeAllocated           -= new Gtk.SizeAllocatedHandler(OnResized);
         resizableFixed.SelectionChanged -= OnSelectionChanged;
         resizableFixed = null;
         preview        = null;
         wrapper        = null;
     }
     base.OnDestroyed();
 }
コード例 #4
0
        public override void Dispose()
        {
            if (preview != null)
            {
                if (wrapper != null)
                {
                    wrapper.DetachDesigner(resizableFixed);
                }
                preview.SizeAllocated           -= new Gtk.SizeAllocatedHandler(OnResized);
                resizableFixed.SelectionChanged -= OnSelectionChanged;
//				resizableFixed.Destroy ();
                resizableFixed = null;
                preview        = null;
                wrapper        = null;
            }
            base.Dispose();
        }
コード例 #5
0
 public ObjectSelection(ResizableFixed box, Gtk.Widget widget, object dataObject)
 {
     this.box        = box;
     this.widget     = widget;
     this.dataObject = dataObject;
 }
コード例 #6
0
		public ObjectSelection (ResizableFixed box, Gtk.Widget widget, object dataObject)
		{
			this.box = box;
			this.widget = widget;
			this.dataObject = dataObject;
		}
コード例 #7
0
		protected override void OnDestroyed ()
		{
			if (preview != null) {
				if (wrapper != null)
					wrapper.DetachDesigner (resizableFixed);
				preview.SizeAllocated -= new Gtk.SizeAllocatedHandler (OnResized);
				resizableFixed.SelectionChanged -= OnSelectionChanged;
				resizableFixed = null;
				preview = null;
				wrapper = null;
			}
			base.OnDestroyed ();
		}
コード例 #8
0
ファイル: WidgetDesignerBackend.cs プロジェクト: mono/stetic
 public override void Dispose()
 {
     if (preview != null) {
         if (wrapper != null)
             wrapper.DetachDesigner (resizableFixed);
         preview.SizeAllocated -= new Gtk.SizeAllocatedHandler (OnResized);
         resizableFixed.SelectionChanged -= OnSelectionChanged;
     //				resizableFixed.Destroy ();
         resizableFixed = null;
         preview = null;
         wrapper = null;
     }
     base.Dispose ();
 }