Esempio n. 1
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);
        }
Esempio n. 2
0
            public override void initializeWidget()
            {
                base.initializeWidget();
                label = cave.ui.LabelWidget.forText(context, labeltext);
                var color = textColor;

                if (color == null)
                {
                    if (backgroundColor.isLightColor())
                    {
                        color = cave.Color.forRGB(0, 0, 0);
                    }
                    else
                    {
                        color = cave.Color.forRGB(255, 255, 255);
                    }
                }
                label.setWidgetTextColor(color);
                addWidget((Windows.UI.Xaml.UIElement)cave.ui.CanvasWidget.forColor(context, backgroundColor));
                addWidget((Windows.UI.Xaml.UIElement)cave.ui.LayerWidget.forWidget(context, (Windows.UI.Xaml.UIElement)label, context.getHeightValue("1500um")));
            }