private void BindTypeCombo_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; binding.BindingType = (BindingType)BindTypeCombo.SelectedIndex; UpdatePropertyCombo(); MapsView.SelectedItems[0].SubItems[4].Text = binding.ToString(); } }
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(); }
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(); } }
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"; }
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(); } }
private void UpdatePropertyCombo() { BindingTargetType tt = (BindingTargetType)TargetTypeCombo.SelectedIndex; TargetPropertyCombo.Items.Clear(); TargetPropertyCombo.ClearText(); filterLabel.Visible = false; filterList.Visible = false; if (DeviceList.SelectedIndex > -1 && MapsView.SelectedIndices.Count > 0) { MidiMap midiMap = (MidiMap)DeviceList.SelectedItem; ControlBinding binding = (ControlBinding)MapsView.SelectedItems[0].Tag; binding.TargetType = tt; IScriptable scriptInterface = null; bool comboVisible = true; switch (tt) { case BindingTargetType.Setting: scriptInterface = Settings.Active as IScriptable; break; case BindingTargetType.SpaceTimeController: scriptInterface = SpaceTimeController.ScriptInterface; break; case BindingTargetType.Goto: comboVisible = false; break; case BindingTargetType.Layer: scriptInterface = LayerManager.ScriptInterface; break; case BindingTargetType.Navigation: scriptInterface = Earth3d.MainWindow as IScriptable; break; //case BindingTargetType.Actions: // break; //case BindingTargetType.Key: // break; //case BindingTargetType.Mouse: // break; default: break; } if (comboVisible) { TargetPropertyCombo.Visible = true; PropertyNameText.Visible = false; BindTypeCombo.Visible = true; BindTypeLabel.Visible = true; if (scriptInterface != null) { switch (binding.BindingType) { case BindingType.Action: TargetPropertyCombo.Items.Clear(); TargetPropertyCombo.Items.AddRange(scriptInterface.GetActions()); break; case BindingType.Toggle: TargetPropertyCombo.Items.Clear(); TargetPropertyCombo.Items.AddRange(UiTools.GetFilteredProperties(scriptInterface.GetProperties(), binding.BindingType)); break; case BindingType.SyncValue: TargetPropertyCombo.Items.Clear(); TargetPropertyCombo.Items.AddRange(scriptInterface.GetProperties()); break; case BindingType.SetValue: TargetPropertyCombo.Items.Clear(); TargetPropertyCombo.Items.AddRange(scriptInterface.GetProperties()); break; default: break; } } TargetPropertyCombo.SelectedItem = binding.PropertyName; } else { PropertyNameText.Visible = true; TargetPropertyCombo.Visible = false; PropertyNameText.Text = binding.PropertyName; BindTypeCombo.Visible = false; BindTypeLabel.Visible = false; } MapsView.SelectedItems[0].SubItems[4].Text = binding.ToString(); UpdateSelectedControlMap(); } }