예제 #1
0
        protected virtual void OnComboVisualizersChanged(object sender, EventArgs e)
        {
            var button = (ToggleButton)sender;

            if (!button.Active)              //Prevent un-toggling
            {
                button.Toggled -= OnComboVisualizersChanged;
                button.Active   = true;
                button.Toggled += OnComboVisualizersChanged;
                return;
            }
            if (currentWidget != null)
            {
                mainBox.Remove(currentWidget);
            }
            foreach (var b in buttons)
            {
                if (b != button && b.Active)
                {
                    b.Toggled -= OnComboVisualizersChanged;
                    b.Active   = false;
                    b.Toggled += OnComboVisualizersChanged;
                }
            }
            currentVisualizer    = visualizers [buttons.IndexOf(button)];
            currentWidget        = currentVisualizer.GetVisualizerWidget(value);
            buttonSave.Sensitive = currentVisualizer.CanEdit(value);
            mainBox.PackStart(currentWidget, true, true, 0);
            currentWidget.Show();
        }
		protected virtual void OnComboVisualizersChanged (object sender, System.EventArgs e)
		{
			if (currentWidget != null)
				mainBox.Remove (currentWidget);
			if (comboVisualizers.Active == -1) {
				buttonOk.Sensitive = false;
				return;
			}
			buttonOk.Sensitive = true;
			currentVisualizer = visualizers [comboVisualizers.Active];
			currentWidget = currentVisualizer.GetVisualizerWidget (value);
			mainBox.PackStart (currentWidget, true, true, 0);
			currentWidget.Show ();
		}
예제 #3
0
 protected virtual void OnComboVisualizersChanged(object sender, System.EventArgs e)
 {
     if (currentWidget != null)
     {
         mainBox.Remove(currentWidget);
     }
     if (comboVisualizers.Active == -1)
     {
         buttonOk.Sensitive = false;
         return;
     }
     buttonOk.Sensitive = true;
     currentVisualizer  = visualizers [comboVisualizers.Active];
     currentWidget      = currentVisualizer.GetVisualizerWidget(value);
     mainBox.PackStart(currentWidget, true, true, 0);
     currentWidget.Show();
 }
        void UpdateVisualizer(ToggleButton button)
        {
            if (currentWidget != null)
            {
                mainBox.Remove(currentWidget);
            }

            foreach (var b in buttons)
            {
                if (b != button && b.Active)
                {
                    SetToggleState(b, false);
                }
            }

            currentVisualizer    = visualizers [buttons.IndexOf(button)];
            currentWidget        = currentVisualizer.GetVisualizerWidget(value);
            buttonSave.Sensitive = currentVisualizer.CanEdit(value);
            mainBox.PackStart(currentWidget, true, true, 0);
            currentWidget.Show();
        }
		protected virtual void OnComboVisualizersChanged (object sender, EventArgs e)
		{
			var button = (ToggleButton)sender;
			if (!button.Active) {//Prevent un-toggling
				button.Toggled -= OnComboVisualizersChanged;
				button.Active = true;
				button.Toggled += OnComboVisualizersChanged;
				return;
			}
			if (currentWidget != null)
				mainBox.Remove (currentWidget);
			foreach (var b in buttons) {
				if (b != button && b.Active) {
					b.Toggled -= OnComboVisualizersChanged;
					b.Active = false;
					b.Toggled += OnComboVisualizersChanged;
				}
			}
			currentVisualizer = visualizers [buttons.IndexOf (button)];
			currentWidget = currentVisualizer.GetVisualizerWidget (value);
			buttonSave.Sensitive = currentVisualizer.CanEdit (value);
			mainBox.PackStart (currentWidget, true, true, 0);
			currentWidget.Show ();
		}