Наследование: System.MarshalByRefObject
Пример #1
0
		internal ActionGroupDesigner (Project project, string componentName, string actionGroupName, WidgetDesigner relatedWidgetDesigner, bool autoCommitChanges): base (project.App)
		{
			this.componentName = componentName;
			this.relatedWidgetDesigner = relatedWidgetDesigner;
			
			if (actionGroupName != null)
				this.actionGroupName = actionGroupName;
			this.autoCommitChanges = autoCommitChanges;
			this.project = project;

			frontend = new ActionGroupDesignerFrontend (this);

			CreateSession ();
		}
Пример #2
0
        internal ActionGroupDesigner(Project project, string componentName, string actionGroupName, WidgetDesigner relatedWidgetDesigner, bool autoCommitChanges) : base(project.App)
        {
            this.componentName         = componentName;
            this.relatedWidgetDesigner = relatedWidgetDesigner;

            if (actionGroupName != null)
            {
                this.actionGroupName = actionGroupName;
            }
            this.autoCommitChanges = autoCommitChanges;
            this.project           = project;

            frontend = new ActionGroupDesignerFrontend(this);

            CreateSession();
        }
Пример #3
0
        void Initialize(ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode)
        {
            this.frontend        = frontend;
            this.singleGroupMode = singleGroupMode;
            IconSize             = Gtk.IconSize.SmallToolbar;
            Orientation          = Gtk.Orientation.Horizontal;
            ToolbarStyle         = Gtk.ToolbarStyle.BothHoriz;

            combo = Gtk.ComboBox.NewText();

            if (!singleGroupMode)
            {
                combo.Changed += OnActiveChanged;

                Gtk.ToolItem comboItem = new Gtk.ToolItem();
                Gtk.HBox     cbox      = new Gtk.HBox();
                cbox.PackStart(new Gtk.Label(Catalog.GetString("Action Group:") + " "), false, false, 3);
                cbox.PackStart(combo, true, true, 3);
                comboItem.Add(cbox);
                comboItem.ShowAll();
                Insert(comboItem, -1);
                internalButtons.Add(comboItem);

                addButton          = new Gtk.ToolButton(Gtk.Stock.Add);
                addButton.Clicked += OnAddGroup;
                Insert(addButton, -1);
                internalButtons.Add(addButton);

                removeButton          = new Gtk.ToolButton(Gtk.Stock.Remove);
                removeButton.Clicked += OnRemoveGroup;
                Insert(removeButton, -1);
                internalButtons.Add(removeButton);

                ActionGroups = actionGroups;

                if (actionGroups != null && actionGroups.Count > 0)
                {
                    combo.Active = 0;
                }
            }
            else
            {
                UpdateActionCommands(null);
            }

            ShowAll();
        }
Пример #4
0
        public ActionGroupEditSession(ActionGroupDesignerFrontend frontend, ProjectBackend project, string containerName, string groupToEdit, bool autoCommitChanges)
        {
            this.groupToEdit       = groupToEdit;
            this.containerName     = containerName;
            this.frontend          = frontend;
            this.project           = project;
            this.autoCommitChanges = autoCommitChanges;

            if (groupToEdit != null)
            {
                group = project.ActionGroups [groupToEdit];
                if (group == null)
                {
                    throw new InvalidOperationException("Unknown action group: " + groupToEdit);
                }
                Load(group);
                undoManager            = new UndoRedoManager();
                undoQueue              = new UndoQueue();
                undoManager.UndoQueue  = undoQueue;
                undoManager.RootObject = groupCopy;

                groupToolbar = new ActionGroupToolbar(frontend, groupCopy);
            }
            else
            {
                if (!autoCommitChanges)
                {
                    throw new System.NotSupportedException();
                }

                Stetic.Wrapper.Container container = project.GetTopLevelWrapper(containerName, true);
                groupToolbar = new ActionGroupToolbar(frontend, container.LocalActionGroups);
            }

            // Don't delay the creation of the designer because when used in combination with the
            // widget designer, change events are subscribed since the begining

            designer = UserInterface.CreateActionGroupDesigner(project, groupToolbar);
            designer.Editor.GroupModified      += OnModified;
            designer.Toolbar.AllowActionBinding = allowActionBinding;
            designer.Destroyed += delegate
            {
                designer = null;
                Dispose();
            };
        }
		void Initialize (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode)
		{
			this.frontend = frontend;
			this.singleGroupMode = singleGroupMode;
			IconSize = Gtk.IconSize.SmallToolbar;
			Orientation = Gtk.Orientation.Horizontal;
			ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
			
			combo = Gtk.ComboBox.NewText ();
			
			if (!singleGroupMode) {
				combo.Changed += OnActiveChanged;

				Gtk.ToolItem comboItem = new Gtk.ToolItem ();
				Gtk.HBox cbox = new Gtk.HBox ();
				cbox.PackStart (new Gtk.Label (Catalog.GetString ("Action Group:") + " "), false, false, 3);
				cbox.PackStart (combo, true, true, 3);
				comboItem.Add (cbox);
				comboItem.ShowAll ();
				Insert (comboItem, -1);
				internalButtons.Add (comboItem);
				
				addButton = new Gtk.ToolButton (Gtk.Stock.Add);
				addButton.Clicked += OnAddGroup;
				Insert (addButton, -1);
				internalButtons.Add (addButton);
				
				removeButton = new Gtk.ToolButton (Gtk.Stock.Remove);
				removeButton.Clicked += OnRemoveGroup;
				Insert (removeButton, -1);
				internalButtons.Add (removeButton);
				
				ActionGroups = actionGroups;
				
				if (actionGroups != null && actionGroups.Count > 0)
					combo.Active = 0;
			} else {
				UpdateActionCommands (null);
			}

			ShowAll ();
		}
Пример #6
0
		public ActionGroupEditSession (ActionGroupDesignerFrontend frontend, ProjectBackend project, string containerName, string groupToEdit, bool autoCommitChanges)
		{
			this.groupToEdit = groupToEdit;
			this.containerName = containerName;
			this.frontend = frontend;
			this.project = project;
			this.autoCommitChanges = autoCommitChanges;
			
			if (groupToEdit != null) {
				group = project.ActionGroups [groupToEdit];
				if (group == null)
					throw new InvalidOperationException ("Unknown action group: " + groupToEdit);
				Load (group);
				undoManager = new UndoRedoManager ();
				undoQueue = new UndoQueue ();
				undoManager.UndoQueue = undoQueue;
				undoManager.RootObject = groupCopy;
				
				groupToolbar = new ActionGroupToolbar (frontend, groupCopy);
			}
			else {
				if (!autoCommitChanges)
					throw new System.NotSupportedException ();
				
				Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true);
				groupToolbar = new ActionGroupToolbar (frontend, container.LocalActionGroups);
			}
			
			// Don't delay the creation of the designer because when used in combination with the
			// widget designer, change events are subscribed since the begining
			
			designer = UserInterface.CreateActionGroupDesigner (project, groupToolbar);
			designer.Editor.GroupModified += OnModified;
			designer.Toolbar.AllowActionBinding = allowActionBinding;
			designer.Destroyed += delegate { designer = null; Dispose (); };
		}
Пример #7
0
 internal ActionGroupEditSession CreateLocalActionGroupDesignerSession(ActionGroupDesignerFrontend frontend, string windowName, bool autoCommitChanges)
 {
     return(new ActionGroupEditSession(frontend, this, windowName, null, autoCommitChanges));
 }
Пример #8
0
 internal ActionGroupEditSession CreateGlobalActionGroupDesignerSession(ActionGroupDesignerFrontend frontend, string groupName, bool autoCommitChanges)
 {
     return(new ActionGroupEditSession(frontend, this, null, groupName, autoCommitChanges));
 }
Пример #9
0
		internal ActionGroupEditSession CreateLocalActionGroupDesignerSession (ActionGroupDesignerFrontend frontend, string windowName, bool autoCommitChanges)
		{
			return new ActionGroupEditSession (frontend, this, windowName, null, autoCommitChanges);
		}
Пример #10
0
		internal ActionGroupEditSession CreateGlobalActionGroupDesignerSession (ActionGroupDesignerFrontend frontend, string groupName, bool autoCommitChanges)
		{
			return new ActionGroupEditSession (frontend, this, null, groupName, autoCommitChanges);
		}
Пример #11
0
 public ActionGroupToolbar(ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups)
 {
     Initialize(frontend, actionGroups, false);
 }
Пример #12
0
 public ActionGroupToolbar(ActionGroupDesignerFrontend frontend, Wrapper.ActionGroup actionGroup)
 {
     currentGroup = actionGroup;
     Initialize(frontend, null, true);
 }
Пример #13
0
 public ActionGroupToolbar(ActionGroupDesignerFrontend frontend, bool singleGroupMode)
 {
     Initialize(frontend, null, singleGroupMode);
 }
		public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups)
		{
			Initialize (frontend, actionGroups, false);
		}
		public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroup actionGroup)
		{
			currentGroup = actionGroup;
			Initialize (frontend, null, true);
		}
		public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, bool singleGroupMode)
		{
			Initialize (frontend, null, singleGroupMode);
		}