• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IWidgetBackend类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IWidgetBackend的典型用法代码示例。如果您正苦于以下问题:C# IWidgetBackend类的具体用法?C# IWidgetBackend怎么用?C# IWidgetBackend使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IWidgetBackend类属于命名空间,在下文中一共展示了IWidgetBackend类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetChildBounds

        public void SetChildBounds(IWidgetBackend widget, Rectangle bounds)
        {
            FrameworkElement element = widget.NativeWidget as FrameworkElement;
            if (element == null)
                throw new ArgumentException ();

            SWC.Canvas.SetTop (element, bounds.Top);
            SWC.Canvas.SetLeft (element, bounds.Left);

            // We substract the widget margin here because the size we are assigning is the actual size, not including the WPF marings
            var h = bounds.Height - ((WidgetBackend)widget).Frontend.Margin.VerticalSpacing;
            var w = bounds.Width - ((WidgetBackend)widget).Frontend.Margin.HorizontalSpacing;

            h = (h > 0) ? h : 0;
            w = (w > 0) ? w : 0;

            // Measure the widget again using the allocation constraints. This is necessary
            // because WPF widgets my cache some measurement information based on the
            // constraints provided in the last Measure call (which when calculating the
            // preferred size is normally set to infinite.
            element.InvalidateMeasure ();
            element.Measure (new System.Windows.Size (w, h));
            element.Height = h;
            element.Width = w;
            element.UpdateLayout ();
        }
开发者ID:jbeaurain,项目名称:xwt,代码行数:26,代码来源:CanvasBackend.cs


示例2: SetContent

		public void SetContent(IWidgetBackend widget)
		{
			if (widget == null)
				RadioButton.Content = null;
			else
				RadioButton.Content = widget.NativeWidget;
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:RadioButtonBackend.cs


示例3: SetChildBounds

        public void SetChildBounds(IWidgetBackend widget, Rectangle bounds)
        {
            FrameworkElement element = widget.NativeWidget as FrameworkElement;
            if (element == null)
                throw new ArgumentException ();

            SWC.Canvas.SetTop (element, bounds.Top);
            SWC.Canvas.SetLeft (element, bounds.Left);

            var h = bounds.Height;
            var w = bounds.Width;

            h = (h > 0) ? h : 0;
            w = (w > 0) ? w : 0;

            // Measure the widget again using the allocation constraints. This is necessary
            // because WPF widgets my cache some measurement information based on the
            // constraints provided in the last Measure call (which when calculating the
            // preferred size is normally set to infinite.
            element.InvalidateMeasure ();
            element.Measure (new System.Windows.Size (w, h));
            element.Height = h;
            element.Width = w;
            element.UpdateLayout ();
        }
开发者ID:neiz,项目名称:xwt,代码行数:25,代码来源:CanvasBackend.cs


示例4: SetAllocation

 public void SetAllocation(IWidgetBackend [] widget, Rectangle [] rect)
 {
     for (int i = 0; i < widget.Length; i++) {
         var e = GetFrameworkElement (widget [i]);
         e.Arrange (DataConverter.ToWpfRect (rect [i]));
     }
 }
开发者ID:pixelmeister,项目名称:xwt,代码行数:7,代码来源:BoxBackend.cs


示例5: SetContent

		public void SetContent (IWidgetBackend widget)
		{
			if (widget == null)
				CheckBox.Content = null;
			else
				CheckBox.Content = widget.NativeWidget;
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:CheckBoxBackend.cs


示例6: SetChild

 public void SetChild(IWidgetBackend child)
 {
     var w = (IGtkWidgetBackend) child;
     if (alignment.Child != null)
         alignment.Remove (alignment.Child);
     alignment.Child = w.Widget;
 }
开发者ID:pabloescribano,项目名称:xwt,代码行数:7,代码来源:WindowBackend.cs


示例7: SetContent

		public void SetContent(IWidgetBackend child)
		{
			if (child == null)
				Widget.Content = null;
			else
				Widget.Content = child.NativeWidget;
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:ExpanderBackend.cs


示例8: RemoveChild

        public void RemoveChild(IWidgetBackend widget)
        {
            UIElement element = widget.NativeWidget as UIElement;
            if (element == null)
                throw new ArgumentException ();

            Canvas.Children.Remove (element);
        }
开发者ID:samclarke,项目名称:xwt,代码行数:8,代码来源:CanvasBackend.cs


示例9: SetChild

		public void SetChild (IWidgetBackend child)
		{
			if (alignment.Child != null) {
				WidgetBackend.RemoveChildPlacement (alignment.Child);
				alignment.Remove (alignment.Child);
			}
			alignment.Child = WidgetBackend.GetWidgetWithPlacement (child);
		}
开发者ID:m13253,项目名称:xwt,代码行数:8,代码来源:WindowBackend.cs


示例10: SetChild

        public void SetChild(IWidgetBackend child)
        {
            if (widget != null)
                rootPanel.Children.Remove(widget);
            widget = ((IWpfWidgetBackend)child).Widget;

            DockPanel.SetDock (widget, Dock.Bottom);
            rootPanel.Children.Add(widget);
        }
开发者ID:chkn,项目名称:xwt,代码行数:9,代码来源:WindowBackend.cs


示例11: SetContent

 public void SetContent(IWidgetBackend widget)
 {
     var newWidget = GetWidget (widget);
     var oldWidget = Widget.Child;
     if (oldWidget == null)
         Widget.Child = newWidget;
     else
         GtkEngine.ReplaceChild (oldWidget, newWidget);
 }
开发者ID:JohnACarruthers,项目名称:xwt,代码行数:9,代码来源:CustomWidgetBackend.cs


示例12: Init

 public void Init(IWindowFrameBackend parent, IWidgetBackend child, Xwt.Popover.Position orientation)
 {
     popover = new PopoverWindow ((Gtk.Widget)child.NativeWidget, orientation);
     popover.TransientFor = ((WindowFrameBackend)parent).Window;
     popover.DestroyWithParent = true;
     popover.Hidden += (o, args) => {
         if (Closed != null)
             Closed (this, EventArgs.Empty);
     };
 }
开发者ID:silwol,项目名称:xwt,代码行数:10,代码来源:PopoverBackend.cs


示例13: SetPanel

		public void SetPanel (int panel, IWidgetBackend widget, bool resize, bool shrink)
		{
			if (panel == 1) {
				RemoveChildPlacement (Widget.Child1);
				Widget.Pack1 (GetWidgetWithPlacement (widget), resize, shrink);
			} else {
				RemoveChildPlacement (Widget.Child2);
				Widget.Pack2 (GetWidgetWithPlacement (widget), resize, shrink);
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:10,代码来源:PanedBackend.cs


示例14: SetAllocation

 public void SetAllocation(IWidgetBackend[] widgets, Rectangle[] rects)
 {
     bool changed = false;
     for (int n=0; n<widgets.Length; n++) {
         var w = GetWidget (widgets[n]);
         if (Widget.SetAllocation (w, rects[n]))
             changed = true;
     }
     if (changed && !Widget.IsReallocating)
         Widget.QueueResize ();
 }
开发者ID:RevolutionSmythe,项目名称:xwt,代码行数:11,代码来源:BoxBackend.cs


示例15: SetContent

		public void SetContent (IWidgetBackend widget)
		{
			if (widget != null) {
				child = (Widget)((WidgetBackend)widget).Frontend;
				UserControl.Content = widget.NativeWidget;
			}
			else {
				child = null;
				UserControl.Content = null;
			}
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:11,代码来源:CustomWidgetBackend.cs


示例16: Run

 public void Run(IWidgetBackend referenceWidget)
 {
     var reference = ((WidgetBackend)referenceWidget).Frontend;
     var position = new Point (reference.ScreenBounds.Center.X, popover.ArrowPosition == Popover.Position.Top ? reference.ScreenBounds.Bottom : reference.ScreenBounds.Top);
     popover.ShowAll ();
     popover.GrabFocus ();
     int w, h;
     popover.GetSize (out w, out h);
     popover.Move ((int)position.X - w / 2, (int)position.Y);
     popover.SizeAllocated += (o, args) => { popover.Move ((int)position.X - args.Allocation.Width / 2, (int)position.Y); popover.GrabFocus (); };
 }
开发者ID:silwol,项目名称:xwt,代码行数:11,代码来源:PopoverBackend.cs


示例17: AddChild

		public void AddChild (IWidgetBackend widget, Rectangle bounds)
		{
			UIElement element = widget.NativeWidget as UIElement;
			if (element == null)
				throw new ArgumentException ();

			if (!Canvas.Children.Contains (element))
				Canvas.Children.Add (element);

			SetChildBounds (widget, bounds);
		}
开发者ID:m13253,项目名称:xwt,代码行数:11,代码来源:CanvasBackend.cs


示例18: SetChildBounds

		public void SetChildBounds (IWidgetBackend widget, Rectangle bounds)
		{
			int i = children.IndexOf (widget);
			if (i == -1) {
				children.Add (widget);
				childrenBounds.Add (bounds);
			}
			else {
				childrenBounds[i] = bounds;
			}
			Canvas.SetAllocation (children.ToArray (), childrenBounds.ToArray ());
		}
开发者ID:m13253,项目名称:xwt,代码行数:12,代码来源:CanvasBackend.cs


示例19: SetHeaderContent

		public void SetHeaderContent (IWidgetBackend backend)
		{
			if (toolbar.Child != null) {
				WidgetBackend.RemoveChildPlacement (toolbar.Child);
				toolbar.Remove (toolbar.Child);
			}
			if (backend != null) {
				toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend);
				toolbar.Show ();
			} else {
				toolbar.Hide ();
			}
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:13,代码来源:IExtendedTitleBarWindowBackend.cs


示例20: RemoveChild

        public void RemoveChild(IWidgetBackend widget)
        {
            UIElement element = widget.NativeWidget as UIElement;
            if (element == null)
                throw new ArgumentException ();

            Canvas.Children.Remove (element);
            int i = children.IndexOf (widget);
            if (i != -1) {
                children.RemoveAt (i);
                childrenBounds.RemoveAt (i);
            }
        }
开发者ID:henriquemotaesteves,项目名称:xwt,代码行数:13,代码来源:CanvasBackend.cs



注:本文中的IWidgetBackend类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWin32Window类代码示例发布时间:2022-05-24
下一篇:
C# IWidget类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap