コード例 #1
0
ファイル: KeymapSettings.cs プロジェクト: unknownnf/Touchmote
        public void addToLayoutChooser(Keymap keymap)
        {
            if (this.isInLayoutChooser(keymap))
            {
                return;
            }

            JToken level1 = this.jsonObj.GetValue("LayoutChooser");

            if (level1 == null)
            {
                this.jsonObj.Add("LayoutChooser", new JArray());
            }
            level1 = this.jsonObj.GetValue("LayoutChooser");
            JArray array = (JArray)level1;

            JObject newObj = new JObject();

            newObj.Add("Title", keymap.getName());
            newObj.Add("Keymap", keymap.Filename);
            array.Add(newObj);

            this.jsonObj.Remove("LayoutChooser");
            this.jsonObj.Add("LayoutChooser", array);

            save();
        }
コード例 #2
0
        private void selectKeymap(Keymap keymap)
        {
            this.currentKeymap = keymap;

            this.tbKeymapTitle.Text = keymap.getName();
            string searchstring = KeymapDatabase.Current.getKeymapSettings().getSearchStringFor(this.currentKeymap);

            if (searchstring != null && searchstring != "")
            {
                this.tbApplicationSearch.Text       = searchstring;
                this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Black);
            }
            else
            {
                this.tbApplicationSearch.Text       = this.tbApplicationSearch.Tag.ToString();
                this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Gray);
            }
            this.cbApplicationSearch.IsChecked = KeymapDatabase.Current.getKeymapSettings().isInApplicationSearch(this.currentKeymap);
            this.cbLayoutChooser.IsChecked     = KeymapDatabase.Current.getKeymapSettings().isInLayoutChooser(this.currentKeymap);

            this.tbDelete.Visibility = this.currentKeymap.Filename == KeymapDatabase.Current.getKeymapSettings().getDefaultKeymap() ? Visibility.Hidden : Visibility.Visible;

            this.fillConnectionLists(keymap, 0);

            this.fillKeymapList(KeymapDatabase.Current.getAllKeymaps());
        }
コード例 #3
0
        public KeymapRow(Keymap keymap, bool active, bool defaultk)
        {
            InitializeComponent();
            this.keymap = keymap;
            this.tbName.Text = keymap.getName();

            if (active)
            {
                this.border.Background = highlightBrush;
            }
            else
            {
                this.border.MouseUp += border_MouseUp;
                this.border.Cursor = Cursors.Hand;
            }
            if (defaultk)
            {
                this.tbDefault.Visibility = Visibility.Visible;
            }
        }
コード例 #4
0
ファイル: KeymapRow.xaml.cs プロジェクト: unknownnf/Touchmote
        public Action <Keymap> OnClick; //filename

        public KeymapRow(Keymap keymap, bool active, bool defaultk)
        {
            InitializeComponent();
            this.keymap      = keymap;
            this.tbName.Text = keymap.getName();

            if (active)
            {
                this.border.Background = highlightBrush;
            }
            else
            {
                this.border.MouseUp += border_MouseUp;
                this.border.Cursor   = Cursors.Hand;
            }
            if (defaultk)
            {
                this.tbDefault.Visibility = Visibility.Visible;
            }
        }
コード例 #5
0
        public void addToLayoutChooser(Keymap keymap)
        {
            if (this.isInLayoutChooser(keymap))
            {
                return;
            }

            JToken level1 = this.jsonObj.GetValue("LayoutChooser");
            if (level1 == null)
            {
                this.jsonObj.Add("LayoutChooser",new JArray());
            }
            level1 = this.jsonObj.GetValue("LayoutChooser");
            JArray array = (JArray)level1;

            JObject newObj = new JObject();
            newObj.Add("Title", keymap.getName());
            newObj.Add("Keymap", keymap.Filename);
            array.Add(newObj);

            this.jsonObj.Remove("LayoutChooser");
            this.jsonObj.Add("LayoutChooser",array);

            save();
        }
コード例 #6
0
        private void selectKeymap(Keymap keymap)
        {
            this.currentKeymap = keymap;

            this.tbKeymapTitle.Text = keymap.getName();
            string searchstring = KeymapDatabase.Current.getKeymapSettings().getSearchStringFor(this.currentKeymap);
            if (searchstring != null && searchstring != "")
            {
                this.tbApplicationSearch.Text = searchstring;
                this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Black);
            }
            else
            {
                this.tbApplicationSearch.Text = this.tbApplicationSearch.Tag.ToString();
                this.tbApplicationSearch.Foreground = new SolidColorBrush(Colors.Gray);
            }
            this.cbApplicationSearch.IsChecked = KeymapDatabase.Current.getKeymapSettings().isInApplicationSearch(this.currentKeymap);
            this.cbLayoutChooser.IsChecked = KeymapDatabase.Current.getKeymapSettings().isInLayoutChooser(this.currentKeymap);

            this.tbDelete.Visibility = this.currentKeymap.Filename == KeymapDatabase.Current.getKeymapSettings().getDefaultKeymap() ? Visibility.Hidden : Visibility.Visible;

            this.fillConnectionLists(keymap, 0);

            this.fillKeymapList(KeymapDatabase.Current.getAllKeymaps());
        }