Пример #1
0
        private void CreateMenuItems()
        {
            menuItems = new List <RadialControllerMenuItem>
            {
                RadialControllerMenuItem.CreateFromKnownIcon("Item0", RadialControllerMenuKnownIcon.InkColor),
                RadialControllerMenuItem.CreateFromKnownIcon("Item1", RadialControllerMenuKnownIcon.NextPreviousTrack),
                RadialControllerMenuItem.CreateFromKnownIcon("Item2", RadialControllerMenuKnownIcon.Volume),
                RadialControllerMenuItem.CreateFromIcon("Item3", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item3.png"))),
                RadialControllerMenuItem.CreateFromIcon("Item4", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item4.png"))),
                RadialControllerMenuItem.CreateFromIcon("Item5", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item5.png")))
            };
            sliders = new List <Slider> {
                Slider0, Slider1, Slider2, Slider3, Slider4, Slider5
            };
            toggles = new List <ToggleSwitch> {
                Toggle0, Toggle1, Toggle2, Toggle3, Toggle4, Toggle5
            };

            for (int i = 0; i < menuItems.Count; ++i)
            {
                RadialControllerMenuItem radialControllerItem = menuItems[i];
                int index = i;

                radialControllerItem.Invoked += (sender, args) => { OnItemInvoked(index); };
            }
        }
        private void InitializeSurfaceDial()
        {
            _radialController = RadialController.CreateForCurrentView();

            _radialController.ButtonClicked   += _radialController_ButtonClicked;
            _radialController.RotationChanged += _radialController_RotationChanged;

            var bluricon       = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Blur.png"));
            var fogicon        = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Fog.png"));
            var hueicon        = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Hue.png"));
            var saturationicon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Saturation.png"));
            var sepiaicon      = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Sepia.png"));

            var blurItem = RadialControllerMenuItem.CreateFromIcon(TAGS.Blur, bluricon);

            blurItem.Tag = blurItem.DisplayText;
            var fogItem = RadialControllerMenuItem.CreateFromIcon(TAGS.Fog, fogicon);

            fogItem.Tag = fogItem.DisplayText;
            var hueItem = RadialControllerMenuItem.CreateFromIcon(TAGS.Hue, hueicon);

            hueItem.Tag = hueItem.DisplayText;
            var saturationItem = RadialControllerMenuItem.CreateFromIcon(TAGS.Saturation, saturationicon);

            saturationItem.Tag = saturationItem.DisplayText;
            var sepiaItem = RadialControllerMenuItem.CreateFromIcon(TAGS.Sepia, sepiaicon);

            sepiaItem.Tag = sepiaItem.DisplayText;

            _radialController.Menu.Items.Add(blurItem);
            _radialController.Menu.Items.Add(fogItem);
            _radialController.Menu.Items.Add(hueItem);
            _radialController.Menu.Items.Add(saturationItem);
            _radialController.Menu.Items.Add(sepiaItem);
        }
Пример #3
0
        private void ConfigureRadialController()
        {
            if (!RadialControllerConfiguration.IsAppControllerEnabled)
            {
                return;
            }

            // Setup DialController
            dialController = RadialController.CreateForCurrentView();
            dialController.RotationResolutionInDegrees = 1;

            // Wireup event handler for rotation
            dialController.RotationChanged += DialController_RotationChanged;
            dialController.ButtonClicked   += DialController_ButtonClicked;

            // Remove the default items to make more room for our custom items
            var config = RadialControllerConfiguration.GetForCurrentView();

            config.SetDefaultMenuItems(new[] { RadialControllerSystemMenuItemKind.Scroll });

            // Add a custom menu item for each of the video effects
            foreach (VideoEffectItemViewModel effect in PageViewModel.VideoEffects)
            {
                // Create a menu item, using the effect's name and thumbnail
                var menuItem = RadialControllerMenuItem.CreateFromIcon(effect.DisplayName,
                                                                       RandomAccessStreamReference.CreateFromUri(new Uri(effect.IconImagePath)));

                // Hook up the menu item's invoked (aka clicked/selected) event handler
                menuItem.Invoked += MenuItem_Invoked;

                // Add it to the RadialDial
                dialController.Menu.Items.Add(menuItem);
            }
        }
Пример #4
0
        private void SetupController()
        {
            if (null == Controller)
            {
                Controller = RadialController.CreateForCurrentView();
            }

            RadialControllerConfiguration _dialConfiguration = RadialControllerConfiguration.GetForCurrentView();

            // Remove standard menu items
            _dialConfiguration.SetDefaultMenuItems(new RadialControllerSystemMenuItemKind[] { });

            // Create an icon for the custom tool.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/List/specs_creative.png"));

            // Create a menu item for the custom tool.
            _brushColorMenuItem = RadialControllerMenuItem.CreateFromIcon("Brush Color", icon);

            // Add the custom tool to the RadialController menu.
            Controller.Menu.Items.Add(_brushColorMenuItem);

            // Set rotation degrees
            Controller.RotationResolutionInDegrees = ROTATION_DEGREES;

            // Bind dial controls to local methods
            _brushColorMenuItem.Invoked       += ColorMenuItem_Invoked;
            Controller.RotationChanged        += Controller_RotationChanged;
            Controller.ButtonClicked          += Controller_ButtonClicked;
            Controller.ScreenContactStarted   += Controller_ScreenContactStarted;
            Controller.ScreenContactContinued += Controller_ScreenContactContinued;
            Controller.ScreenContactEnded     += Controller_ScreenContactEnded;
        }
Пример #5
0
        public OnScreenVisualPage()
        {
            this.InitializeComponent();

            RadialControllerConfiguration myConfiguration = RadialControllerConfiguration.GetForCurrentView();

            myConfiguration.SetDefaultMenuItems(new[]
            {
                RadialControllerSystemMenuItemKind.Volume,
                RadialControllerSystemMenuItemKind.Scroll
            });

            // Create a reference to the RadialController.
            myController = RadialController.CreateForCurrentView();

            // Create an icon for the custom tool.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/dial_icon_custom_visual.png"));

            // Create a menu item for the custom tool.
            screenColorMenuItem =
                RadialControllerMenuItem.CreateFromIcon("Screen Color", icon);

            // Add the custom tool to the RadialController menu.
            myController.Menu.Items.Add(screenColorMenuItem);

            screenColorMenuItem.Invoked += ColorMenuItem_Invoked;

            myController.ScreenContactStarted   += MyController_ScreenContactStarted;
            myController.ScreenContactContinued += MyController_ScreenContactContinued;
            myController.ScreenContactEnded     += MyController_ScreenContactEnded;

            myController.RotationChanged += MyController_RotationChanged;
        }
        public MenuItemPage()
        {
            this.InitializeComponent();

            RadialControllerConfiguration myConfiguration = RadialControllerConfiguration.GetForCurrentView();

            //determine which operating system menu items should be shown
            myConfiguration.SetDefaultMenuItems(new[]
            {
                RadialControllerSystemMenuItemKind.Volume,
                RadialControllerSystemMenuItemKind.NextPreviousTrack,
                RadialControllerSystemMenuItemKind.Scroll
            });

            // Create a reference to the RadialController.
            myController = RadialController.CreateForCurrentView();

            // Create an icon for the custom tool.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/dial_icon_custom_item.png"));

            // Create a menu item for the custom tool.
            selectImageMenuItem =
                RadialControllerMenuItem.CreateFromIcon("Select Image", icon);

            // Add the custom tool to the RadialController menu.
            myController.Menu.Items.Add(selectImageMenuItem);

            // Declare input handlers for the RadialController.
            myController.RotationChanged += MyController_RotationChanged;

            selectImageMenuItem.Invoked += SelectImageItem_Invoked;
        }
Пример #7
0
        private async Task AddMenuItemInternalAsync(string moniker, string iconFilePath)
        {
            await Task.Yield();

            await TaskScheduler.Default;

            StorageFile file = await StorageFile.GetFileFromPathAsync(iconFilePath);

            var stream   = RandomAccessStreamReference.CreateFromFile(file);
            var menuItem = RadialControllerMenuItem.CreateFromIcon(moniker, stream);

            menuItem.Invoked += (sender, args) =>
            {
                _status.Text = sender.DisplayText;
                _controllers.FirstOrDefault(c => c.Moniker == moniker)?.OnActivate();
            };

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            foreach (var controller in controllersMapping.Values)
            {
                if (!controller.Menu.Items.Any(i => i.DisplayText == moniker))
                {
                    controller.Menu.Items.Add(menuItem);
                }
            }
        }
Пример #8
0
        public void AddMenuItem(string moniker, string iconFilePath)
        {
            if (_radialController.Menu.Items.Any(i => i.DisplayText == moniker))
            {
                return;
            }

            IAsyncOperation <StorageFile> operation = StorageFile.GetFileFromPathAsync(iconFilePath);

            operation.Completed += (asyncInfo, asyncStatus) =>
            {
                if (asyncStatus == AsyncStatus.Completed)
                {
                    StorageFile file     = asyncInfo.GetResults();
                    var         stream   = RandomAccessStreamReference.CreateFromFile(file);
                    var         menuItem = RadialControllerMenuItem.CreateFromIcon(moniker, stream);

                    menuItem.Invoked += (sender, args) =>
                    {
                        _status.UpdateSelectedItem(sender.DisplayText);
                        _controllers.FirstOrDefault(c => c.Moniker == moniker)?.OnActivate();
                    };

                    ThreadHelper.Generic.BeginInvoke(DispatcherPriority.Normal, () =>
                    {
                        _radialController.Menu.Items.Add(menuItem);
                    });
                }
            };
        }
Пример #9
0
#pragma warning restore VSTHRD200 // Use "Async" suffix for async methods

        internal static async Task <RadialControllerMenuItem> CreateMenuItemAsync(string moniker, string iconFilePath)
        {
            StorageFile file = await StorageFile.GetFileFromPathAsync(iconFilePath);

            var stream = RandomAccessStreamReference.CreateFromFile(file);

            return(RadialControllerMenuItem.CreateFromIcon(moniker, stream));
        }
Пример #10
0
        public async void AddMenuItem(string title, Texture2D icon)
        {
            var memStream = await GetRandomAccessStreamReferenceForIcon(icon);

            var menuItem = RadialControllerMenuItem.CreateFromIcon(title, memStream);

            _controller.Menu.Items.Add(menuItem);
        }
Пример #11
0
 private void OnImageFileFound(IAsyncOperation <StorageFile> asyncInfo, AsyncStatus asyncStatus)
 {
     if (asyncStatus == AsyncStatus.Completed)
     {
         StorageFile imageFile = asyncInfo.GetResults();
         radialController.Menu.Items.Add(RadialControllerMenuItem.CreateFromIcon("Custom Image", RandomAccessStreamReference.CreateFromFile(imageFile)));
     }
 }
Пример #12
0
        private void AddCustomIconItems()
        {
            menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item2", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item2.png"))));
            sliders.Add(slider2);
            toggles.Add(toggle2);

            menuItems.Add(RadialControllerMenuItem.CreateFromIcon("Item3", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Item3.png"))));
            sliders.Add(slider3);
            toggles.Add(toggle3);
        }
Пример #13
0
        public MainPage()
        {
            InitializeComponent();

            _controller = RadialController.CreateForCurrentView();
            var icon   = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreLogo.png"));
            var myItem = RadialControllerMenuItem.CreateFromIcon("El Bruno Sample App", icon);

            _controller.Menu.Items.Add(myItem);
            _controller.ButtonClicked   += ControllerButtonClicked;
            _controller.RotationChanged += ControllerRotationChanged;
        }
Пример #14
0
        private async void InitializeRadialController()
        {
            if (!ApiInformation.IsTypePresent(typeof(RadialController).FullName))
            {
                return;
            }

            if (RadialController.IsSupported())
            {
                myController = RadialController.CreateForCurrentView();
            }

            if (myController == null)
            {
                return;
            }

            myController.RotationResolutionInDegrees = 1;
            myController.UseAutomaticHapticFeedback  = false;

            await VM.InitializeTask;

            if (!isLoaded)
            {
                return;
            }

            RandomAccessStreamReference icon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreLogo.png"));

            // Create a menu item for the custom tool.
            myController.Menu.Items.Clear();

            if (VM.SupportsDimming)
            {
                myController.Menu.Items.Add(RadialControllerMenuItem.CreateFromIcon("Brightness", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Brightness.png"))));
            }
            if (VM.SupportsColor)
            {
                myController.Menu.Items.Add(RadialControllerMenuItem.CreateFromIcon("Saturation", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Saturation.png"))));
                myController.Menu.Items.Add(RadialControllerMenuItem.CreateFromIcon("Hue", RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/HueIcon.png"))));
            }

            var config = RadialControllerConfiguration.GetForCurrentView();

            config.SetDefaultMenuItems(new RadialControllerSystemMenuItemKind[] { });


            supportsHaptics               = ApiInformation.IsTypePresent("Windows.Devices.Haptics.SimpleHapticsController");
            myController.ButtonClicked   += MyController_ButtonClicked;
            myController.RotationChanged += MyController_RotationChanged;

            SurfaceDialTip.Visibility = Visibility.Visible;
        }
Пример #15
0
        private void ConfigureDialRotation()
        {
            var iconRotate = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Rotate.png"));
            var itemRotate = RadialControllerMenuItem.CreateFromIcon("Rotate", iconRotate);
            var controller = RadialController.CreateForCurrentView();

            controller.Menu.Items.Add(itemRotate);
            controller.RotationChanged += ControllerOnRotationChanged;

            var config = RadialControllerConfiguration.GetForCurrentView();

            config.SetDefaultMenuItems(new RadialControllerSystemMenuItemKind[] { });
        }
Пример #16
0
        /// <summary>
        /// 初期化処理
        /// </summary>
        public void Initialize()
        {
#if NETFX_CORE
            this.control = RadialController.CreateForCurrentView();

            // オリジナルのメニューを追加
            var icon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/CatHand.png"));
            var item = RadialControllerMenuItem.CreateFromIcon("Play Game", icon);
            this.control.Menu.Items.Add(item);

            // イベントの購読
            this.control.ButtonClicked   += this.OnButtonClicked;
            this.control.RotationChanged += this.OnRotationChanged;
#endif
        }
        /// <summary>
        /// Create custom menu items for all tools.
        /// </summary>
        private void CreateMenuItems()
        {
            // Enumerate all UI elements.
            // Used for UI feedback to indicate current control region.
            containers = new List <StackPanel> {
                Stack0, Stack1
            };
            // Used for rotate actions.
            sliders = new List <Slider> {
                RotationSlider0, RotationSlider1
            };
            // Used for click actions.
            toggles = new List <ToggleSwitch> {
                ClickToggle0, ClickToggle1
            };
            // Used for click actions.
            subheads = new List <TextBlock> {
                SubHeading0, SubHeading1
            };

            // Create icons for the custom tools.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(
                    new Uri("ms-appx:///Assets/StoreLogo.png"));

            // Enumerate custom menu items for each control region.
            menuItems = new List <RadialControllerMenuItem>
            {
                // RadialController menu adds built-in ink menu items by default.
                // We need to create other custom tools manually.
                RadialControllerMenuItem.CreateFromIcon("Tool0", icon),
                RadialControllerMenuItem.CreateFromIcon("Tool1", icon)
            };

            // Create and configure custom menu items.
            for (int i = 0; i < menuItems.Count; ++i)
            {
                RadialControllerMenuItem radialControllerMenuItem =
                    menuItems[i];

                radialControllerMenuItem.Tag = i;

                AddToLog("\n" + menuItems[i].DisplayText + " created");

                radialControllerMenuItem.Invoked +=
                    (sender, args) => { OnItemInvoked(radialControllerMenuItem.Tag); };
            }
        }
Пример #18
0
        public MainPage()
        {
            this.InitializeComponent();
            // inizializzo l'oggetto
            controller = RadialController.CreateForCurrentView();
            // creo una icona per lo strumento personalizzato
            RandomAccessStreamReference icon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreLogo.png"));
            // creo un menu item per lo strumento personalizzato
            RadialControllerMenuItem myItem = RadialControllerMenuItem.CreateFromIcon("Sample", icon);

            // aggiungo lo strumento personalizzato al menu di RadialController
            controller.Menu.Items.Add(myItem);
            // aggiungo gli handler per gli eventi del RadialController
            controller.ButtonClicked   += Controller_ButtonClicked;
            controller.RotationChanged += Controller_RotationChanged;
        }
Пример #19
0
        public MainPage()
        {
            this.InitializeComponent();

            colourShower = new ShowColourHue();

            // Create a reference to the RadialController.
            var supported = RadialController.IsSupported();

            if (!supported)
            {
                return;
            }
            var controller = RadialController.CreateForCurrentView();

            // Create the icons for the dial menu
            var iconBright = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/bright.png"));
            var iconColor  = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Color.png"));

            // Create the items for the menu
            var itemBright = RadialControllerMenuItem.CreateFromIcon("Bright", iconBright);
            var itemColor  = RadialControllerMenuItem.CreateFromIcon("Color", iconColor);

            // Add the items to the menu
            controller.Menu.Items.Add(itemBright);
            controller.Menu.Items.Add(itemColor);

            // Select the correct tool when the item is selected
            itemBright.Invoked += (s, e) => _currentTool = CurrentTool.Bright;
            itemColor.Invoked  += (s, e) => _currentTool = CurrentTool.Color;

            // Get all named colors and create brushes from them
            _namedBrushes = typeof(Colors).GetRuntimeProperties().Select(c => new SolidColorBrush((Color)c.GetValue(null))).ToList();

            controller.RotationChanged += ControllerRotationChanged;

            // Leave only the Volume default item - Zoom and Undo won't be used
            RadialControllerConfiguration config = RadialControllerConfiguration.GetForCurrentView();

            config.SetDefaultMenuItems(new[] { RadialControllerSystemMenuItemKind.Volume });
        }
Пример #20
0
        public MainPage()
        {
            this.InitializeComponent();
            // Create a reference to the RadialController.
            myController = RadialController.CreateForCurrentView();

            // Create an icon for the custom tool.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(
                    new Uri("ms-appx:///Assets/StoreLogo.png"));

            // Create a menu item for the custom tool.
            RadialControllerMenuItem myItem =
                RadialControllerMenuItem.CreateFromIcon("Sample", icon);

            // Add the custom tool to the RadialController menu.
            myController.Menu.Items.Add(myItem);

            // Declare input handlers for the RadialController.
            myController.ButtonClicked   += MyController_ButtonClicked;
            myController.RotationChanged += MyController_RotationChanged;
        }
Пример #21
0
        public MainPage()
        {
            this.InitializeComponent();
            Game          = new Game(gameCanvas);
            Game.EndGame += Game_EndGame;
            // GamepadListener();
            Gamepad.GamepadAdded += Gamepad_GamepadAdded;


            myController = RadialController.CreateForCurrentView();

            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(
                    new Uri("ms-appx:///Assets/18-monkey-with-banana.png"));

            RadialControllerMenuItem myItem =
                RadialControllerMenuItem.CreateFromIcon("START!", icon);

            myItem.Invoked += MyItem_Invoked;
            myController.Menu.Items.Add(myItem);
            myController.RotationChanged           += MyController_RotationChanged;
            myController.UseAutomaticHapticFeedback = false;
        }
Пример #22
0
        public void AddMenuItem(string moniker, string iconFilePath)
        {
            if (_radialController.Menu.Items.Any(i => i.DisplayText == moniker))
            {
                return;
            }

            IAsyncOperation <StorageFile> operation = StorageFile.GetFileFromPathAsync(iconFilePath);

            operation.Completed += (asyncInfo, asyncStatus) =>
            {
                if (asyncStatus == AsyncStatus.Completed)
                {
                    StorageFile file     = asyncInfo.GetResults();
                    var         stream   = RandomAccessStreamReference.CreateFromFile(file);
                    var         menuItem = RadialControllerMenuItem.CreateFromIcon(moniker, stream);

                    ThreadHelper.Generic.BeginInvoke(DispatcherPriority.ApplicationIdle, () =>
                    {
                        _radialController.Menu.Items.Add(menuItem);
                    });
                }
            };
        }
Пример #23
0
        private void CreateDialControllerMenu()
        {
            dialController = RadialController.CreateForCurrentView();

            // Create an icon for the custom tool.
            RandomAccessStreamReference icon =
                RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/StoreLogo.png"));

            // Create opacity and blur menu items for the custom tool.
            RadialControllerMenuItem opacityItem = RadialControllerMenuItem.CreateFromIcon("Opacity", icon);

            opacityItem.Invoked += MenuItem_Invoked;

            RadialControllerMenuItem blurItem = RadialControllerMenuItem.CreateFromIcon("Blur", icon);

            blurItem.Invoked += MenuItem_Invoked;

            // Add the custom tool to the RadialController menu.
            dialController.Menu.Items.Add(opacityItem);
            dialController.Menu.Items.Add(blurItem);

            dialController.ButtonClicked   += Controller_ButtonClicked;
            dialController.RotationChanged += Controller_RotationChanged;
        }
Пример #24
0
        public MainPage()
        {
            this.InitializeComponent();

            cnc_controller = new Controller();

            radial_controller = RadialController.CreateForCurrentView();

            RadialControllerConfiguration myConfiguration = RadialControllerConfiguration.GetForCurrentView();

            myConfiguration.SetDefaultMenuItems(new[] {
                RadialControllerSystemMenuItemKind.Volume,
                RadialControllerSystemMenuItemKind.NextPreviousTrack
            });

            RandomAccessStreamReference xicon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/XAxis.64.png"));
            RandomAccessStreamReference yicon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/YAxis.64.png"));
            RandomAccessStreamReference zicon = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/ZAxis.64.png"));

            RadialControllerMenuItem xAxisItem = RadialControllerMenuItem.CreateFromIcon("X-Axis", xicon);
            RadialControllerMenuItem yAxisItem = RadialControllerMenuItem.CreateFromIcon("Y-Axis", yicon);
            RadialControllerMenuItem zAxisItem = RadialControllerMenuItem.CreateFromIcon("Z-Axis", zicon);

            xAxisItem.Tag = Axes.X;
            yAxisItem.Tag = Axes.Y;
            zAxisItem.Tag = Axes.Z;

            radial_controller.Menu.Items.Add(xAxisItem);
            radial_controller.Menu.Items.Add(yAxisItem);
            radial_controller.Menu.Items.Add(zAxisItem);

            radial_controller.UseAutomaticHapticFeedback  = true;
            radial_controller.RotationResolutionInDegrees = 5;

            radial_controller.RotationChanged += Controller_RotationChanged;
            radial_controller.ButtonClicked   += Controller_ButtonClicked;

            // foreach (var name in SerialPort.GetPortNames())
            // {
            //    port_select.Items.Add(name);
            // }

            port_select.SelectedIndex = 0;

            connect_button.Click += Connect_button_Click;
            stop_button.Click    += Stop_button_Click;
            //send_button.Click += Send_button_Click;
            unlock_button.Click += Unlock_button_Click;

            left_button.Click  += Left_button_Click;
            right_button.Click += Right_button_Click;

            x_set_text.LostFocus += X_set_text_LostFocus;
            y_set_text.LostFocus += Y_set_text_LostFocus;
            z_set_text.LostFocus += Z_set_text_LostFocus;

            live_checkBox.Checked       += Live_checkBox_Checked;
            live_checkBox.Unchecked     += Live_checkBox_Unchecked;
            go_button.Click             += Go_button_Click;
            to_origin_button.Click      += To_origin_button_Click;
            to_work_origin_button.Click += To_work_origin_button_Click;
            zero_work_button.Click      += Zero_work_button_Click;

            cnc_controller.StatusChanged   += Cnc_controller_StatusChanged;
            cnc_controller.PositionChanged += Cnc_controller_PositionChanged;
        }