Exemplo n.º 1
0
        public PartPreviewMainWindow(PrintItemWrapper printItem, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
            : base(750, 550)
        {
            UseOpenGL = true;
            string partPreviewTitle = LocalizedString.Get("MatterControl");

            Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);

            this.Name = "Part Preview Window";

            partPreviewWidget         = new PartPreviewContent(printItem, View3DWidget.WindowMode.StandAlone, autoRotate3DView, openMode);
            partPreviewWidget.Closed += (sender, e) =>
            {
                Close();
            };

#if __ANDROID__
            TerminalWidget terminalWidget = new TerminalWidget(true);
            this.AddChild(new SoftKeyboardContentOffset(partPreviewWidget));
            //mainContainer.Closed += (sender, e) => { Close(); };
#else
            this.AddChild(partPreviewWidget);
#endif

            AddHandlers();

            Width  = 750;
            Height = 550;

            MinimumSize = new Vector2(400, 300);
            ShowAsSystemWindow();
        }
Exemplo n.º 2
0
        public PartPreviewMainWindow(PrintItemWrapper printItem, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
            : base(750, 550)
        {
            UseOpenGL = true;
            string partPreviewTitle = "MatterControl".Localize();

            Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);

            this.Name = "Part Preview Window";

            partPreviewWidget         = new PartPreviewContent(printItem, View3DWidget.WindowMode.StandAlone, autoRotate3DView, openMode);
            partPreviewWidget.Closed += (sender, e) =>
            {
                Close();
            };

            this.AddChild(partPreviewWidget);

            AddHandlers();

            Width  = 750;
            Height = 550;

            MinimumSize = new Vector2(400, 300);
            ShowAsSystemWindow();
        }
Exemplo n.º 3
0
        public PartPreviewMainWindow(PrintItemWrapper printItem, View3DWidget.AutoRotate autoRotate3DView, bool openInEditMode = false)
            : base(690, 340)
        {
            UseOpenGL           = true;
            this.OpenInEditMode = openInEditMode;
            string partPreviewTitle = LocalizedString.Get("MatterControl");

            Title = string.Format("{0}: ", partPreviewTitle) + Path.GetFileName(printItem.Name);

            partPreviewWidget         = new PartPreviewContent(printItem, false, autoRotate3DView, openInEditMode);
            partPreviewWidget.Closed += (sender, e) =>
            {
                Close();
            };

            this.AddChild(partPreviewWidget);

            AddHandlers();

            Width  = 640;
            Height = 480;

            MinimumSize = new Vector2(400, 300);
            ShowAsSystemWindow();

            // We do this after showing the system window so that when we try and take focus of the parent window (the system window)
            // it exists and can give the focus to its child the gcode window.
            if (Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
            {
                partPreviewWidget.SwitchToGcodeView();
            }
        }
        public PartPreviewContent(PrintItemWrapper printItem, bool widgetIsEmbedded, View3DWidget.AutoRotate autoRotate3DView, bool openInEditMode = false)
        {
            this.openInEditMode   = openInEditMode;
            this.autoRotate3DView = autoRotate3DView;
            this.widgetIsEmbedded = widgetIsEmbedded;

            BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
            this.AnchorAll();
            this.Load(printItem);
        }
Exemplo n.º 5
0
 private void OpenPartPreviewWindow(View3DWidget.AutoRotate autoRotate)
 {
     if (partPreviewWindow == null)
     {
         partPreviewWindow         = new PartPreviewMainWindow(this.PrintItem, autoRotate);
         partPreviewWindow.Closed += new EventHandler(PartPreviewWindow_Closed);
     }
     else
     {
         partPreviewWindow.BringToFront();
     }
 }
        private void OpenPartPreviewWindow(PrintItem printItem, View3DWidget.AutoRotate autoRotate)
        {
            PrintItemWrapper itemWrapper = new PrintItemWrapper(printItem.Id);

            if (partPreviewWindow == null)
            {
                partPreviewWindow         = new PartPreviewMainWindow(itemWrapper, autoRotate);
                partPreviewWindow.Closed += new EventHandler(PartPreviewWindow_Closed);
            }
            else
            {
                partPreviewWindow.BringToFront();
            }
        }
 private void OpenPartPreviewWindow(View3DWidget.AutoRotate autoRotate)
 {
     if (partPreviewWindow == null)
     {
         partPreviewWindow         = new PartPreviewMainWindow(this.PrintItem, autoRotate);
         partPreviewWindow.Closed += (object sender, EventArgs e) =>
         {
             this.partPreviewWindow = null;
         };
     }
     else
     {
         partPreviewWindow.BringToFront();
     }
 }
Exemplo n.º 8
0
 private void OpenPartPreviewWindow(View3DWidget.AutoRotate autoRotate)
 {
     if (partPreviewWindow == null)
     {
         partPreviewWindow         = new PartPreviewMainWindow(this.ItemWrapper, autoRotate);
         partPreviewWindow.Closed += (s, e) =>
         {
             this.partPreviewWindow = null;
         };
     }
     else
     {
         partPreviewWindow.BringToFront();
     }
 }
Exemplo n.º 9
0
		public PartPreviewContent(PrintItemWrapper printItem, View3DWidget.WindowMode windowMode, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
		{
			this.openMode = openMode;
			this.autoRotate3DView = autoRotate3DView;
			this.windowMode = windowMode;

			BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
			this.AnchorAll();
			this.Load(printItem);

			// We do this after showing the system window so that when we try and take focus of the parent window (the system window)
			// it exists and can give the focus to its child the gcode window.
			if (printItem != null
				&& Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
			{
				SwitchToGcodeView();
			}
		}
Exemplo n.º 10
0
        public PartPreviewContent(PrintItemWrapper printItem, View3DWidget.WindowMode windowMode, View3DWidget.AutoRotate autoRotate3DView, View3DWidget.OpenMode openMode = View3DWidget.OpenMode.Viewing)
        {
            this.openMode         = openMode;
            this.autoRotate3DView = autoRotate3DView;
            this.windowMode       = windowMode;

            BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
            this.AnchorAll();
            this.Load(printItem);

            // We do this after showing the system window so that when we try and take focus of the parent window (the system window)
            // it exists and can give the focus to its child the gcode window.
            if (printItem != null &&
                Path.GetExtension(printItem.FileLocation).ToUpper() == ".GCODE")
            {
                SwitchToGcodeView();
            }
        }