void CloseDesigner()
        {
            if (designer == null)
            {
                return;
            }

            gproject.Unloaded              -= OnDisposeProject;
            designer.BindField             -= OnBindWidgetField;
            designer.ModifiedChanged       -= OnWindowModifiedChanged;
            designer.SignalAdded           -= OnSignalAdded;
            designer.SignalRemoved         -= OnSignalRemoved;
            designer.SignalChanged         -= OnSignalChanged;
            designer.ComponentNameChanged  -= OnComponentNameChanged;
            designer.RootComponentChanged  -= OnRootComponentChanged;
            designer.ComponentTypesChanged -= OnComponentTypesChanged;

            if (actionsBox != null)
            {
                actionsBox.BindField       -= OnBindActionField;
                actionsBox.ModifiedChanged -= OnActionshanged;
                actionsBox = null;
            }

            actionsPage.ClearChild();
            designerPage.ClearChild();

            designerPage.Add(CreateDesignerNotAvailableWidget());
            actionsPage.Add(CreateDesignerNotAvailableWidget());

            designer = null;

            gproject.Reloaded += OnReloadProject;
        }
Exemple #2
0
        void LoadDesigner()
        {
            this.window = gproject.GetWindow(rootName);
            if (window == null)
            {
                // The window doesn't exist anymore
                return;
            }

            gproject.Unloaded += OnDisposeProject;

            designer = gproject.SteticProject.CreateWidgetDesigner(window.RootWidget, false);

            // Designer page
            designerPage.ClearChild();
            designerPage.Add(designer);

            if (designer.RootComponent == null)
            {
                // Something went wrong while creating the designer. Show it, but don't do aything else.
                designer.ShowAll();
                return;
            }

            /*
             * designer.AllowWidgetBinding = !gproject.Project.UsePartialTypes;
             *
             * codeBinder = new CodeBinder (gproject.Project, new OpenDocumentFileProvider (), designer.RootComponent);
             */
            designer.BindField             += OnBindWidgetField;
            designer.ModifiedChanged       += OnWindowModifiedChanged;
            designer.SignalAdded           += OnSignalAdded;
            designer.SignalRemoved         += OnSignalRemoved;
            designer.SignalChanged         += OnSignalChanged;
            designer.ComponentNameChanged  += OnComponentNameChanged;
            designer.RootComponentChanged  += OnRootComponentChanged;
            designer.ComponentTypesChanged += OnComponentTypesChanged;
            designer.ImportFileCallback     = ImportFile;

            // Actions designer
            actionsBox = designer.CreateActionGroupDesigner();
            //actionsBox.AllowActionBinding = !gproject.Project.UsePartialTypes;
            actionsBox.BindField       += new EventHandler(OnBindActionField);
            actionsBox.ModifiedChanged += new EventHandler(OnActionshanged);

            /*
             * actionsPage.ClearChild ();
             * actionsPage.PackStart (actionsBox, true, true, 0);
             * actionsPage.ShowAll ();
             *
             * if (actionsBox.HasData) {
             *      if (!HasPage (actionsPage))
             *              AddButton (GettextCatalog.GetString ("Actions"), actionsPage);
             * } else {
             *      RemoveButton (actionsPage);
             * }
             */
            designer.ShowAll();
            //GuiBuilderService.SteticApp.ActiveDesigner = designer;
        }
		void CloseDesigner ()
		{
			if (designer == null)
				return;
			
			gproject.Unloaded -= OnDisposeProject;
			designer.BindField -= OnBindWidgetField;
			designer.ModifiedChanged -= OnWindowModifiedChanged;
			designer.SignalAdded -= OnSignalAdded;
			designer.SignalRemoved -= OnSignalRemoved;
			designer.SignalChanged -= OnSignalChanged;
			designer.ComponentNameChanged -= OnComponentNameChanged;
			designer.RootComponentChanged -= OnRootComponentChanged;
			designer.ComponentTypesChanged -= OnComponentTypesChanged;
			
			if (actionsBox != null) {
				actionsBox.BindField -= OnBindActionField;
				actionsBox.ModifiedChanged -= OnActionshanged;
				actionsBox = null;
			}

			actionsPage.ClearChild ();
			designerPage.ClearChild ();
			
			designerPage.Add (CreateDesignerNotAvailableWidget ());
			actionsPage.Add (CreateDesignerNotAvailableWidget ());
			
			designer = null;
			
			gproject.Reloaded += OnReloadProject;
		}
		void LoadDesigner ()
		{
			this.window = gproject.GetWindow (rootName);
			if (window == null) {
				// The window doesn't exist anymore
				return;
			}
			
			gproject.Unloaded += OnDisposeProject;
			
			designer = gproject.SteticProject.CreateWidgetDesigner (window.RootWidget, false);
			
			// Designer page
			designerPage.ClearChild ();
			designerPage.Add (designer);
			
			if (designer.RootComponent == null) {
				// Something went wrong while creating the designer. Show it, but don't do aything else.
				designer.ShowAll ();
				return;
			}

			designer.AllowWidgetBinding = !gproject.Project.UsePartialTypes;
			
			codeBinder = new CodeBinder (gproject.Project, new OpenDocumentFileProvider (), designer.RootComponent);
			
			designer.BindField += OnBindWidgetField;
			designer.ModifiedChanged += OnWindowModifiedChanged;
			designer.SignalAdded += OnSignalAdded;
			designer.SignalRemoved += OnSignalRemoved;
			designer.SignalChanged += OnSignalChanged;
			designer.ComponentNameChanged += OnComponentNameChanged;
			designer.RootComponentChanged += OnRootComponentChanged;
			designer.ComponentTypesChanged += OnComponentTypesChanged;
			designer.ImportFileCallback = ImportFile;
			
			// Actions designer
			actionsBox = designer.CreateActionGroupDesigner ();
			actionsBox.AllowActionBinding = !gproject.Project.UsePartialTypes;
			actionsBox.BindField += new EventHandler (OnBindActionField);
			actionsBox.ModifiedChanged += new EventHandler (OnActionshanged);
			
			actionsPage.ClearChild ();
			actionsPage.PackStart (actionsBox, true, true, 0);
			actionsPage.ShowAll ();
			
			if (actionsBox.HasData) {
				if (!HasPage (actionsPage))
					AddButton (GettextCatalog.GetString ("Actions"), actionsPage);
			} else {
				RemoveButton (actionsPage);
			}
			
			designer.ShowAll ();
			GuiBuilderService.SteticApp.ActiveDesigner = designer;
		}