상속: ProjectItemInfo
예제 #1
0
        public object AddNewComponent(string fileName)
        {
            object ob        = ProjectBackend.AddNewComponent(fileName);
            object component = App.GetComponent(ob, null, null);

            if (component is WidgetComponent)
            {
                var        wc = (WidgetComponent)component;
                WidgetInfo wi = GetWidget(wc.Name);
                if (wi == null)
                {
                    wi = new WidgetInfo(this, wc);
                    widgets.Add(wi);
                }
                return(wi);
            }

            if (component is ActionGroupComponent)
            {
                var ac = (ActionGroupComponent)component;
                // Don't wait for the group added event to come to update the groups list since
                // it may be too late.
                ActionGroupInfo gi = GetActionGroup(ac.Name);
                if (gi == null)
                {
                    gi = new ActionGroupInfo(this, ac.Name);
                    groups.Add(gi);
                }
                return(gi);
            }

            return(null);
        }
예제 #2
0
        internal void NotifyWidgetNameChanged(object obj, string oldName, string newName, bool isRoot)
        {
            WidgetComponent c = obj != null ? (WidgetComponent)App.GetComponent(obj, null, null) : null;

            if (c != null)
            {
                c.UpdateName(newName);
            }

            if (isRoot)
            {
                WidgetInfo wi = GetWidget(oldName);
                if (wi != null)
                {
                    wi.NotifyNameChanged(newName);
                }
            }

            GuiDispatch.InvokeSync(
                delegate {
                if (c != null)
                {
                    if (ComponentNameChanged != null)
                    {
                        ComponentNameChanged(this, new ComponentNameEventArgs(this, c, oldName));
                    }
                }
            }
                );
        }
예제 #3
0
        static void OnProjectReloaded(object sender, EventArgs a)
        {
            if (WidgetNotebook.Page == -1)
            {
                return;
            }

            // Get the opened components

            int       active = WidgetNotebook.Page;
            ArrayList pages  = new ArrayList();

            while (WidgetNotebook.NPages > 0)
            {
                DesignerView view = (DesignerView)WidgetNotebook.GetNthPage(0);
                pages.Add(view.Component.Name);
                WidgetNotebook.Remove(view);
                view.Dispose();
            }
            openWindows.Clear();

            // Reopen the components
            foreach (string s in pages)
            {
                WidgetInfo w = Project.GetWidget(s);
                if (w != null)
                {
                    OpenWindow(w);
                }
            }
            WidgetNotebook.Page = active;
        }
예제 #4
0
        public WidgetInfo AddNewComponent(XmlElement template)
        {
            object          ob = ProjectBackend.AddNewWidgetFromTemplate(template.OuterXml);
            WidgetComponent wc = (WidgetComponent)App.GetComponent(ob, null, null);
            WidgetInfo      wi = GetWidget(wc.Name);

            if (wi == null)
            {
                wi = new WidgetInfo(this, wc);
                widgets.Add(wi);
            }
            return(wi);
        }
예제 #5
0
        static void OnSelectionChanged(object s, ComponentEventArgs args)
        {
            if (args.Component == null)
            {
                return;
            }
            WidgetInfo wi = Project.GetWidget(args.Component.Name);

            if (wi != null && IsWindowOpen(wi))
            {
                OpenWindow(wi);
            }
        }
예제 #6
0
        public WidgetInfo AddNewComponent(ComponentType type, string name)
        {
            object          ob = ProjectBackend.AddNewWidget(type.Name, name);
            WidgetComponent wc = (WidgetComponent)App.GetComponent(ob, null, null);
            WidgetInfo      wi = GetWidget(wc.Name);

            if (wi == null)
            {
                wi = new WidgetInfo(this, wc);
                widgets.Add(wi);
            }
            return(wi);
        }
예제 #7
0
 internal void NotifyWidgetRemoved(string name)
 {
     GuiDispatch.InvokeSync(
         delegate {
         WidgetInfo wi = GetWidget(name);
         if (wi != null)
         {
             widgets.Remove(wi);
             if (WidgetRemoved != null)
             {
                 WidgetRemoved(this, new WidgetInfoEventArgs(this, wi));
             }
         }
     }
         );
 }
예제 #8
0
 static void CloseWindow(WidgetInfo widget)
 {
     if (widget != null)
     {
         Gtk.Widget page = (Gtk.Widget)openWindows [widget];
         if (page != null)
         {
             WidgetNotebook.Remove(page);
             openWindows.Remove(widget);
             page.Dispose();
             if (openWindows.Count == 0)
             {
                 SteticApp.ActiveDesigner = null;
             }
         }
     }
 }
예제 #9
0
        public DesignerView(Stetic.Project project, ProjectItemInfo item)
        {
            this.widget = (WidgetInfo)item;

            // Widget design tab

            design = project.CreateWidgetDesigner(widget, true);

            // Actions design tab

            actionbox = design.CreateActionGroupDesigner();

            // Designers tab

            AppendPage(design, new Gtk.Label(Catalog.GetString("Designer")));
            AppendPage(actionbox, new Gtk.Label(Catalog.GetString("Actions")));
            TabPos = Gtk.PositionType.Bottom;
        }
예제 #10
0
파일: DesignerView.cs 프로젝트: mono/stetic
        public DesignerView(Stetic.Project project, ProjectItemInfo item)
        {
            this.widget = (WidgetInfo) item;

            // Widget design tab

            design = project.CreateWidgetDesigner (widget, true);

            // Actions design tab

            actionbox = design.CreateActionGroupDesigner ();

            // Designers tab

            AppendPage (design, new Gtk.Label (Catalog.GetString ("Designer")));
            AppendPage (actionbox, new Gtk.Label (Catalog.GetString ("Actions")));
            TabPos = Gtk.PositionType.Bottom;
        }
예제 #11
0
 internal void NotifyWidgetAdded(object obj, string name, string typeName)
 {
     GuiDispatch.InvokeSync(
         delegate {
         Component c = App.GetComponent(obj, name, typeName);
         if (c != null)
         {
             WidgetInfo wi = GetWidget(c.Name);
             if (wi == null)
             {
                 wi = new WidgetInfo(this, c);
                 widgets.Add(wi);
             }
             if (WidgetAdded != null)
             {
                 WidgetAdded(this, new WidgetInfoEventArgs(this, wi));
             }
         }
     }
         );
 }
예제 #12
0
        void ReadWidget(XmlTextReader reader)
        {
            WidgetInfo w = new WidgetInfo(this, reader.GetAttribute("id"), reader.GetAttribute("class"));

            widgets.Add(w);
            if (reader.IsEmptyElement)
            {
                reader.Skip();
                return;
            }
            reader.ReadStartElement();
            reader.MoveToContent();
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                if (reader.NodeType == XmlNodeType.Element && reader.LocalName == "action-group")
                {
                    w.AddGroup(reader.GetAttribute("name"));
                }
                reader.Skip();
                reader.MoveToContent();
            }
            reader.ReadEndElement();
        }
예제 #13
0
		internal void NotifyWidgetAdded (object obj, string name, string typeName)
		{
			GuiDispatch.InvokeSync (
				delegate {
					Component c = App.GetComponent (obj, name, typeName);
					if (c != null) {
						WidgetInfo wi = GetWidget (c.Name);
						if (wi == null) {
							wi = new WidgetInfo (this, c);
							widgets.Add (wi);
						}
						if (WidgetAdded != null)
							WidgetAdded (this, new WidgetInfoEventArgs (this, wi));
					}
				}
			);
		}
예제 #14
0
		public void RemoveComponent (WidgetInfo component)
		{
			ProjectBackend.RemoveWidget (component.Name);
		}
예제 #15
0
		public object AddNewComponent (string fileName)
		{
			object ob = ProjectBackend.AddNewComponent (fileName);
			object component = App.GetComponent (ob, null, null);
			
			if (component is WidgetComponent) {
				var wc = (WidgetComponent) component;
				WidgetInfo wi = GetWidget (wc.Name);
				if (wi == null) {
					wi = new WidgetInfo (this, wc);
					widgets.Add (wi);
				}
				return wi;
			}
				
			if (component is ActionGroupComponent) {
				var ac = (ActionGroupComponent) component;
				// Don't wait for the group added event to come to update the groups list since
				// it may be too late.
				ActionGroupInfo gi = GetActionGroup (ac.Name);
				if (gi == null) {
					gi = new ActionGroupInfo (this, ac.Name);
					groups.Add (gi);
				}
				return gi;
			}
			
			return null;
		}
예제 #16
0
		public WidgetInfo AddNewComponent (XmlElement template)
		{
			object ob = ProjectBackend.AddNewWidgetFromTemplate (template.OuterXml);
			WidgetComponent wc = (WidgetComponent) App.GetComponent (ob, null, null);
			WidgetInfo wi = GetWidget (wc.Name);
			if (wi == null) {
				wi = new WidgetInfo (this, wc);
				widgets.Add (wi);
			}
			return wi;
		}
예제 #17
0
		public WidgetInfo AddNewComponent (ComponentType type, string name)
		{
			object ob = ProjectBackend.AddNewWidget (type.Name, name);
			WidgetComponent wc = (WidgetComponent) App.GetComponent (ob, null, null);
			WidgetInfo wi = GetWidget (wc.Name);
			if (wi == null) {
				wi = new WidgetInfo (this, wc);
				widgets.Add (wi);
			} 
			return wi;
		}
예제 #18
0
//		public WidgetDesigner CreateWidgetDesigner (WidgetInfo widgetInfo, bool autoCommitChanges)
//		{
//			return new WidgetDesigner (this, widgetInfo.Name, autoCommitChanges);
//		}
		
		public WidgetDesigner CreateWidgetDesigner (WidgetInfo widgetInfo)
		{
			return new WidgetDesigner (this, widgetInfo.Name);
		}
예제 #19
0
		void ReadWidget (XmlTextReader reader)
		{
			WidgetInfo w = new WidgetInfo (this, reader.GetAttribute ("id"), reader.GetAttribute ("class"));
			widgets.Add (w);
			if (reader.IsEmptyElement) {
				reader.Skip ();
				return;
			}
			reader.ReadStartElement ();
			reader.MoveToContent ();
			while (reader.NodeType != XmlNodeType.EndElement) {
				if (reader.NodeType == XmlNodeType.Element && reader.LocalName == "action-group") {
					w.AddGroup (reader.GetAttribute ("name"));
				}
				reader.Skip ();
				reader.MoveToContent ();
			}
			reader.ReadEndElement ();
		}
		public WidgetDesigner CreateWidgetDesigner (WidgetInfo widgetInfo, bool autoCommitChanges)
		{
			return new WidgetDesigner (this, widgetInfo.Name, autoCommitChanges);
		}
예제 #21
0
 internal WidgetInfoEventArgs(Project p, WidgetInfo w)
 {
     project = p;
     widget  = w;
 }
예제 #22
0
 static bool IsWindowOpen(WidgetInfo component)
 {
     Gtk.Widget w = openWindows [component] as Gtk.Widget;
     return(w != null && w.Visible);
 }
예제 #23
0
파일: Stetic.cs 프로젝트: mono/stetic
 static void CloseWindow(WidgetInfo widget)
 {
     if (widget != null) {
         Gtk.Widget page = (Gtk.Widget) openWindows [widget];
         if (page != null) {
             WidgetNotebook.Remove (page);
             openWindows.Remove (widget);
             page.Dispose ();
             if (openWindows.Count == 0)
                 SteticApp.ActiveDesigner = null;
         }
     }
 }
예제 #24
0
 public void RemoveComponent(WidgetInfo component)
 {
     ProjectBackend.RemoveWidget(component.Name);
 }
예제 #25
0
 public WidgetDesigner CreateWidgetDesigner(WidgetInfo widgetInfo, bool autoCommitChanges)
 {
     return(new WidgetDesigner(this, widgetInfo.Name, autoCommitChanges));
 }
예제 #26
0
파일: Stetic.cs 프로젝트: mono/stetic
 static bool IsWindowOpen(WidgetInfo component)
 {
     Gtk.Widget w = openWindows [component] as Gtk.Widget;
     return w != null && w.Visible;
 }
예제 #27
0
//		public WidgetDesigner CreateWidgetDesigner (WidgetInfo widgetInfo, bool autoCommitChanges)
//		{
//			return new WidgetDesigner (this, widgetInfo.Name, autoCommitChanges);
//		}

        public WidgetDesigner CreateWidgetDesigner(WidgetInfo widgetInfo)
        {
            return(new WidgetDesigner(this, widgetInfo.Name));
        }