当前位置: 首页>>代码示例>>C#>>正文


C# IWidgetBackend类代码示例

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


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


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