Inheritance: System.MarshalByRefObject
Example #1
0
        public UIManager(Project project)
        {
            ActionEntry[] entries = new ActionEntry[] {
                new ActionEntry ("FileMenu", null, Catalog.GetString ("_File"), null, null, null),
                new ActionEntry ("Open", Stock.Open, null, "<control>O", Catalog.GetString ("Open a file"), OpenFile),
                new ActionEntry ("RecentFiles", null, Catalog.GetString ("Recent files"), null, null, null),
                new ActionEntry ("Save", Stock.Save, null, "<control>S", Catalog.GetString ("Save"), SaveFile),
                new ActionEntry ("SaveAs", Stock.SaveAs, null, "<control><shift>S", Catalog.GetString ("Save As"), SaveFileAs),
                new ActionEntry ("ImportGlade", null, Catalog.GetString ("_Import from Glade File..."), null, Catalog.GetString ("Import UI from a Glade file"), ImportGlade),
                new ActionEntry ("ExportGlade", null, Catalog.GetString ("_Export to Glade File..."), null, Catalog.GetString ("Export UI to a Glade file"), ExportGlade),
                new ActionEntry ("Close", Stock.Close, null, "<control>W", Catalog.GetString ("Close"), Close),
                new ActionEntry ("Quit", Stock.Quit, null, "<control>Q", Catalog.GetString ("Quit"), Quit),

                new ActionEntry ("EditMenu", null, "_Edit", null, null, null),
                new ActionEntry ("Undo", Stock.Undo, null, "<control>Z", Catalog.GetString ("Undo previous action"), Undo),
                new ActionEntry ("Redo", Stock.Redo, null, "<control><shift>Z", Catalog.GetString ("Redo previously-undone action"), Redo),
                new ActionEntry ("Cut", Stock.Cut, null, "<control>X", Catalog.GetString ("Cut selection to clipboard"), Cut),
                new ActionEntry ("Copy", Stock.Copy, null, "<control>C", Catalog.GetString ("Copy selection to clipboard"), Copy),
                new ActionEntry ("Paste", Stock.Paste, null, "<control>V", Catalog.GetString ("Paste from clipboard"), Paste),
                new ActionEntry ("Delete", Stock.Delete, null, "Delete", Catalog.GetString ("Delete selection"), Delete),
                new ActionEntry ("LibraryManager", null, Catalog.GetString ("Widget libraries..."), null, null, ShowLibraryManager),

                new ActionEntry ("ProjectMenu", null, Catalog.GetString ("Project"), null, null, null),
                new ActionEntry ("EditProjectIcons", null, Catalog.GetString ("Project Icons..."), null, null, EditIcons),

                new ActionEntry ("HelpMenu", null, Catalog.GetString ("_Help"), null, null, null),
                new ActionEntry ("Contents", Stock.Help, Catalog.GetString ("_Contents"), "F1", Catalog.GetString ("Help"), Help),
                new ActionEntry ("About", Stock.About, null, null, Catalog.GetString ("About Stetic"), About),
            };

            ActionGroup actions = new ActionGroup ("group");
            actions.Add (entries);

            InsertActionGroup (actions, 0);
            AddUiFromString (menuXml);

            // Not yet implemented
            GetAction ("/menubar/HelpMenu/Contents").Sensitive = false;

            GetAction ("/menubar/FileMenu/Open").IsImportant = true;
            GetAction ("/menubar/FileMenu/Save").IsImportant = true;

            // Set up Edit menu sensitivity hackery
            Gtk.MenuItem editMenuItem = (Gtk.MenuItem) GetWidget ("/menubar/EditMenu");
            Gtk.Menu editMenu = (Gtk.Menu)editMenuItem.Submenu;
            editMenu.Shown += EditShown;
            editMenu.Hidden += EditHidden;

            Gtk.MenuItem recentMenuItem = (Gtk.MenuItem) GetWidget ("/menubar/FileMenu/RecentFiles");
            recentFilesMenu = new Gtk.Menu ();
            recentMenuItem.Submenu = recentFilesMenu;
            recentMenuItem.ShowAll ();

            ReadRecentFiles ();

            SteticMain.CurrentDesignerChanged += OnDesignerChanged;
            Project = project;
        }
		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 ();
		}
		internal WidgetDesigner (Project project, string componentName): base (project.App)
		{
			this.componentName = componentName;
			this.project = project;
			frontend = new WidgetDesignerFrontend (this);
			
			project.SignalAdded += OnSignalAdded;
			project.SignalRemoved += OnSignalRemoved;
			project.SignalChanged += OnSignalChanged;
			project.ComponentNameChanged += OnComponentNameChanged;
			project.ComponentTypesChanged += OnComponentTypesChanged;
			project.BackendChanged += OnProjectBackendChanged;
			
			CreateSession ();
		}
Example #4
0
		public void Dispose ()
		{
			// First of all, disconnect from the frontend,
			// to avoid sending notifications while disposing
			frontend = null;
			
			if (oldTopActionCollection != null)
				oldTopActionCollection.ActionGroupChanged -= OnComponentTypesChanged;

			Registry.RegistryChanging -= OnRegistryChanging;
			Registry.RegistryChanged -= OnRegistryChanged;
			Close ();
			iconFactory = null;
			ActionGroups = null;
			System.Runtime.Remoting.RemotingServices.Disconnect (this);
		}
Example #5
0
		internal WidgetDesigner (Project project, string componentName, bool autoCommitChanges): base (project.App)
		{
			this.componentName = componentName;
			this.autoCommitChanges = autoCommitChanges;
			this.project = project;
			frontend = new WidgetDesignerFrontend (this);
			
			if (autoCommitChanges)
				editedProject = project;
			else
				editedProject = new Project (project.App);
			
			editedProject.SignalAdded += OnSignalAdded;
			editedProject.SignalRemoved += OnSignalRemoved;
			editedProject.SignalChanged += OnSignalChanged;
			editedProject.ComponentNameChanged += OnComponentNameChanged;
			editedProject.ComponentTypesChanged += OnComponentTypesChanged;
			
			project.BackendChanged += OnProjectBackendChanged;
			editedProject.BackendChanged += OnProjectBackendChanged;
			
			CreateSession ();
		}
Example #6
0
		internal ActionGroupInfo (Project project, string name): base (project, name)
		{
		}
Example #7
0
		internal ActionGroupInfo (Project project, string name, string widgetName): base (project, name)
		{
			this.widgetName = widgetName;
		}
Example #8
0
		internal WidgetInfo (Project project, string name, string type): base (project, name)
		{
			this.type = type;
		}
Example #9
0
		internal WidgetInfo (Project project, Component c): base (project, c.Name)
		{
			type = c.Type.Name;
		}
Example #10
0
		internal void SetActiveDesignSession (Project p, WidgetEditSession session)
		{
			activeProject = p;
			Backend.ActiveProject = p != null ? p.ProjectBackend : null;
			Backend.SetActiveDesignSession (session);
		}
Example #11
0
		internal ProjectItemInfo (Project project, string name)
		{
			this.name = name;
			this.project = project;
		}
Example #12
0
		internal void SetFrontend (Project project)
		{
			frontend = project;
		}
		internal ComponentEventArgs (Project p, Component c)
		{
			project = p;
			component = c;
		}
Example #14
0
        static int GenerateCode(string file, string[] args, int n, GenerationOptions ops)
        {
            foreach (string lib in libraries)
                SteticApp.AddWidgetLibrary (lib);

            SteticApp.UpdateWidgetLibraries (false);

            Project[] projects = new Project [args.Length - n];
            for (int i=n; i<args.Length; i++)
                projects [i - n] = SteticApp.LoadProject (args [i]);

            CodeDomProvider provider = GetProvider (language);
            CodeGenerationResult res = SteticApp.GenerateProjectCode (file, "Stetic", provider, ops, projects);
            foreach (SteticCompilationUnit f in res.Units)
                Console.WriteLine ("Generated file: " + f.Name);
            foreach (string s in res.Warnings)
                Console.WriteLine ("WARNING: " + s);
            return 0;
        }
		public ComponentSignalEventArgs (Project p, Component c, Signal oldSignal, Signal signal): base (p, c)
		{
			this.oldSignal = oldSignal;
			this.signal = signal;
		}
		internal ComponentNameEventArgs (Project p, Component c, string oldName): base (p, c)
		{
			this.oldName = oldName;
		}
		internal ComponentRemovedEventArgs (Project p, string name)
		{
			project = p;
			componentName = name;
		}
Example #18
0
//		public Project LoadProject (string path, IProjectDesignInfo info)
//		{
//			Project p = new Project (this, info);
//			p.Load (path);
//			projects.Add (p);
//			p.Disposed += ProjectDisposed;
//			return p;
//		}
		
		public Project CreateProject (IProjectDesignInfo info)
		{
			Project p = new Project (this, info);
			projects.Add (p);
			p.Disposed += ProjectDisposed;
			return p;
		}
Example #19
0
 public void Fill(Project project)
 {
     store.Clear ();
     foreach (WidgetInfo wi in project.Widgets) {
         Gdk.Pixbuf pic = null;
         if (wi.IsWindow) {
             ClassDescriptor cd = Stetic.Registry.LookupClassByName ("Gtk.Window");
             if (cd != null)
                 pic = cd.Icon;
         } else {
             ClassDescriptor cd = Stetic.Registry.LookupClassByName ("Gtk.Bin");
             if (cd != null)
                 pic = cd.Icon;
         }
         store.AppendValues (wi, pic, wi.Name);
     }
 }
Example #20
0
		public Project LoadProject (string path)
		{
			Project p = new Project (this);
			p.Load (path);
			projects.Add (p);
			p.Disposed += ProjectDisposed;
			return p;
		}
Example #21
0
		public Project CreateProject ()
		{
			Project p = new Project (this);
			projects.Add (p);
			p.Disposed += ProjectDisposed;
			return p;
		}
Example #22
0
 internal void SetFrontend(Project project)
 {
     frontend = project;
 }