Exemplo n.º 1
0
        public void AddTopLevelWidget(Gtk.Widget widget, int x, int y)
        {
            widget.Parent = this;
            EditorContainerChild info = new EditorContainerChild(this, widget);

            info.X = x;
            info.Y = y;
            containerChildren.Add(info);
        }
Exemplo n.º 2
0
        public void AddTopLevelWidget(Widget widget, int x, int y)
        {
            base.AddChild(widget);
            var info = new EditorContainerChild(this, widget);

            info.X = x;
            info.Y = y;
            containerChildren.Add(info);
            SetAdjustments();
        }
Exemplo n.º 3
0
        public void MoveToTop(Gtk.Widget widget)
        {
            EditorContainerChild editorContainerChild = containerChildren.FirstOrDefault(c => c.Child == widget);

            if (editorContainerChild == null)
            {
                throw new Exception("child " + widget + " not found.");
            }
            List <EditorContainerChild> newChilds = new List <EditorContainerChild> (containerChildren.Where(child => child != editorContainerChild));

            newChilds.Add(editorContainerChild);
            this.containerChildren = newChilds;
            widget.GdkWindow.Raise();
        }
Exemplo n.º 4
0
        public void AddTopLevelWidget(Gtk.Widget widget, int x, int y)
        {
            widget.Parent = this;
            EditorContainerChild info = new EditorContainerChild(this, widget);

            info.X = x;
            info.Y = y;
            containerChildren.Add(info);
            SetAdjustments();

            // Emit the add signal so that the A11y system will pick up that a widget has been added to the box
            // but the box won't handle it because widget.Parent has already been set.
            GtkWorkarounds.EmitAddSignal(this, widget);
        }
Exemplo n.º 5
0
        void ResizeChild(Rectangle allocation, EditorContainerChild child)
        {
            Requisition req            = child.Child.SizeRequest();
            var         childRectangle = new Gdk.Rectangle(Allocation.X + child.X, Allocation.Y + child.Y, System.Math.Max(1, req.Width), System.Math.Max(1, req.Height));

            if (!child.FixedPosition)
            {
                double zoom = Options.Zoom;
                childRectangle.X = Allocation.X + (int)(child.X * zoom - HAdjustment.Value);
                childRectangle.Y = Allocation.Y + (int)(child.Y * zoom - VAdjustment.Value);
            }
            //			childRectangle.X += allocation.X;
            //			childRectangle.Y += allocation.Y;
            child.Child.SizeAllocate(childRectangle);
        }
Exemplo n.º 6
0
        void ResizeChild(Rectangle allocation, EditorContainerChild child)
        {
            var req            = child.Child.Surface.GetPreferredSize();
            var childRectangle = new Xwt.Rectangle(Bounds.X + child.X, Bounds.Y + child.Y, req.Width, req.Height);

            if (!child.FixedPosition)
            {
                double zoom = Options.Zoom;
                childRectangle.X = Bounds.X + (int)(child.X * zoom - HAdjustment.Value);
                childRectangle.Y = Bounds.Y + (int)(child.Y * zoom - VAdjustment.Value);
            }
            //			childRectangle.X += allocation.X;
            //			childRectangle.Y += allocation.Y;
            SetChildBounds(child.Child, childRectangle);
        }
Exemplo n.º 7
0
        void ResizeChild(Rectangle allocation, EditorContainerChild child)
        {
            Requisition req            = child.Child.SizeRequest();
            var         childRectangle = new Gdk.Rectangle(child.X, child.Y, req.Width, req.Height);

            if (!child.FixedPosition)
            {
                double zoom = textEditorWidget.Options.Zoom;
                childRectangle.X = (int)(child.X * zoom - textEditorWidget.HAdjustment.Value);
                childRectangle.Y = (int)(child.Y * zoom - textEditorWidget.VAdjustment.Value);
            }
//			childRectangle.X += allocation.X;
//			childRectangle.Y += allocation.Y;
            child.Child.SizeAllocate(childRectangle);
        }
Exemplo n.º 8
0
        internal void AddAnimatedWidget(Widget widget, uint duration, Easing easing, Blocking blocking, int x, int y)
        {
            AnimatedWidget animated_widget = new AnimatedWidget(widget, duration, easing, blocking, false);

            animated_widget.Parent           = this;
            animated_widget.WidgetDestroyed += OnWidgetDestroyed;
            stage.Add(animated_widget, duration);
            animated_widget.StartPadding = 0;
            animated_widget.EndPadding   = widget.Allocation.Height;
            //			animated_widget.Node = animated_widget;

            EditorContainerChild info = new EditorContainerChild(this, animated_widget);

            info.X             = x;
            info.Y             = y;
            info.FixedPosition = true;
            containerChildren.Add(info);
        }
Exemplo n.º 9
0
		public void AddAnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, int x, int y)
		{
			AnimatedWidget animated_widget = new AnimatedWidget (widget, duration, easing, blocking, false);
			animated_widget.Parent = this;
			animated_widget.WidgetDestroyed += OnWidgetDestroyed;
			stage.Add (animated_widget, duration);
			animated_widget.StartPadding = 0;
			animated_widget.EndPadding = widget.Allocation.Height;
//			animated_widget.Node = animated_widget;
			
			EditorContainerChild info = new EditorContainerChild (this, animated_widget);
			info.X = x;
			info.Y = y;
			info.FixedPosition = true;
			containerChildren.Add (info);

//			RecalculateSpacings ();
		}
Exemplo n.º 10
0
		public void AddTopLevelWidget (Gtk.Widget widget, int x, int y)
		{
			widget.Parent = this;
			EditorContainerChild info = new EditorContainerChild (this, widget);
			info.X = x;
			info.Y = y;
			containerChildren.Add (info);
		}
Exemplo n.º 11
0
		void ResizeChild (Rectangle allocation, EditorContainerChild child)
		{
			Requisition req = child.Child.SizeRequest ();
			var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height);
			if (!child.FixedPosition) {
				double zoom = textEditorWidget.Options.Zoom;
				childRectangle.X = (int)(child.X * zoom - textEditorWidget.HAdjustment.Value);
				childRectangle.Y = (int)(child.Y * zoom - textEditorWidget.VAdjustment.Value);
			}
			childRectangle.X += allocation.X;
			childRectangle.Y += allocation.Y;
			child.Child.SizeAllocate (childRectangle);
		}