コード例 #1
0
        private void Load(PrintItemWrapper printItem)
        {
            tabControl = new TabControl();
            tabControl.TabBar.BorderColor = new RGBA_Bytes(0, 0, 0, 0);

            tabControl.TabBar.Padding = new BorderDouble(top: 6);

            RGBA_Bytes selectedTabColor;

            if (ActiveTheme.Instance.DisplayMode == ActiveTheme.ApplicationDisplayType.Responsive)
            {
                tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
                selectedTabColor = ActiveTheme.Instance.TabLabelSelected;
            }
            else
            {
                tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.TransparentLightOverlay;
                selectedTabColor = ActiveTheme.Instance.SecondaryAccentColor;
            }

            double buildHeight = ActiveSliceSettings.Instance.BuildHeight;

            // put in the 3D view
            string part3DViewLabelFull = string.Format("{0} {1} ", "3D", "View".Localize()).ToUpper();

            partPreviewView = new View3DWidget(printItem,
                                               new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight),
                                               ActiveSliceSettings.Instance.BedCenter,
                                               ActiveSliceSettings.Instance.BedShape,
                                               windowMode,
                                               autoRotate3DView,
                                               openMode);

            TabPage partPreview3DView = new TabPage(partPreviewView, part3DViewLabelFull);

            // put in the gcode view
            ViewGcodeBasic.WindowMode gcodeWindowMode = ViewGcodeBasic.WindowMode.Embeded;
            if (windowMode == View3DWidget.WindowMode.StandAlone)
            {
                gcodeWindowMode = ViewGcodeBasic.WindowMode.StandAlone;
            }

            viewGcodeBasic = new ViewGcodeBasic(printItem,
                                                new Vector3(ActiveSliceSettings.Instance.BedSize, buildHeight),
                                                ActiveSliceSettings.Instance.BedCenter,
                                                ActiveSliceSettings.Instance.BedShape, gcodeWindowMode);

            if (windowMode == View3DWidget.WindowMode.StandAlone)
            {
                partPreviewView.Closed += (sender, e) =>
                {
                    Close();
                };
                viewGcodeBasic.Closed += (sender, e) =>
                {
                    Close();
                };
            }

            layerView = new TabPage(viewGcodeBasic, LocalizedString.Get("Layer View").ToUpper());

            int tabPointSize = 16;
            // add the correct tabs based on wether we are stand alone or embeded
            Tab threeDViewTab;
            Tab layerViewTab;

            if (windowMode == View3DWidget.WindowMode.StandAlone || OsInformation.OperatingSystem == OSType.Android)
            {
                threeDViewTab = new SimpleTextTabWidget(partPreview3DView, "3D View Tab", tabPointSize,
                                                        selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(threeDViewTab);
                layerViewTab = new SimpleTextTabWidget(layerView, "Layer View Tab", tabPointSize,
                                                       selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(layerViewTab);
            }
            else
            {
                threeDViewTab = new PopOutTextTabWidget(partPreview3DView, "3D View Tab", new Vector2(590, 400), tabPointSize);
                tabControl.AddTab(threeDViewTab);
                layerViewTab = new PopOutTextTabWidget(layerView, "Layer View Tab", new Vector2(590, 400), tabPointSize);
                tabControl.AddTab(layerViewTab);
            }

            threeDViewTab.ToolTipText = "Preview 3D Design".Localize();
            layerViewTab.ToolTipText  = "Preview layer Tool Paths".Localize();

            this.AddChild(tabControl);
        }
コード例 #2
0
        private void Load(PrintItemWrapper printItem)
        {
            tabControl = new TabControl();
            tabControl.TabBar.BorderColor = new RGBA_Bytes(0, 0, 0, 0);

            tabControl.TabBar.Padding = new BorderDouble(top: 6);

            RGBA_Bytes selectedTabColor;

            if (UserSettings.Instance.DisplayMode == ApplicationDisplayType.Responsive)
            {
                tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
                selectedTabColor = ActiveTheme.Instance.TabLabelSelected;
            }
            else
            {
                tabControl.TabBar.BackgroundColor = ActiveTheme.Instance.TransparentLightOverlay;
                selectedTabColor = ActiveTheme.Instance.SecondaryAccentColor;
            }

            double buildHeight = ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.build_height);

            // put in the 3D view
            partPreviewView = new View3DWidget(printItem,
                                               new Vector3(ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.bed_size), buildHeight),
                                               ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center),
                                               ActiveSliceSettings.Instance.GetValue <BedShape>(SettingsKey.bed_shape),
                                               windowMode,
                                               autoRotate3DView,
                                               openMode);

            TabPage partPreview3DView = new TabPage(partPreviewView, string.Format("3D {0} ", "View".Localize()).ToUpper());

            // put in the gcode view
            ViewGcodeBasic.WindowMode gcodeWindowMode = ViewGcodeBasic.WindowMode.Embeded;
            if (windowMode == View3DWidget.WindowMode.StandAlone)
            {
                gcodeWindowMode = ViewGcodeBasic.WindowMode.StandAlone;
            }

            viewGcodeBasic = new ViewGcodeBasic(printItem,
                                                new Vector3(ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.bed_size), buildHeight),
                                                ActiveSliceSettings.Instance.GetValue <Vector2>(SettingsKey.print_center),
                                                ActiveSliceSettings.Instance.GetValue <BedShape>(SettingsKey.bed_shape), gcodeWindowMode);

            if (windowMode == View3DWidget.WindowMode.StandAlone)
            {
                partPreviewView.Closed += (s, e) => Close();
                viewGcodeBasic.Closed  += (s, e) => Close();
            }

            TabPage layerView = new TabPage(viewGcodeBasic, "Layer View".Localize().ToUpper());

            int tabPointSize = 16;
            // add the correct tabs based on whether we are stand alone or embedded
            Tab threeDViewTab;

            if (windowMode == View3DWidget.WindowMode.StandAlone || UserSettings.Instance.IsTouchScreen)
            {
                threeDViewTab = new SimpleTextTabWidget(partPreview3DView, "3D View Tab", tabPointSize,
                                                        selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(threeDViewTab);
                layerViewTab = new SimpleTextTabWidget(layerView, "Layer View Tab", tabPointSize,
                                                       selectedTabColor, new RGBA_Bytes(), ActiveTheme.Instance.TabLabelUnselected, new RGBA_Bytes());
                tabControl.AddTab(layerViewTab);
            }
            else
            {
                threeDViewTab = new PopOutTextTabWidget(partPreview3DView, "3D View Tab", new Vector2(590, 400), tabPointSize);
                tabControl.AddTab(threeDViewTab);
                layerViewTab = new PopOutTextTabWidget(layerView, "Layer View Tab", new Vector2(590, 400), tabPointSize);
                tabControl.AddTab(layerViewTab);
            }

            threeDViewTab.ToolTipText = "Preview 3D Design".Localize();
            layerViewTab.ToolTipText  = "Preview layer Tool Paths".Localize();

            this.AddChild(tabControl);
        }