예제 #1
0
        private void filterList_SelectionChanged(object sender, EventArgs e)
        {
            ControlBinding binding = (ControlBinding)ButtonMap.BindingA;

            ScriptableProperty prop = TargetPropertyCombo.SelectedItem as ScriptableProperty;

            if (prop != null)
            {
                if (binding.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                {
                    binding.Value = filterList.SelectedItem.ToString();
                }
            }
        }
예제 #2
0
        private void TargetPropertyCombo_SelectionChanged(object sender, EventArgs e)
        {
            if (ignoreChanges > 0)
            {
                return;
            }

            filterLabel.Visible = false;
            filterList.Visible  = false;

            ScriptableProperty prop    = TargetPropertyCombo.SelectedItem as ScriptableProperty;
            ControlBinding     binding = (ControlBinding)MapsView.SelectedItems[0].Tag;

            if (prop != null)
            {
                binding.PropertyName = prop.Name;
                binding.Max          = prop.Max;
                binding.Min          = prop.Min;
                binding.Integer      = prop.Type == ScriptablePropertyTypes.Integer;

                if (binding.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                {
                    filterLabel.Visible = true;
                    filterList.Visible  = true;
                    filterList.Items.Clear();
                    int index         = 0;
                    int selectedIndex = 0;
                    foreach (string name in ConstellationFilter.Families.Keys)
                    {
                        filterList.Items.Add(name);
                        if (name == binding.Value)
                        {
                            selectedIndex = index;
                        }
                        index++;
                    }
                    filterList.SelectedIndex = selectedIndex;
                }
            }
            else
            {
                if (TargetPropertyCombo.SelectedItem is string)
                {
                    binding.PropertyName = TargetPropertyCombo.SelectedItem.ToString();
                }
            }
            MapsView.SelectedItems[0].SubItems[1].Text = binding.ToString();
            MapsView.SelectedItems[0].SubItems[2].Text = binding.Parent.AutoRepeat ? "Repeat" : "Once";
            SetDirty();
        }
예제 #3
0
        private void TargetPropertyCombo_SelectionChanged(object sender, EventArgs e)
        {
            if (DeviceList.SelectedIndex > -1 && MapsView.SelectedIndices.Count > 0)
            {
                MidiMap midiMap = (MidiMap)DeviceList.SelectedItem;

                ControlBinding binding = (ControlBinding)MapsView.SelectedItems[0].Tag;

                ScriptableProperty prop = TargetPropertyCombo.SelectedItem as ScriptableProperty;

                filterLabel.Visible = false;
                filterList.Visible  = false;

                if (prop != null)
                {
                    binding.PropertyName = prop.Name;
                    binding.Max          = prop.Max;
                    binding.Min          = prop.Min;
                    binding.Integer      = prop.Type == ScriptablePropertyTypes.Integer;

                    if (binding.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                    {
                        filterLabel.Visible = true;
                        filterList.Visible  = true;
                        filterList.Items.Clear();
                        int index         = 0;
                        int selectedIndex = 0;
                        foreach (string name in ConstellationFilter.Families.Keys)
                        {
                            filterList.Items.Add(name);
                            if (name == binding.Value)
                            {
                                selectedIndex = index;
                            }
                            index++;
                        }
                        filterList.SelectedIndex = selectedIndex;
                    }
                }
                else
                {
                    if (TargetPropertyCombo.SelectedItem is string)
                    {
                        binding.PropertyName = TargetPropertyCombo.SelectedItem.ToString();
                    }
                }
                MapsView.SelectedItems[0].SubItems[4].Text = binding.ToString();
            }
        }
예제 #4
0
        private void filterList_SelectionChanged(object sender, EventArgs e)
        {
            ScriptableProperty prop    = TargetPropertyCombo.SelectedItem as ScriptableProperty;
            ControlBinding     binding = (ControlBinding)MapsView.SelectedItems[0].Tag;

            if (prop != null)
            {
                if (binding.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                {
                    binding.Value = filterList.SelectedItem.ToString();
                    SetDirty();
                }
            }

            MapsView.SelectedItems[0].SubItems[1].Text = binding.ToString();
            MapsView.SelectedItems[0].SubItems[2].Text = binding.Parent.AutoRepeat ? "Repeat" : "Once";
        }
예제 #5
0
        private void TargetPropertyCombo_SelectionChanged(object sender, EventArgs e)
        {
            ScriptableProperty prop = TargetPropertyCombo.SelectedItem as ScriptableProperty;


            filterLabel.Visible = false;
            filterList.Visible  = false;

            if (prop != null)
            {
                ButtonMap.BindingA.PropertyName = prop.Name;
                ButtonMap.BindingA.Max          = prop.Max;
                ButtonMap.BindingA.Min          = prop.Min;
                ButtonMap.BindingA.Integer      = prop.Type == ScriptablePropertyTypes.Integer;

                if (ButtonMap.BindingA.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                {
                    filterLabel.Visible = true;
                    filterList.Visible  = true;
                    filterList.Items.Clear();
                    int index         = 0;
                    int selectedIndex = 0;
                    foreach (string name in ConstellationFilter.Families.Keys)
                    {
                        filterList.Items.Add(name);
                        if (name == ButtonMap.BindingA.Value)
                        {
                            selectedIndex = index;
                        }
                        index++;
                    }
                    filterList.SelectedIndex = selectedIndex;
                }
            }
            else
            {
                if (TargetPropertyCombo.SelectedItem is string)
                {
                    ButtonMap.BindingA.PropertyName = TargetPropertyCombo.SelectedItem.ToString();
                }
            }
        }
예제 #6
0
        private void filterList_SelectionChanged(object sender, EventArgs e)
        {
            if (DeviceList.SelectedIndex > -1 && MapsView.SelectedIndices.Count > 0)
            {
                MidiMap midiMap = (MidiMap)DeviceList.SelectedItem;

                ControlBinding binding = (ControlBinding)MapsView.SelectedItems[0].Tag;

                ScriptableProperty prop = TargetPropertyCombo.SelectedItem as ScriptableProperty;

                if (prop != null)
                {
                    if (binding.BindingType == BindingType.SetValue && prop.Type == ScriptablePropertyTypes.ConstellationFilter)
                    {
                        binding.Value = filterList.SelectedItem.ToString();
                    }
                }
                MapsView.SelectedItems[0].SubItems[4].Text = binding.ToString();
            }
        }
예제 #7
0
        public static ScriptableProperty[] GetFilteredProperties(ScriptableProperty[] properties, BindingType bindType)
        {
            if (bindType == BindingType.Toggle)
            {
                //filter by toggle
                List<ScriptableProperty> filtered = new List<ScriptableProperty>();

                foreach (ScriptableProperty prop in properties)
                {
                    if (prop.Togglable)
                    {
                        filtered.Add(prop);
                    }
                }
                return filtered.ToArray();

            }
            else
            {
                return properties;
            }
        }