本文整理汇总了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 ();
}
示例2: SetContent
public void SetContent(IWidgetBackend widget)
{
if (widget == null)
RadioButton.Content = null;
else
RadioButton.Content = widget.NativeWidget;
}
示例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 ();
}
示例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]));
}
}
示例5: SetContent
public void SetContent (IWidgetBackend widget)
{
if (widget == null)
CheckBox.Content = null;
else
CheckBox.Content = widget.NativeWidget;
}
示例6: SetChild
public void SetChild(IWidgetBackend child)
{
var w = (IGtkWidgetBackend) child;
if (alignment.Child != null)
alignment.Remove (alignment.Child);
alignment.Child = w.Widget;
}
示例7: SetContent
public void SetContent(IWidgetBackend child)
{
if (child == null)
Widget.Content = null;
else
Widget.Content = child.NativeWidget;
}
示例8: RemoveChild
public void RemoveChild(IWidgetBackend widget)
{
UIElement element = widget.NativeWidget as UIElement;
if (element == null)
throw new ArgumentException ();
Canvas.Children.Remove (element);
}
示例9: SetChild
public void SetChild (IWidgetBackend child)
{
if (alignment.Child != null) {
WidgetBackend.RemoveChildPlacement (alignment.Child);
alignment.Remove (alignment.Child);
}
alignment.Child = WidgetBackend.GetWidgetWithPlacement (child);
}
示例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);
}
示例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);
}
示例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);
};
}
示例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);
}
}
示例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 ();
}
示例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;
}
}