예제 #1
0
        private FlowLayoutWidget GetHWDestinationBar()
        {
            var hwDestinationBar = new FlowLayoutWidget
            {
                HAnchor = HAnchor.Stretch,
                Margin  = new BorderDouble(top: 8),
                Padding = 0
            };

            var xPosition = new TextWidget("X: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor);
            var yPosition = new TextWidget("Y: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor);
            var zPosition = new TextWidget("Z: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.Colors.PrimaryTextColor);

            hwDestinationBar.AddChild(xPosition);
            hwDestinationBar.AddChild(yPosition);
            hwDestinationBar.AddChild(zPosition);

            SetDestinationPositionText(xPosition, yPosition, zPosition);

            reportDestinationChanged = new LimitCallingFrequency(1, () =>
            {
                UiThread.RunOnIdle(() =>
                {
                    SetDestinationPositionText(xPosition, yPosition, zPosition);
                });
            });

            printer.Connection.DestinationChanged.RegisterEvent((object sender, EventArgs e) =>
            {
                reportDestinationChanged.CallEvent();
            }, ref unregisterEvents);

            return(hwDestinationBar);
        }
예제 #2
0
        private FlowLayoutWidget GetHWDestinationBar()
        {
            FlowLayoutWidget hwDestinationBar = new FlowLayoutWidget();

            hwDestinationBar.HAnchor = HAnchor.ParentLeftRight;
            hwDestinationBar.Margin  = new BorderDouble(3, 0, 3, 6);
            hwDestinationBar.Padding = new BorderDouble(0);

            TextWidget xPosition = new TextWidget("X: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);
            TextWidget yPosition = new TextWidget("Y: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);
            TextWidget zPosition = new TextWidget("Z: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);

            hwDestinationBar.AddChild(xPosition);
            hwDestinationBar.AddChild(yPosition);
            hwDestinationBar.AddChild(zPosition);

            SetDestinationPositionText(xPosition, yPosition, zPosition);

            reportDestinationChanged = new LimitCallingFrequency(1, () =>
            {
                UiThread.RunOnIdle(() =>
                {
                    SetDestinationPositionText(xPosition, yPosition, zPosition);
                });
            });

            PrinterConnectionAndCommunication.Instance.DestinationChanged.RegisterEvent((object sender, EventArgs e) =>
            {
                reportDestinationChanged.CallEvent();
            }, ref unregisterEvents);

            return(hwDestinationBar);
        }
예제 #3
0
        private FlowLayoutWidget GetHWDestinationBar()
        {
            var hwDestinationBar = new FlowLayoutWidget
            {
                HAnchor = HAnchor.Stretch,
                Margin  = new BorderDouble(top: 8),
                Padding = 0
            };

            var xPosition = new TextWidget("X: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor);
            var yPosition = new TextWidget("Y: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor);
            var zPosition = new TextWidget("Z: 0.0           ", pointSize: theme.DefaultFontSize, textColor: theme.TextColor);

            hwDestinationBar.AddChild(xPosition);
            hwDestinationBar.AddChild(yPosition);
            hwDestinationBar.AddChild(zPosition);

            SetDestinationPositionText(xPosition, yPosition, zPosition);

            reportDestinationChanged = new LimitCallingFrequency(1, () =>
            {
                UiThread.RunOnIdle(() =>
                {
                    SetDestinationPositionText(xPosition, yPosition, zPosition);
                });
            });

            return(hwDestinationBar);
        }
		private FlowLayoutWidget GetHWDestinationBar()
		{
			FlowLayoutWidget hwDestinationBar = new FlowLayoutWidget();
			hwDestinationBar.HAnchor = HAnchor.ParentLeftRight;
			hwDestinationBar.Margin = new BorderDouble(3, 0, 3, 6) * TextWidget.GlobalPointSizeScaleRatio;
			hwDestinationBar.Padding = new BorderDouble(0);

			TextWidget xPosition = new TextWidget("X: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);
			TextWidget yPosition = new TextWidget("Y: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);
			TextWidget zPosition = new TextWidget("Z: 0.0           ", pointSize: 12, textColor: ActiveTheme.Instance.PrimaryTextColor);

			hwDestinationBar.AddChild(xPosition);
			hwDestinationBar.AddChild(yPosition);
			hwDestinationBar.AddChild(zPosition);

			SetDestinationPositionText(xPosition, yPosition, zPosition);

			reportDestinationChanged = new LimitCallingFrequency(1, () =>
			{
				UiThread.RunOnIdle(() =>
				{
					SetDestinationPositionText(xPosition, yPosition, zPosition);
				});
			});

			PrinterConnectionAndCommunication.Instance.DestinationChanged.RegisterEvent((object sender, EventArgs e) =>
			{
				reportDestinationChanged.CallEvent();
			}, ref unregisterEvents);

			return hwDestinationBar;
		}