public AuxiliaryBindingEditor()
        {
            this.Content = new Scrollable
            {
                Border  = BorderType.None,
                Content = new StackLayout
                {
                    HorizontalContentAlignment = HorizontalAlignment.Stretch,
                    Spacing = 5,
                    Items   =
                    {
                        new Group
                        {
                            Text    = "Auxiliary",
                            Content = auxButtons = new BindingDisplayList
                            {
                                Prefix = "Auxiliary Binding"
                            }
                        }
                    }
                }
            };

            auxButtons.ItemSourceBinding.Bind(SettingsBinding.Child(c => (IList <PluginSettingStore>)c.AuxButtons));
        }
        public AbsoluteModeEditor()
        {
            this.Content = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Items =
                {
                    new StackLayoutItem
                    {
                        Expand  = true,
                        Control = new Group
                        {
                            Text    = "Display",
                            Content = displayAreaEditor = new DisplayAreaEditor
                            {
                                Unit = "px"
                            }
                        }
                    },
                    new StackLayoutItem
                    {
                        Expand  = true,
                        Control = new Group
                        {
                            Text    = "Tablet",
                            Content = tabletAreaEditor = new TabletAreaEditor
                            {
                                InvalidBackgroundError = "No tablet detected.",
                                Unit = "mm"
                            }
                        }
                    }
                }
            };

            displayAreaEditor.AreaBinding.Bind(SettingsBinding.Child(c => c.Display));
            displayAreaEditor.LockToUsableAreaBinding.Bind(App.Current, c => c.Settings.LockUsableAreaDisplay);

            tabletAreaEditor.AreaBinding.Bind(SettingsBinding.Child(c => c.Tablet));
            tabletAreaEditor.LockToUsableAreaBinding.Bind(App.Current, c => c.Settings.LockUsableAreaTablet);

            tabletAreaEditor.LockAspectRatioBinding.Bind(SettingsBinding.Child(c => c.LockAspectRatio));
            tabletAreaEditor.AreaClippingBinding.Bind(SettingsBinding.Child(c => c.EnableClipping));
            tabletAreaEditor.IgnoreOutsideAreaBinding.Bind(SettingsBinding.Child(c => c.EnableAreaLimiting));

            displayWidth  = SettingsBinding.Child(c => c.Display.Width);
            displayHeight = SettingsBinding.Child(c => c.Display.Height);
            tabletWidth   = SettingsBinding.Child(c => c.Tablet.Width);
            tabletHeight  = SettingsBinding.Child(c => c.Tablet.Height);
            tabletWidth.DataValueChanged   += HandleTabletAreaConstraint;
            tabletHeight.DataValueChanged  += HandleTabletAreaConstraint;
            displayWidth.DataValueChanged  += HandleDisplayAreaConstraint;
            displayHeight.DataValueChanged += HandleDisplayAreaConstraint;

            tabletAreaEditor.LockAspectRatioChanged += HookAspectRatioLock;
            HookAspectRatioLock(tabletAreaEditor, EventArgs.Empty);
        }
 public SettingsWindow(HotkeyCallback hotkeyCallback)
 {
     InitializeComponent();
     _settings       = new SettingsBinding();
     _hotkeyCallback = hotkeyCallback;
     QueryKeyEditor.SetHotkeyManagerSource(MainWindow.HotkeyManager);
     Settings.Default.PropertyChanged += Settings_PropertyChanged;
     _settings.MarketFlags             = MainWindow.AppraisalService.GetAvailableMarkets();
     MainWindow.AppraisalService.SetCurrentMarket(_settings.SelectedMarket);
 }
Beispiel #4
0
        public RelativeModeEditor()
        {
            this.Content = new Group
            {
                Text    = "Relative",
                Content = new StackLayout
                {
                    Orientation = Orientation.Horizontal,
                    HorizontalContentAlignment = HorizontalAlignment.Stretch,
                    VerticalContentAlignment   = VerticalAlignment.Top,
                    Spacing = 5,
                    Items   =
                    {
                        new StackLayoutItem(null, true),
                        new UnitGroup
                        {
                            Text        = "X Sensitivity",
                            Orientation = Orientation.Horizontal,
                            Unit        = "px/mm",
                            Content     = xSens = new FloatNumberBox()
                        },
                        new UnitGroup
                        {
                            Text        = "Y Sensitivity",
                            Orientation = Orientation.Horizontal,
                            Unit        = "px/mm",
                            Content     = ySens = new FloatNumberBox()
                        },
                        new UnitGroup
                        {
                            Text        = "Rotation",
                            Orientation = Orientation.Horizontal,
                            Unit        = "°",
                            Content     = rotation = new FloatNumberBox()
                        },
                        new UnitGroup
                        {
                            Text        = "Reset Time",
                            Orientation = Orientation.Horizontal,
                            Unit        = "ms",
                            Content     = resetTime = new FloatNumberBox()
                        },
                        new StackLayoutItem(null, true)
                    }
                }
            };

            xSens.ValueBinding.Bind(SettingsBinding.Child(s => s.XSensitivity));
            ySens.ValueBinding.Bind(SettingsBinding.Child(s => s.YSensitivity));
            rotation.ValueBinding.Bind(SettingsBinding.Child(s => s.RelativeRotation));
            resetTime.ValueBinding.Convert <TimeSpan>(
                c => TimeSpan.FromMilliseconds(c),
                v => (float)v.TotalMilliseconds
                ).Bind(SettingsBinding.Child(s => s.ResetTime));
        }
        public MouseBindingEditor()
        {
            this.Content = new Scrollable
            {
                Border  = BorderType.None,
                Content = new StackLayout
                {
                    HorizontalContentAlignment = HorizontalAlignment.Stretch,
                    Items =
                    {
                        new Group
                        {
                            Text    = "Mouse Buttons",
                            Content = mouseButtons = new MouseBindingDisplayList
                            {
                                Prefix = "Mouse Binding"
                            }
                        },
                        new Group
                        {
                            Text    = "Mouse Scrollwheel",
                            Content = new StackLayout
                            {
                                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                                Spacing = 5,
                                Items   =
                                {
                                    new Group
                                    {
                                        Text          = "Scroll Up",
                                        Orientation   = Orientation.Horizontal,
                                        ExpandContent = false,
                                        Content       = scrollUp = new BindingDisplay()
                                    },
                                    new Group
                                    {
                                        Text          = "Scroll Down",
                                        Orientation   = Orientation.Horizontal,
                                        ExpandContent = false,
                                        Content       = scrollDown = new BindingDisplay()
                                    }
                                }
                            }
                        }
                    }
                }
            };

            mouseButtons.ItemSourceBinding.Bind(SettingsBinding.Child(c => (IList <PluginSettingStore>)c.MouseButtons));
            scrollUp.StoreBinding.Bind(SettingsBinding.Child(c => c.MouseScrollUp));
            scrollDown.StoreBinding.Bind(SettingsBinding.Child(c => c.MouseScrollDown));
        }
        public BindingEditor()
        {
            this.Content = new TableLayout
            {
                Padding = 5,
                Rows    =
                {
                    new TableRow
                    {
                        Cells =
                        {
                            new TableCell
                            {
                                ScaleWidth = true,
                                Control    = new Group
                                {
                                    Text    = "Tip Bindings",
                                    Content = new StackView
                                    {
                                        Items =
                                        {
                                            new Group
                                            {
                                                Text          = "Tip Button",
                                                Orientation   = Orientation.Horizontal,
                                                ExpandContent = false,
                                                Content       = tipButton = new BindingDisplay
                                                {
                                                    MinimumSize = new Size(300, 0)
                                                }
                                            },
                                            new Group
                                            {
                                                Text        = "Tip Pressure",
                                                Orientation = Orientation.Horizontal,
                                                Content     = tipPressure = new FloatSlider()
                                            }
                                        }
                                    }
                                }
                            },
                            new TableCell
                            {
                                ScaleWidth = true,
                                Control    = new Group
                                {
                                    Text    = "Eraser Bindings",
                                    Content = new StackView
                                    {
                                        Items =
                                        {
                                            new Group
                                            {
                                                Text          = "Eraser Button",
                                                ExpandContent = false,
                                                Orientation   = Orientation.Horizontal,
                                                Content       = eraserButton = new BindingDisplay
                                                {
                                                    MinimumSize = new Size(300, 0)
                                                }
                                            },
                                            new Group
                                            {
                                                Text        = "Eraser Pressure",
                                                Orientation = Orientation.Horizontal,
                                                Content     = eraserPressure = new FloatSlider()
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    new TableRow
                    {
                        Cells =
                        {
                            new TableCell
                            {
                                ScaleWidth = true,
                                Control    = new Group
                                {
                                    Text    = "Pen Button Bindings",
                                    Content = new Scrollable
                                    {
                                        Border  = BorderType.None,
                                        Content = penButtons = new BindingDisplayList
                                        {
                                            Prefix = "Pen Button"
                                        }
                                    }
                                }
                            },
                            new TableCell
                            {
                                ScaleWidth = true,
                                Control    = new Group
                                {
                                    Text    = "Auxiliary Button Bindings",
                                    Content = new Scrollable
                                    {
                                        Border  = BorderType.None,
                                        Content = auxButtons = new BindingDisplayList
                                        {
                                            Prefix = "Auxiliary Button"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };

            tipButton.StoreBinding.Bind(SettingsBinding.Child(c => c.TipButton));
            eraserButton.StoreBinding.Bind(SettingsBinding.Child(c => c.EraserButton));
            tipPressure.ValueBinding.Bind(SettingsBinding.Child(c => c.TipActivationPressure));
            eraserPressure.ValueBinding.Bind(SettingsBinding.Child(c => c.EraserActivationPressure));
            penButtons.ItemSourceBinding.Bind(SettingsBinding.Child(c => (IList <PluginSettingStore>)c.PenButtons));
            auxButtons.ItemSourceBinding.Bind(SettingsBinding.Child(c => (IList <PluginSettingStore>)c.AuxButtons));
        }
        public PenBindingEditor()
        {
            this.Content = new Scrollable
            {
                Border  = BorderType.None,
                Content = new StackLayout
                {
                    HorizontalContentAlignment = HorizontalAlignment.Stretch,
                    Items =
                    {
                        new TableLayout
                        {
                            Rows =
                            {
                                new TableRow
                                {
                                    Cells =
                                    {
                                        new Group
                                        {
                                            Text    = "Tip Settings",
                                            Content = new StackLayout
                                            {
                                                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                                                Spacing = 5,
                                                Items   =
                                                {
                                                    new Group
                                                    {
                                                        Text          = "Tip Binding",
                                                        Orientation   = Orientation.Horizontal,
                                                        ExpandContent = false,
                                                        Content       = tipButton = new BindingDisplay()
                                                    },
                                                    new Group
                                                    {
                                                        Text        = "Tip Pressure",
                                                        ToolTip     = "The minimum threshold in order for the assigned binding to activate.",
                                                        Orientation = Orientation.Horizontal,
                                                        Content     = tipPressure = new FloatSlider()
                                                    }
                                                }
                                            }
                                        },
                                        new Group
                                        {
                                            Text    = "Eraser Settings",
                                            Content = new StackLayout
                                            {
                                                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                                                Spacing = 5,
                                                Items   =
                                                {
                                                    new Group
                                                    {
                                                        Text          = "Eraser Binding",
                                                        ExpandContent = false,
                                                        Orientation   = Orientation.Horizontal,
                                                        Content       = eraserButton = new BindingDisplay()
                                                    },
                                                    new Group
                                                    {
                                                        Text        = "Eraser Pressure",
                                                        ToolTip     = "The minimum threshold in order for the assigned binding to activate.",
                                                        Orientation = Orientation.Horizontal,
                                                        Content     = eraserPressure = new FloatSlider()
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        new Group
                        {
                            Text    = "Pen Buttons",
                            Content = penButtons = new BindingDisplayList
                            {
                                Prefix = "Pen Binding"
                            }
                        }
                    }
                }
            };

            tipButton.StoreBinding.Bind(SettingsBinding.Child(c => c.TipButton));
            eraserButton.StoreBinding.Bind(SettingsBinding.Child(c => c.EraserButton));
            tipPressure.ValueBinding.Bind(SettingsBinding.Child(c => c.TipActivationPressure));
            eraserPressure.ValueBinding.Bind(SettingsBinding.Child(c => c.EraserActivationPressure));
            penButtons.ItemSourceBinding.Bind(SettingsBinding.Child(c => (IList <PluginSettingStore>)c.PenButtons));
        }
Beispiel #8
0
        public SettingsWindow()
        {
            InitializeComponent();

            _settings = new SettingsBinding();
        }