• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UI.FlowLayoutWidget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MatterHackers.Agg.UI.FlowLayoutWidget的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutWidget类的具体用法?C# FlowLayoutWidget怎么用?C# FlowLayoutWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FlowLayoutWidget类属于MatterHackers.Agg.UI命名空间,在下文中一共展示了FlowLayoutWidget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ManualPrinterControls

		public ManualPrinterControls()
		{
			SetDisplayAttributes();

			FlowLayoutWidget controlsTopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
			controlsTopToBottomLayout.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth;
			controlsTopToBottomLayout.VAnchor = Agg.UI.VAnchor.FitToChildren;
			controlsTopToBottomLayout.Name = "ManualPrinterControls.ControlsContainer";
			controlsTopToBottomLayout.Margin = new BorderDouble(0);

			AddTemperatureControls(controlsTopToBottomLayout);
			AddMovementControls(controlsTopToBottomLayout);

			FlowLayoutWidget linearPanel = new FlowLayoutWidget();
			linearPanel.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			controlsTopToBottomLayout.AddChild(linearPanel);

			AddFanControls(linearPanel);
			AddAtxPowerControls(linearPanel);

			AddMacroControls(controlsTopToBottomLayout);
			AddAdjustmentControls(controlsTopToBottomLayout);

			AddChild(controlsTopToBottomLayout);
			AddHandlers();
			SetVisibleControls();

			if (!pluginsQueuedToAdd)
			{
				UiThread.RunOnIdle(AddPlugins);
				pluginsQueuedToAdd = true;
			}
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:33,代码来源:ManualPrinterControls.cs


示例2: OpenMenuContents

		internal OpenMenuContents(ObservableCollection<MenuItem> MenuItems, GuiWidget widgetRelativeTo, Vector2 openOffset, Direction direction, RGBA_Bytes backgroundColor, RGBA_Bytes borderColor, int borderWidth, double maxHeight, bool alignToRightEdge)
		{
			this.MenuItems = new List<MenuItem>();
			this.MenuItems.AddRange(MenuItems);
			this.alignToRightEdge = alignToRightEdge;
			this.openOffset = openOffset;
			this.borderWidth = borderWidth;
			this.borderColor = borderColor;
			this.BackgroundColor = backgroundColor;

			this.direction = direction;
			this.widgetRelativeTo = widgetRelativeTo;
			scrollingWindow = new ScrollableWidget(true);
			{
				FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
				foreach (MenuItem menu in MenuItems)
				{
					menu.ClearRemovedFlag();
					topToBottom.AddChild(menu);
					menu.DoClickFunction = AllowClickingItems;
				}

				topToBottom.HAnchor = UI.HAnchor.ParentLeft | UI.HAnchor.FitToChildren;
				topToBottom.VAnchor = UI.VAnchor.ParentBottom;
				Width = topToBottom.Width;
				Height = topToBottom.Height;

				scrollingWindow.AddChild(topToBottom);
			}

			scrollingWindow.HAnchor = HAnchor.ParentLeftRight;
			scrollingWindow.VAnchor = VAnchor.ParentBottomTop;
			if (maxHeight > 0 && Height > maxHeight)
			{
				MakeMenuHaveScroll(maxHeight);
			}
			AddChild(scrollingWindow);

			LostFocus += new EventHandler(DropListItems_LostFocus);

			GuiWidget topParent = widgetRelativeTo.Parent;
			while (topParent.Parent != null)
			{
				// Regretably we don't know who it is that is the window that will actually think it is moving relative to its parent
				// but we need to know anytime our widgetRelativeTo has been moved by any change, so we hook them all.

				if (!widgetRefList.Contains(topParent))
				{
					widgetRefList.Add(topParent);
					topParent.PositionChanged += new EventHandler(widgetRelativeTo_PositionChanged);
					topParent.BoundsChanged += new EventHandler(widgetRelativeTo_PositionChanged);
				}

				topParent = topParent.Parent;
			}
			topParent.AddChild(this);

			widgetRelativeTo_PositionChanged(widgetRelativeTo, null);
			widgetRelativeTo.Closed += widgetRelativeTo_Closed;
		}
开发者ID:CNCBrasil,项目名称:agg-sharp,代码行数:60,代码来源:OpenMenuContents.cs


示例3: PrinterConfigurationWidget

		public PrinterConfigurationWidget()
		{
			SetDisplayAttributes();

			HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			VAnchor = Agg.UI.VAnchor.FitToChildren;

			FlowLayoutWidget mainLayoutContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
			mainLayoutContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			mainLayoutContainer.VAnchor = Agg.UI.VAnchor.FitToChildren;
			mainLayoutContainer.Padding = new BorderDouble(top: 10);

			if (!ActiveSliceSettings.Instance.GetValue<bool>(SettingsKey.has_hardware_leveling))
			{
				mainLayoutContainer.AddChild(new CalibrationSettingsWidget());
			}

			mainLayoutContainer.AddChild(new HardwareSettingsWidget());

			CloudSettingsWidget cloudGroupbox = new CloudSettingsWidget();
			mainLayoutContainer.AddChild(cloudGroupbox);

			ApplicationSettingsWidget applicationGroupbox = new ApplicationSettingsWidget();
			mainLayoutContainer.AddChild(applicationGroupbox);

			AddChild(mainLayoutContainer);

			AddHandlers();
			//SetVisibleControls();
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:30,代码来源:PrinterConfigurationPage.cs


示例4: AddChildElements

		protected override void AddChildElements()
		{
			AltGroupBox fanControlsGroupBox = new AltGroupBox(new TextWidget("Fan".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor));

			fanControlsGroupBox.Margin = new BorderDouble(0);
			fanControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
			fanControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
			fanControlsGroupBox.VAnchor = Agg.UI.VAnchor.FitToChildren;

			this.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			this.AddChild(fanControlsGroupBox);

			FlowLayoutWidget leftToRight = new FlowLayoutWidget();

			FlowLayoutWidget fanControlsLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
			fanControlsLayout.Padding = new BorderDouble(3, 5, 3, 0);
			{
				fanControlsLayout.AddChild(CreateFanControls());
			}

			leftToRight.AddChild(fanControlsLayout);
			SetDisplayAttributes();

			fanSpeedDisplay = new EditableNumberDisplay(textImageButtonFactory, "{0}%".FormatWith(PrinterConnectionAndCommunication.Instance.FanSpeed0To255.ToString()), "100%");
			fanSpeedDisplay.EditComplete += (sender, e) =>
			{
				PrinterConnectionAndCommunication.Instance.FanSpeed0To255 = (int)(fanSpeedDisplay.GetValue() * 255.5 / 100);
			};
			leftToRight.AddChild(fanSpeedDisplay);

			fanControlsGroupBox.AddChild(leftToRight);
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:32,代码来源:FanControls.cs


示例5: ThemeColorSelectorWidget

		public ThemeColorSelectorWidget(GuiWidget colorToChangeTo)
		{
			this.Padding = new BorderDouble(2, 0);
			this.colorToChangeTo = colorToChangeTo;
			int themeCount = ActiveTheme.AvailableThemes.Count;

			var allThemes = ActiveTheme.AvailableThemes;

			int index = 0;
			for (int x = 0; x < themeCount / 2; x++)
			{
				var columnContainer = new FlowLayoutWidget(Agg.UI.FlowDirection.TopToBottom)
				{
					Width = containerHeight
				};
				columnContainer.AddChild(CreateThemeButton(allThemes[index]));

				int secondRowIndex = index + themeCount / 2;
				columnContainer.AddChild(CreateThemeButton(allThemes[secondRowIndex]));

				this.AddChild(columnContainer);

				index++;
			}
			this.BackgroundColor = RGBA_Bytes.White;
			this.Width = containerHeight * (themeCount / 2);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:27,代码来源:ThemeColorSelectorWidget.cs


示例6: GetCloudSyncDashboardControls

		private FlowLayoutWidget GetCloudSyncDashboardControls()
		{
			FlowLayoutWidget cloudSyncContainer = new FlowLayoutWidget();
			cloudSyncContainer.HAnchor |= HAnchor.ParentLeftRight;
			cloudSyncContainer.VAnchor |= Agg.UI.VAnchor.ParentCenter;
			cloudSyncContainer.Margin = new BorderDouble(0, 0, 0, 0);
			cloudSyncContainer.Padding = new BorderDouble(0);

			Agg.Image.ImageBuffer cloudMonitorImage = StaticData.Instance.LoadIcon(Path.Combine("PrintStatusControls", "cloud-24x24.png"));
			if (!ActiveTheme.Instance.IsDarkTheme)
			{
				InvertLightness.DoInvertLightness(cloudMonitorImage);
			}

            ImageWidget cloudSyncIcon = new ImageWidget(cloudMonitorImage);
            cloudSyncIcon.Margin = new BorderDouble(right: 6, bottom: 6);

            TextWidget cloudSyncLabel = new TextWidget(LocalizedString.Get("Cloud Sync"));
            cloudSyncLabel.AutoExpandBoundsToText = true;
            cloudSyncLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            cloudSyncLabel.VAnchor = VAnchor.ParentCenter;

            linkButtonFactory.fontSize = 10;
            Button cloudSyncGoLink = linkButtonFactory.Generate("GO TO DASHBOARD");
            cloudSyncGoLink.ToolTipText = "Open cloud sync dashboard in web browser";
            cloudSyncGoLink.Click += new EventHandler(cloudSyncGoButton_Click);

            cloudSyncContainer.AddChild(cloudSyncIcon);
            cloudSyncContainer.AddChild(cloudSyncLabel);
            cloudSyncContainer.AddChild(new HorizontalSpacer());
            cloudSyncContainer.AddChild(cloudSyncGoLink);

			return cloudSyncContainer;
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:34,代码来源:CloudSettingsView.cs


示例7: SDCardManager

        private SDCardManager()
            : base(400, 300)
        {
            BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor;
            this.AnchorAll();

            Title = "MatterControl - SD Card Manager";
            this.ShowAsSystemWindow();
            MinimumSize = new Vector2(Width, Height);

            FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
            FlowLayoutWidget topButtons = new FlowLayoutWidget();

            topButtons.AddChild(textImageButtonFactory.Generate("Upload"));
            topButtons.AddChild(textImageButtonFactory.Generate("Delete"));
            topButtons.AddChild(textImageButtonFactory.Generate("New Folder"));
            topButtons.AddChild(textImageButtonFactory.Generate("Print"));
            topButtons.AddChild(textImageButtonFactory.Generate("Stop"));
            topButtons.AddChild(textImageButtonFactory.Generate("Mount"));
            topButtons.AddChild(textImageButtonFactory.Generate("Unmount"));

            topToBottom.AddChild(topButtons);

            this.AddChild(topToBottom);
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:25,代码来源:SDCardManager.cs


示例8: createPrinterConnectionMessageContainer

		public FlowLayoutWidget createPrinterConnectionMessageContainer()
		{
			FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
			container.Margin = new BorderDouble(5);
			BorderDouble elementMargin = new BorderDouble(top: 5);

			TextWidget continueMessage = new TextWidget("Would you like to connect to this printer now?", 0, 0, 12);
			continueMessage.AutoExpandBoundsToText = true;
			continueMessage.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			continueMessage.HAnchor = HAnchor.ParentLeftRight;
			continueMessage.Margin = elementMargin;

			TextWidget continueMessageTwo = new TextWidget("You can always configure this later.", 0, 0, 10);
			continueMessageTwo.AutoExpandBoundsToText = true;
			continueMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			continueMessageTwo.HAnchor = HAnchor.ParentLeftRight;
			continueMessageTwo.Margin = elementMargin;

			printerErrorMessage = new TextWidget("", 0, 0, 10);
			printerErrorMessage.AutoExpandBoundsToText = true;
			printerErrorMessage.TextColor = RGBA_Bytes.Red;
			printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
			printerErrorMessage.Margin = elementMargin;

			container.AddChild(continueMessage);
			container.AddChild(continueMessageTwo);
			container.AddChild(printerErrorMessage);

			container.HAnchor = HAnchor.ParentLeftRight;
			return container;
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:31,代码来源:SetupStepConfigureConnection.cs


示例9: PrinterConfigurationWidget

		public PrinterConfigurationWidget()
		{
			SetDisplayAttributes();

			HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			VAnchor = Agg.UI.VAnchor.FitToChildren;

			FlowLayoutWidget mainLayoutContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
			mainLayoutContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			mainLayoutContainer.VAnchor = Agg.UI.VAnchor.FitToChildren;
			mainLayoutContainer.Padding = new BorderDouble(top: 10);

			HardwareSettingsWidget hardwareGroupbox = new HardwareSettingsWidget();
			mainLayoutContainer.AddChild(hardwareGroupbox);

			CloudSettingsWidget cloudGroupbox = new CloudSettingsWidget();
			mainLayoutContainer.AddChild(cloudGroupbox);

			ApplicationSettingsWidget applicationGroupbox = new ApplicationSettingsWidget();
			mainLayoutContainer.AddChild(applicationGroupbox);

			AddChild(mainLayoutContainer);

			AddHandlers();
			//SetVisibleControls();
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:26,代码来源:PrinterConfigurationPage.cs


示例10: LibraryDataView

		public LibraryDataView()
		{
			// let the application controler know about this window so it can use it to switch library providers if it needs to.
			ApplicationController.Instance.CurrentLibraryDataView = this;

			currentLibraryProvider = new LibraryProviderSelector(SetCurrentLibraryProvider, false);
			currentLibraryProvider.DataReloaded += LibraryDataReloaded;

			if (libraryDataViewInstance != null)
			{
#if !__ANDROID__ // this is really just for debugging
				throw new Exception("There should only ever be one of these, Lars.");
#endif
			}
			libraryDataViewInstance = this;

			// set the display attributes
			{
				this.AnchorAll();
				this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
				this.ScrollArea.Padding = new BorderDouble(3);
			}

			ScrollArea.HAnchor = HAnchor.ParentLeftRight;

			AutoScroll = true;
			topToBottomItemList = new FlowLayoutWidget(FlowDirection.TopToBottom);
			topToBottomItemList.HAnchor = HAnchor.ParentLeftRight;
			AddChild(topToBottomItemList);

			AddAllItems();
		}
开发者ID:ChapmanCPSC370,项目名称:MatterControl,代码行数:32,代码来源:LibraryDataView.cs


示例11: PowerControls

		public PowerControls()
		{
			AltGroupBox fanControlsGroupBox = new AltGroupBox(new TextWidget("ATX Power Control".Localize(), pointSize: 18, textColor: ActiveTheme.Instance.SecondaryAccentColor));
			fanControlsGroupBox.Margin = new BorderDouble(0);
			fanControlsGroupBox.BorderColor = ActiveTheme.Instance.PrimaryTextColor;
			fanControlsGroupBox.HAnchor |= Agg.UI.HAnchor.ParentLeftRight;
			this.AddChild(fanControlsGroupBox);

			atxPowertoggleSwitch = ImageButtonFactory.CreateToggleSwitch(false);
			atxPowertoggleSwitch.Margin = new BorderDouble(6, 0, 6, 6);
			atxPowertoggleSwitch.CheckedStateChanged += (sender, e) =>
			{
				PrinterConnectionAndCommunication.Instance.AtxPowerEnabled = atxPowertoggleSwitch.Checked;
			};

			FlowLayoutWidget paddingContainer = new FlowLayoutWidget();
			paddingContainer.Padding = new BorderDouble(3, 5, 3, 0);
			{
				paddingContainer.AddChild(atxPowertoggleSwitch);
			}
			fanControlsGroupBox.AddChild(paddingContainer);

			UpdateControlVisibility(null, null);

			PrinterConnectionAndCommunication.Instance.CommunicationStateChanged.RegisterEvent(this.UpdateControlVisibility, ref unregisterEvents);
			PrinterConnectionAndCommunication.Instance.AtxPowerStateChanged.RegisterEvent(this.UpdatePowerSwitch, ref unregisterEvents);

			this.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			this.HAnchor = HAnchor.ParentLeftRight;
			this.VAnchor = VAnchor.ParentBottomTop;
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:31,代码来源:PowerControls.cs


示例12: CreateOptionsMenu

        GuiWidget CreateOptionsMenu()
        {
            ImageBuffer gearImage = new ImageBuffer();
            string imagePathAndFile = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "gear_icon.png");
            ImageBMPIO.LoadImageData(imagePathAndFile, gearImage);

            FlowLayoutWidget leftToRight = new FlowLayoutWidget();
            leftToRight.Margin = new BorderDouble(5, 0);
            string optionsString = new LocalizedString("Options").Translated;
            TextWidget optionsText = new TextWidget(optionsString, textColor: RGBA_Bytes.White);
            optionsText.VAnchor = Agg.UI.VAnchor.ParentCenter;
            optionsText.Margin = new BorderDouble(0, 0, 3, 0);
            leftToRight.AddChild(optionsText);
            GuiWidget gearWidget = new ImageWidget(gearImage);
            gearWidget.VAnchor = Agg.UI.VAnchor.ParentCenter;
            leftToRight.AddChild(gearWidget);
            leftToRight.HAnchor = HAnchor.FitToChildren;
            leftToRight.VAnchor = VAnchor.FitToChildren;

            Menu optionMenu = new Menu(leftToRight);
            optionMenu.OpenOffset = new Vector2(-2, -10);
            optionMenu.VAnchor = Agg.UI.VAnchor.ParentCenter;
            optionMenu.MenuItems.Add(new MenuItem(new ThemeColorSelectorWidget()));

            return optionMenu;
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:26,代码来源:PrinterActionRow.cs


示例13: createPrinterNameContainer

		private FlowLayoutWidget createPrinterNameContainer()
		{
			FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
			container.Margin = new BorderDouble(0, 5);
			BorderDouble elementMargin = new BorderDouble(top: 3);

			string printerNameLabelTxt = LocalizedString.Get("Printer Name");
			string printerNameLabelTxtFull = string.Format("{0}:", printerNameLabelTxt);
			TextWidget printerNameLabel = new TextWidget(printerNameLabelTxtFull, 0, 0, 12);
			printerNameLabel.TextColor = this.defaultTextColor;
			printerNameLabel.HAnchor = HAnchor.ParentLeftRight;
			printerNameLabel.Margin = new BorderDouble(0, 0, 0, 1);

			printerNameInput = new MHTextEditWidget(this.ActivePrinter.Name);
			printerNameInput.HAnchor = HAnchor.ParentLeftRight;
			printerNameInput.KeyPressed += PrinterNameInput_KeyPressed;

			printerNameError = new TextWidget(LocalizedString.Get("Give your printer a name."), 0, 0, 10);
			printerNameError.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			printerNameError.HAnchor = HAnchor.ParentLeftRight;
			printerNameError.Margin = elementMargin;

			container.AddChild(printerNameLabel);
			container.AddChild(printerNameInput);
			container.AddChild(printerNameError);
			container.HAnchor = HAnchor.ParentLeftRight;
			return container;
		}
开发者ID:glocklueng,项目名称:MatterControl,代码行数:28,代码来源:SetupStepMakeModelName.cs


示例14: RayTracerWindow

		public RayTracerWindow(int width, int height)
			: base(width, height)
		{
			//CalculateIntersectCostsAndSaveToFile();

			FlowLayoutWidget leftToRight = new FlowLayoutWidget();
			leftToRight.HAnchor |= HAnchor.ParentLeftRight;
			leftToRight.VAnchor |= VAnchor.ParentBottomTop;

			previewWindowRayTrace = new RayTraceWidget();
			AnchorAll();
			previewWindowRayTrace.AnchorAll();

			leftToRight.AddChild(previewWindowRayTrace);

			GuiWidget zBuffer = new GuiWidget(HAnchor.ParentLeftRight, VAnchor.ParentBottomTop);
			zBuffer.BackgroundColor = RGBA_Bytes.Blue;
			leftToRight.AddChild(zBuffer);

			AddChild(leftToRight);

			BackgroundColor = RGBA_Bytes.Black;

			ShowAsSystemWindow();
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:25,代码来源:RayTracerWindow.cs


示例15: PrintProgressBar

		public PrintProgressBar(bool widgetIsExtended = true)
		{
			MinimumSize = new Vector2(0, 24);

			HAnchor = HAnchor.ParentLeftRight;
			BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
			Margin = new BorderDouble(0);

			FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.LeftToRight);
			container.AnchorAll();
			container.Padding = new BorderDouble(6, 0);

			printTimeElapsed = new TextWidget("", pointSize: 11);
			printTimeElapsed.Printer.DrawFromHintedCache = true;
			printTimeElapsed.AutoExpandBoundsToText = true;
			printTimeElapsed.VAnchor = Agg.UI.VAnchor.ParentCenter;

			printTimeRemaining = new TextWidget("", pointSize: 11);
			printTimeRemaining.Printer.DrawFromHintedCache = true;
			printTimeRemaining.AutoExpandBoundsToText = true;
			printTimeRemaining.VAnchor = Agg.UI.VAnchor.ParentCenter;

			GuiWidget spacer = new GuiWidget();
			spacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;

			container.AddChild(printTimeElapsed);
			container.AddChild(spacer);
			container.AddChild(printTimeRemaining);

			AddChild(container);

			if (ActiveTheme.Instance.IsTouchScreen)
			{
				upImageBuffer = StaticData.Instance.LoadIcon("TouchScreen/arrow_up_32x24.png");
				downImageBuffer = StaticData.Instance.LoadIcon("TouchScreen/arrow_down_32x24.png");

				indicatorWidget = new ImageWidget(upImageBuffer);
				indicatorWidget.HAnchor = HAnchor.ParentCenter;
				indicatorWidget.VAnchor = VAnchor.ParentCenter;

				WidgetIsExtended = widgetIsExtended;

				GuiWidget indicatorOverlay = new GuiWidget();
				indicatorOverlay.AnchorAll();
				indicatorOverlay.AddChild(indicatorWidget);

				AddChild(indicatorOverlay);
			}

			ClickWidget clickOverlay = new ClickWidget();
			clickOverlay.AnchorAll();
			clickOverlay.Click += onProgressBarClick;

			AddChild(clickOverlay);

			AddHandlers();
			SetThemedColors();
			UpdatePrintStatus();
			UiThread.RunOnIdle(OnIdle);
		}
开发者ID:fuding,项目名称:MatterControl,代码行数:60,代码来源:PrintProgressBarWidget.cs


示例16: PrintProgressBar

        public PrintProgressBar()
        {
            MinimumSize = new Vector2(0, 24);
            HAnchor = HAnchor.ParentLeftRight;
            BackgroundColor = ActiveTheme.Instance.SecondaryAccentColor;
            Margin = new BorderDouble(0);

            FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.LeftToRight);
            container.AnchorAll();
            container.Padding = new BorderDouble(6,0);

            printTimeElapsed = new TextWidget("", pointSize:11);
            printTimeElapsed.AutoExpandBoundsToText = true;
            printTimeElapsed.VAnchor = Agg.UI.VAnchor.ParentCenter;


            printTimeRemaining = new TextWidget("", pointSize: 11);
            printTimeRemaining.AutoExpandBoundsToText = true;
            printTimeRemaining.VAnchor = Agg.UI.VAnchor.ParentCenter;

            GuiWidget spacer = new GuiWidget();
            spacer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;

            container.AddChild(printTimeElapsed);
            container.AddChild(spacer);
            container.AddChild(printTimeRemaining);

            AddChild(container);
            AddHandlers();
            SetThemedColors();
            UpdatePrintStatus();            
            UiThread.RunOnIdle(OnIdle);
        }
开发者ID:rubenkar,项目名称:MatterControl,代码行数:33,代码来源:PrintProgressBarWidget.cs


示例17: CameraCalibrationWidget

        public CameraCalibrationWidget()
        {
            SuspendLayout();

            FlowLayoutWidget TopToBottomLayout = new FlowLayoutWidget(FlowDirection.TopToBottom);
            {
                FlowLayoutWidget TopButtons = new FlowLayoutWidget(FlowDirection.LeftToRight);
                {
                    connectButton = new Button("Connect");
                    connectButton.Click += new ButtonBase.ButtonEventHandler(ConnectButton_Click);

                    TopButtons.AddChild(connectButton);
                }
                TopToBottomLayout.AddChild(TopButtons);

                xyJogControls = new XYJogControls();
                TopToBottomLayout.AddChild(xyJogControls);

                disableMotors = new Button("Disable Motors");
                disableMotors.Click += new ButtonBase.ButtonEventHandler(disableMotors_Click);
                TopToBottomLayout.AddChild(disableMotors);
            }

            AddChild(TopToBottomLayout);

            ResumeLayout();
        }
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:27,代码来源:CameraCalibrationWidget.cs


示例18: MeshViewerApplication

        public MeshViewerApplication(string meshFileToLoad = "")
            : base(800, 600)
        {
            BackgroundColor = RGBA_Bytes.White;
            MinimumSize = new VectorMath.Vector2(200, 200);
            Title = "MatterHackers MeshViewr";
            UseOpenGL = true;

            FlowLayoutWidget mainContainer = new FlowLayoutWidget(FlowDirection.TopToBottom);
            mainContainer.AnchorAll();

            viewArea = new GuiWidget();

            viewArea.AnchorAll();

            Vector3 viewerVolume = new Vector3(200, 200, 200);
            double scale = 1;
            meshViewerWidget = new MeshViewerWidget(viewerVolume, scale, MeshViewerWidget.BedShape.Rectangular, "No Part Loaded");

            meshViewerWidget.AnchorAll();

            viewArea.AddChild(meshViewerWidget);

            mainContainer.AddChild(viewArea);

            FlowLayoutWidget buttonPanel = new FlowLayoutWidget(FlowDirection.LeftToRight);
            buttonPanel.HAnchor = HAnchor.ParentLeftRight;
            buttonPanel.Padding = new BorderDouble(3, 3);
            buttonPanel.BackgroundColor = RGBA_Bytes.DarkGray;

            if (meshFileToLoad != "")
            {
                meshViewerWidget.LoadMesh(meshFileToLoad);
            }
            else
            {
                openFileButton = new Button("Open 3D File", 0, 0);
                openFileButton.Click += new Button.ButtonEventHandler(openFileButton_ButtonClick);
                buttonPanel.AddChild(openFileButton);
            }

            bedCheckBox = new CheckBox("Bed");
            bedCheckBox.Checked = true;
            buttonPanel.AddChild(bedCheckBox);

            wireframeCheckBox = new CheckBox("Wireframe");
            buttonPanel.AddChild(wireframeCheckBox);

            GuiWidget leftRightSpacer = new GuiWidget();
            leftRightSpacer.HAnchor = HAnchor.ParentLeftRight;
            buttonPanel.AddChild(leftRightSpacer);

            mainContainer.AddChild(buttonPanel);

            this.AddChild(mainContainer);
            this.AnchorAll();

            AddHandlers();
        }
开发者ID:jeske,项目名称:agg-sharp,代码行数:59,代码来源:MeshViewerApplication.cs


示例19: TemperatureWidgetBase

		public TemperatureWidgetBase(string textValue)
			: base(52 * TextWidget.GlobalPointSizeScaleRatio, 52 * TextWidget.GlobalPointSizeScaleRatio)
		{
			whiteButtonFactory.FixedHeight = 18 * TextWidget.GlobalPointSizeScaleRatio;
			whiteButtonFactory.fontSize = 7;
			whiteButtonFactory.normalFillColor = RGBA_Bytes.White;
			whiteButtonFactory.normalTextColor = RGBA_Bytes.DarkGray;

			FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
			container.AnchorAll();

			this.BackgroundColor = new RGBA_Bytes(255, 255, 255, 200);
			this.Margin = new BorderDouble(0, 2) * TextWidget.GlobalPointSizeScaleRatio;

			GuiWidget labelContainer = new GuiWidget();
			labelContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			labelContainer.Height = 18 * TextWidget.GlobalPointSizeScaleRatio;

			labelTextWidget = new TextWidget("", pointSize: 8);
			labelTextWidget.AutoExpandBoundsToText = true;
			labelTextWidget.HAnchor = HAnchor.ParentCenter;
			labelTextWidget.VAnchor = VAnchor.ParentCenter;
			labelTextWidget.TextColor = ActiveTheme.Instance.SecondaryAccentColor;
			labelTextWidget.Visible = false;

			labelContainer.AddChild(labelTextWidget);

			GuiWidget indicatorContainer = new GuiWidget();
			indicatorContainer.AnchorAll();

			indicatorTextWidget = new TextWidget(textValue, pointSize: 11);
			indicatorTextWidget.TextColor = ActiveTheme.Instance.PrimaryAccentColor;
			indicatorTextWidget.HAnchor = HAnchor.ParentCenter;
			indicatorTextWidget.VAnchor = VAnchor.ParentCenter;
			indicatorTextWidget.AutoExpandBoundsToText = true;

			indicatorContainer.AddChild(indicatorTextWidget);

			GuiWidget buttonContainer = new GuiWidget();
			buttonContainer.HAnchor = Agg.UI.HAnchor.ParentLeftRight;
			buttonContainer.Height = 18 * TextWidget.GlobalPointSizeScaleRatio;

			preheatButton = whiteButtonFactory.Generate("Preheat".Localize().ToUpper());
			preheatButton.Cursor = Cursors.Hand;
			preheatButton.Visible = false;

			buttonContainer.AddChild(preheatButton);

			container.AddChild(labelContainer);
			container.AddChild(indicatorContainer);
			container.AddChild(buttonContainer);

			this.AddChild(container);
			ActiveTheme.Instance.ThemeChanged.RegisterEvent(ThemeChanged, ref unregisterEvents);

			this.MouseEnterBounds += onEnterBounds;
			this.MouseLeaveBounds += onLeaveBounds;
			this.preheatButton.Click += onPreheatButtonClick;
		}
开发者ID:annafeldman,项目名称:MatterControl,代码行数:59,代码来源:TemperatureWidgetBase.cs


示例20: createPrinterConnectionMessageContainer

		public FlowLayoutWidget createPrinterConnectionMessageContainer()
		{
			FlowLayoutWidget container = new FlowLayoutWidget(FlowDirection.TopToBottom);
			container.VAnchor = VAnchor.ParentBottomTop;
			container.Margin = new BorderDouble(5);
			BorderDouble elementMargin = new BorderDouble(top: 5);

			string printerMessageOneText = "MatterControl will now attempt to auto-detect printer.".Localize();
			TextWidget printerMessageOne = new TextWidget(printerMessageOneText, 0, 0, 10);
			printerMessageOne.Margin = new BorderDouble(0, 10, 0, 5);
			printerMessageOne.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			printerMessageOne.HAnchor = HAnchor.ParentLeftRight;
			printerMessageOne.Margin = elementMargin;

			string disconnectMessage = string.Format("1.) {0} ({1}).", "Disconnect printer".Localize(), "if currently connected".Localize());
			TextWidget printerMessageTwo = new TextWidget(disconnectMessage, 0, 0, 12);
			printerMessageTwo.TextColor = ActiveTheme.Instance.PrimaryTextColor;
			printerMessageTwo.HAnchor = HAnchor.ParentLeftRight;
			printerMessageTwo.Margin = elementMargin;

			string printerMessageThreeBeg = "Power on and connect printer".Localize();
			string printerMessageThreeFull = string.Format("2.) {0}.", printerMessageThreeBeg);
			TextWidget printerMessageThree = new TextWidget(printerMessageThreeFull, 0, 0, 12);
            printerMessageThree.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageThree.HAnchor = HAnchor.ParentLeftRight;
            printerMessageThree.Margin = elementMargin;

			string printerMessageFourTxtBeg = "Press".Localize();
			string printerMessageFourTxtEnd = "Connect".Localize();
			string printerMessageFourTxtFull = string.Format("3.) {0} '{1}'.", printerMessageFourTxtBeg, printerMessageFourTxtEnd);
			TextWidget printerMessageFour = new TextWidget(printerMessageFourTxtFull, 0, 0, 12);
            printerMessageFour.TextColor = ActiveTheme.Instance.PrimaryTextColor;
            printerMessageFour.HAnchor = HAnchor.ParentLeftRight;
            printerMessageFour.Margin = elementMargin;

			GuiWidget vSpacer = new GuiWidget();
			vSpacer.VAnchor = VAnchor.ParentBottomTop;

			Button manualLink = linkButtonFactory.Generate("Manual Configuration".Localize());
			manualLink.Margin = new BorderDouble(0, 5);
			manualLink.Click += (s, e) => WizardWindow.ChangeToPage<SetupStepComPortManual>();

			printerErrorMessage = new TextWidget("", 0, 0, 10);
			printerErrorMessage.AutoExpandBoundsToText = true;
			printerErrorMessage.TextColor = RGBA_Bytes.Red;
			printerErrorMessage.HAnchor = HAnchor.ParentLeftRight;
			printerErrorMessage.Margin = elementMargin;

			container.AddChild(printerMessageOne);
			container.AddChild(printerMessageTwo);
			container.AddChild(printerMessageThree);
			container.AddChild(printerMessageFour);
			container.AddChild(printerErrorMessage);
			container.AddChild(vSpacer);
			container.AddChild(manualLink);

			container.HAnchor = HAnchor.ParentLeftRight;
			return container;
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:59,代码来源:SetupStepComPortTwo.cs



注:本文中的MatterHackers.Agg.UI.FlowLayoutWidget类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.GuiWidget类代码示例发布时间:2022-05-26
下一篇:
C# UI.FileDropEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap