コード例 #1
0
        void LoadDesigner()
        {
            groupInfo = project.GetActionGroup(groupName);
            if (groupInfo == null)
            {
                // Group not found
                return;
            }

            group             = (Stetic.ActionGroupComponent)groupInfo.Component;
            project.Unloaded += OnDisposeProject;

            designer = project.SteticProject.CreateActionGroupDesigner(groupInfo, false);
            designer.AllowActionBinding = project.Project.UsePartialTypes;
            designer.BindField         += new EventHandler(OnBindField);

            ActionGroupPage actionsPage = new ActionGroupPage();

            actionsPage.PackStart(designer, true, true, 0);
            actionsPage.ShowAll();

            AddButton(GettextCatalog.GetString("Actions"), actionsPage);

            designer.ModifiedChanged      += OnGroupModified;
            designer.SignalAdded          += OnSignalAdded;
            designer.SignalChanged        += OnSignalChanged;
            designer.RootComponentChanged += OnRootComponentChanged;

            codeBinder = new CodeBinder(project.Project, new OpenDocumentFileProvider(), designer.RootComponent);
        }
コード例 #2
0
		void LoadDesigner ()
		{
			groupInfo = project.GetActionGroup (groupName);
			if (groupInfo == null)
				// Group not found
				return;
			
			group = (Stetic.ActionGroupComponent) groupInfo.Component;
			project.Unloaded += OnDisposeProject;
			
			designer = project.SteticProject.CreateActionGroupDesigner (groupInfo, false);
			designer.AllowActionBinding = project.Project.UsePartialTypes;
			designer.BindField += new EventHandler (OnBindField);
			
			ActionGroupPage actionsPage = new ActionGroupPage ();
			actionsPage.PackStart (designer, true, true, 0);
			actionsPage.ShowAll ();
			
			AddButton (GettextCatalog.GetString ("Actions"), actionsPage);
			
			designer.ModifiedChanged += OnGroupModified;
			designer.SignalAdded += OnSignalAdded;
			designer.SignalChanged += OnSignalChanged;
			designer.RootComponentChanged += OnRootComponentChanged;

			codeBinder = new CodeBinder (project.Project, new OpenDocumentFileProvider (), designer.RootComponent);
		}
コード例 #3
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;
        }