public void Add (string key, string control_name, Type enum_type, int[] enum_values)
		{
			PropertyEditor editor;
			Gtk.Widget control = gxml[control_name];

			if (control == null)
				throw new InvalidGladeKeyException (control_name);

			//if (control is Gnome.ColorPicker)
				//editor = new PropertyEditorColorPicker (key, (Gnome.ColorPicker) control);
			else if (control is Gnome.FileEntry)
				editor = new PropertyEditorFileEntry (key, (Gnome.FileEntry) control);
			else if (control is Gtk.SpinButton)
				editor = new PropertyEditorSpinButton (key, (Gtk.SpinButton) control);
			else if (control is Gtk.RadioButton)
				editor = new PropertyEditorRadioButton (key, (Gtk.RadioButton) control, enum_type, enum_values);
			else if (control is Gtk.ToggleButton)
				editor = new PropertyEditorToggleButton (key, (Gtk.ToggleButton) control);
			else if (control is Gtk.Entry)
				editor = new PropertyEditorEntry (key, (Gtk.Entry) control);
			/*else if (control is Gtk.OptionMenu)
				editor = new PropertyEditorOptionMenu (key, (Gtk.OptionMenu) control, enum_type, enum_values);*/
			else
				throw new EditorNotSupportedException ();

			by_key.Add (key, editor);
			Add (editor);
		}
Exemple #2
0
        public void Add(string key, string control_name, Type enum_type, int[] enum_values)
        {
            PropertyEditor editor;

            Gtk.Widget control = gxml[control_name];

            if (control == null)
            {
                throw new InvalidGladeKeyException(control_name);
            }

            //if (control is Gnome.ColorPicker)
            //editor = new PropertyEditorColorPicker (key, (Gnome.ColorPicker) control);
            else if (control is Gnome.FileEntry)
            {
                editor = new PropertyEditorFileEntry(key, (Gnome.FileEntry)control);
            }
            else if (control is Gtk.SpinButton)
            {
                editor = new PropertyEditorSpinButton(key, (Gtk.SpinButton)control);
            }
            else if (control is Gtk.RadioButton)
            {
                editor = new PropertyEditorRadioButton(key, (Gtk.RadioButton)control, enum_type, enum_values);
            }
            else if (control is Gtk.ToggleButton)
            {
                editor = new PropertyEditorToggleButton(key, (Gtk.ToggleButton)control);
            }
            else if (control is Gtk.Entry)
            {
                editor = new PropertyEditorEntry(key, (Gtk.Entry)control);
            }

            /*else if (control is Gtk.OptionMenu)
             *      editor = new PropertyEditorOptionMenu (key, (Gtk.OptionMenu) control, enum_type, enum_values);*/
            else
            {
                throw new EditorNotSupportedException();
            }

            by_key.Add(key, editor);
            Add(editor);
        }