상속: 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);
		}