Ejemplo n.º 1
0
        public override void initializeWidget()
        {
            base.initializeWidget();
            var wc = determineBackgroundColor();

            addWidget((Windows.UI.Xaml.UIElement)cave.ui.CanvasWidget.forColor(context, wc));
            var vbox = cave.ui.VerticalBoxWidget.forContext(context, 0);

            if (cape.Vector.isEmpty(widgetItems) == false)
            {
                if (widgetItems != null)
                {
                    var n = 0;
                    var m = widgetItems.Count;
                    for (n = 0; n < m; n++)
                    {
                        var item = widgetItems[n];
                        if (item != null)
                        {
                            vbox.addWidget(item);
                        }
                    }
                }
            }
            var tml = new cave.ui.TopMarginLayerWidget(context);

            tml.addWidget((Windows.UI.Xaml.UIElement)cave.ui.LayerWidget.forWidgetAndWidth(context, (Windows.UI.Xaml.UIElement)vbox, context.getWidthValue("50mm")));
            applyScroller((Windows.UI.Xaml.UIElement)tml);
        }
Ejemplo n.º 2
0
        public override void initializeWidget()
        {
            base.initializeWidget();
            var bgc = widgetBackgroundColor;

            if (bgc != null)
            {
                canvas = cave.ui.CanvasWidget.forColor(context, bgc);
                addWidget((Windows.UI.Xaml.UIElement)canvas);
            }
            var tml = new cave.ui.TopMarginLayerWidget(context);

            label = cave.ui.LabelWidget.forText(context, widgetTitle);
            label.setWidgetFontFamily("Arial");
            var wtc = getWidgetTextColor();

            label.setWidgetTextColor(wtc);
            box = cave.ui.HorizontalBoxWidget.forContext(context);
            box.setWidgetMargin(context.getWidthValue("1mm"));
            box.setWidgetSpacing(context.getWidthValue("1mm"));
            leftButton = new cave.ui.ImageButtonWidget(context);
            leftButton.setWidgetButtonHeight(context.getHeightValue("6mm"));
            box.addWidget((Windows.UI.Xaml.UIElement)leftButton);
            updateLeftButton();
            widgetTitleContainer = cave.ui.AlignWidget.forWidget(context, (Windows.UI.Xaml.UIElement)label, 0.50, 0.50);
            box.addWidget((Windows.UI.Xaml.UIElement)widgetTitleContainer, 1.00);
            var spacing = widgetMenuItemSpacing;

            if (spacing < 0)
            {
                spacing = context.getWidthValue("1mm");
            }
            menuItems = cave.ui.HorizontalBoxWidget.forContext(context, context.getWidthValue("1mm"), spacing);
            box.addWidget((Windows.UI.Xaml.UIElement)menuItems);
            rightButton = new cave.ui.ImageButtonWidget(context);
            rightButton.setWidgetButtonHeight(context.getHeightValue("6mm"));
            box.addWidget((Windows.UI.Xaml.UIElement)rightButton);
            updateRightButton();
            tml.addWidget((Windows.UI.Xaml.UIElement)box);
            overlayWidget = new cave.ui.LayerWidget(context);
            tml.addWidget((Windows.UI.Xaml.UIElement)overlayWidget);
            addWidget((Windows.UI.Xaml.UIElement)tml);
        }