コード例 #1
0
ファイル: ItemEditBox.cs プロジェクト: konne88/MyInventory
		private ItemEditBox(Builder builder)
		: base(builder.GetRawObject("itemEditBox"))
		{
			builder.Autoconnect (this);
			
			itemEditWeight.ValueChanged += OnItemPropertyChanged;
			itemEditWarranty.ValueChanged += OnItemPropertyChanged;
			itemEditAmount.ValueChanged += OnItemPropertyChanged;
			itemEditUsefulLife.ValueChanged += OnItemPropertyChanged;
			itemEditCost.ValueChanged += OnItemPropertyChanged;
			itemEditDepreciationMethod.Changed += OnItemPropertyChanged;
			itemEditLabelMethod.Changed += OnItemPropertyChanged;
			
			itemEditName.ExposeEvent += OnExposeDescriptionEntry;
			itemEditMemo.ExposeEvent += OnExposeDescriptionEntry;
			itemEditBarcode.ExposeEvent += OnExposeDescriptionEntry;
			itemEditBrand.ExposeEvent += OnExposeDescriptionEntry;
			itemEditModel.ExposeEvent += OnExposeDescriptionEntry;
			itemEditZip.ExposeEvent += OnExposeDescriptionEntry;
			itemEditCity.ExposeEvent += OnExposeDescriptionEntry;
			itemEditStreet.ExposeEvent += OnExposeDescriptionEntry;
			itemEditCountry.ExposeEvent += OnExposeDescriptionEntry;
			itemEditPurchase.ExposeEvent += OnExposeDescriptionEntry;
			itemEditWarranty.ExposeEvent += OnExposeDescriptionEntry;
			itemEditWeight.ExposeEvent += OnExposeDescriptionEntry;
			itemEditCost.ExposeEvent += OnExposeDescriptionEntry;
			itemEditUsefulLife.ExposeEvent += OnExposeDescriptionEntry;
			itemEditAmount.ExposeEvent += OnExposeDescriptionEntry;
		}
コード例 #2
0
		public AddinInfoView ()
		{
			Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.AddinInfoView.ui", null);
			builder.Autoconnect (this);
			Add ((Box) builder.GetObject ("AddinInfoView"));
			AllowInstall = true;
			titleWidth = labelName.SizeRequest ().Width;
			
			HeaderBox hb = new HeaderBox (1,1,1,1);
			hb.Show ();
			hb.Replace (this);
			
			hb = new HeaderBox (1,0,0,0);
			hb.SetPadding (6,6,6,6);
			hb.Show ();
			hb.GradientBackround = true;
			hb.Replace (eboxButs);
			
			hb = new HeaderBox (0,1,0,0);
			hb.SetPadding (6,6,6,6);
			hb.Show ();
			hb.GradientBackround = true;
			hb.Replace (boxHeader);
			topHeaderBox = hb;

			//Enable our buttons for clicking
			btnDisable.Clicked += OnBtnDisableClicked;
			btnInstall.Clicked += OnBtnInstallClicked;
			btnUninstall.Clicked += OnBtnUninstallClicked;
			btnUpdate.Clicked += OnBtnUpdateClicked;
			urlButton.Clicked += OnUrlButtonClicked;

			ShowAll ();
		}
コード例 #3
0
		public ManageSitesDialog (SetupService service, Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			TransientFor = parent;
//			Services.PlaceDialog (this, parent);
			this.service = service;
			treeStore = new Gtk.ListStore (typeof (string), typeof (string), typeof(bool));
			repoTree.Model = treeStore;
			repoTree.HeadersVisible = false;
			var crt = new Gtk.CellRendererToggle ();
			crt.Toggled += HandleRepoToggled;
			repoTree.AppendColumn ("", crt, "active", 2);
			repoTree.AppendColumn ("", new Gtk.CellRendererText (), "markup", 1);
			repoTree.Selection.Changed += new EventHandler(OnSelect);
			
			AddinRepository[] reps = service.Repositories.GetRepositories ();
			foreach (AddinRepository rep in reps)
				AppendRepository (rep);

			btnRemove.Sensitive = false;

			//Wire buttons
			btnRemove.Clicked += OnRemove;
			btnAdd.Clicked += OnAdd;

			ShowAll ();
		}
コード例 #4
0
ファイル: Services.cs プロジェクト: wanglehui/mono-addins
		public static void ShowError (Exception ex, string message, Window parent, bool modal)
		{
			Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.ErrorDialog.ui", null);
			ErrorDialog dlg = new ErrorDialog (builder, builder.GetObject ("ErrorDialog").Handle);
			
			if (message == null) {
				if (ex != null)
					dlg.Message = string.Format (Catalog.GetString ("Exception occurred: {0}"), ex.Message);
				else {
					dlg.Message = "An unknown error occurred";
					dlg.AddDetails (Environment.StackTrace, false);
				}
			} else
				dlg.Message = message;
			
			if (ex != null) {
				dlg.AddDetails (string.Format (Catalog.GetString ("Exception occurred: {0}"), ex.Message) + "\n\n", true);
				dlg.AddDetails (ex.ToString (), false);
			}

			if (modal) {
				dlg.Run ();
				dlg.Destroy ();
			} else
				dlg.Show ();
		}
コード例 #5
0
ファイル: TaskTree.cs プロジェクト: loganek/loganek-planer
        public TaskTree(Builder builder)
        {
            builder.Autoconnect (this);

            filter = new TreeModelFilter (tasksList, null);
            filter.VisibleFunc = TasksTreeFilterFunc;
            tasksTreeView.Model = filter;

            tasksTreeView.Selection.Changed += TasksTreeView_Selection_Changed;

            showDoneCheckButton.Toggled += (sender, e) => filter.Refilter ();

            searchTaskButton.Clicked += (sender, e) => filter.Refilter ();

            searchTaskEntry.Activated += (sender, e) => filter.Refilter ();

            var toggleCell = new CellRendererToggle ();
            toggleCell.Toggled += ToggleCell_Toggled;
            AddColumn ("", toggleCell, null, new object[]{ "active", 1 });

            AddColumn ("Title", new CellRendererText (), RenderCell, new Object [] { "text", 2 });
            AddColumn ("Deadline", new CellRendererText (), RenderCell, new Object [] { "text", 3 });
            AddColumn ("Priority", new CellRendererText (), RenderCell, new Object [] { "text", 4 });

            TaskManager.Instance.TaskChanged += TaskChanged;
        }
コード例 #6
0
ファイル: LocationsBox.cs プロジェクト: konne88/MyInventory
		private LocationsBox(Builder builder)
		: base(builder.GetRawObject("locationsBox"))
		{
			builder.Autoconnect (this);
			
			locationsViewFilter.ExposeEvent += OnExposeDescriptionEntry;
		}
コード例 #7
0
		public MainWindow(Builder builder, IntPtr handle) : base(handle)
		{
			builder.Autoconnect(this);
			this.DeleteEvent +=  (o, args) => {
				Gtk.Application.Quit();
				args.RetVal = true;
			};
		}
コード例 #8
0
		#pragma warning restore 169


		static void Main(string[] args)
		{
			Application.Init();
			MyWidget.Register();
			Builder builder = new Builder(new System.IO.FileStream("CustomWidgetBuilder.ui", System.IO.FileMode.Open));
			MainWindow wnd = new MainWindow(builder, builder.GetObject("m_window").Handle);
			wnd.Show();
			Application.Run();
		}
コード例 #9
0
ファイル: Program.cs プロジェクト: loganek/loganek-planer
        public static void Main(string[] args)
        {
            Application.Init ();

            var builder = new Builder (null, "LoganekPlaner.Resources.loganek-planer.glade", null);
            var win = new MainWindow (builder);
            win.Show ();

            Application.Run ();
        }
コード例 #10
0
		public AddinInstallerDialog (AddinRegistry reg, string message, string[] addinIds,
		                             Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
			
			this.addinIds = addinIds;
			setup = new SetupService (reg);

			if (!CheckAddins (true))
				UpdateRepos ();
		}
コード例 #11
0
		public DemoThemingStyleClasses () : base ("Style Classes")
		{
			BorderWidth = 12;
			var builder = new Builder ("theming.ui");

			var grid = (Widget)builder.GetObject ("grid");
			grid.ShowAll ();
			Add (grid);

			Show ();
		}
コード例 #12
0
		public NewSiteDialog (Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			TransientFor = parent;
//			Services.PlaceDialog (this, parent);
			pathEntry.Sensitive = false;
			CheckValues ();

			//Wire buttons
			buttonBrowse.Clicked += OnButtonBrowseClicked;
			pathEntry.Changed += OnPathEntryChanged;
			urlText.Changed += OnUrlTextChanged;

			ShowAll ();
		}
コード例 #13
0
ファイル: TaskEditor.cs プロジェクト: loganek/loganek-planer
        public TaskEditor(Builder builder)
        {
            builder.Autoconnect (this);

            deadlineButton.Clicked += DeadlineButton_Clicked;;
            deadlineButton.Label = DateTime.Now.ToShortDateString ();

            noDeadlineCheckButton.Toggled += (sender, e) => deadlineButton.Sensitive = !noDeadlineCheckButton.Active;

            removeTaskButton.Clicked += RemoveTaskButton_Clicked;

            saveTaskButton.Clicked += SaveTaskButton_Clicked;

            InitPriorityComboBox ();
        }
コード例 #14
0
		public InstallDialog (SetupService service, Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
			this.service = service;
//			TransientFor = parent;
			WindowPosition = Gtk.WindowPosition.CenterOnParent;
//			Services.PlaceDialog (this, parent);
			boxProgress.Visible = false;
			Resizable = false;

			//Wire Buttons
			buttonOk.Clicked += OnButtonOkClicked;
			buttonCancel.Clicked += OnButtonCancelClicked;

			ShowAll ();
		}
コード例 #15
0
		protected AboutDialog (Window parent, Builder builder, IntPtr handle): base (handle)
		{
			this.builder = builder;
			this.builder.Autoconnect (this);
			if (parent != null)
				this.TransientFor = parent;
			/*
			ProgramName = "ProgramName";
			Version = "1.0.0.0";
			Copyright = "Copyright © 2015";
			Comments = "Este es el comentaria para del programa";
			Website = "https://github.com/orion75/MonoDevelop.Gtk3";
			WebsiteLabel = "Visitar la Página de MonoDevelop.Gtk3 addin";
			Authors = new string[] { "Harold alfonso Reina Herrera" };
			*/
		}
コード例 #16
0
ファイル: PrintDialog.cs プロジェクト: konne88/MyInventory
		private PrintDialog(Builder builder)
		: base(builder.GetRawObject("printDialog"))
		{
			builder.Autoconnect (this);
			
			pagePaddingX.ValueChanged += OnLayoutChanged;
			pagePaddingY.ValueChanged += OnLayoutChanged;
			labelRepeatX.ValueChanged += OnLayoutChanged;
			labelRepeatY.ValueChanged += OnLayoutChanged;
			labelWidth.ValueChanged += OnLayoutChanged;
			labelHeight.ValueChanged += OnLayoutChanged;
			useLabelDescription.Clicked += OnLayoutChanged;
			useLabelBarcode.Clicked += OnLayoutChanged;
			useLabelBarcodeText.Clicked += OnLayoutChanged;
			labelFont.FontSet += OnLayoutChanged;

			DeleteEvent += OnWindowDelete;
		}
コード例 #17
0
ファイル: ErrorDialog.cs プロジェクト: wanglehui/mono-addins
		public ErrorDialog (Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			TransientFor = parent;
			okButton.Clicked += new EventHandler (OnClose);
			expander.Activated += new EventHandler (OnExpanded);
			descriptionLabel.ModifyBg (StateType.Normal, new Gdk.Color (255,0,0));
			
			tagNoWrap = new TextTag ("nowrap");
			tagNoWrap.WrapMode = WrapMode.None;
			detailsTextView.Buffer.TagTable.Add (tagNoWrap);
			
			tagWrap = new TextTag ("wrap");
			tagWrap.WrapMode = WrapMode.Word;
			detailsTextView.Buffer.TagTable.Add (tagWrap);
			
			expander.Visible = false;

			ShowAll ();
		}
コード例 #18
0
        public HeaderBarWindow(string[] program_args)
            : base(program_args)
        {
            Process proc = new Process ();
            proc.StartInfo.FileName = "/bin/bash";
            proc.StartInfo.Arguments = "-c \"echo $XDG_CURRENT_DESKTOP\"";
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.Start ();

            while (!proc.StandardOutput.EndOfStream) {
                string line = proc.StandardOutput.ReadLine ();
                UseHeaderBar &= (line == "GNOME");
            }

            if (!UseHeaderBar)
                return;

            this.MainMenu = new Xwt.Menu();
            Xwt.GtkBackend.GtkEngine ge = new Xwt.GtkBackend.GtkEngine();
            var gtk_window = (Window)ge.GetNativeParentWindow(this.Content);

            Builder builder = new Builder(null, "HeaderBar.glade", null);
            headerbar1 = new HeaderBar(builder.GetObject("headerbar").Handle);
            builder.Autoconnect(this);

            gtk_window.Titlebar = headerbar1;
            headerbar1.ShowCloseButton = true;
            headerbar1.ShowAll();

            var saveas_menuitem = new MenuItem("Save As");
            saveas_menuitem.ButtonPressEvent += (o, args) => SaveAs();
            menu2.Add(saveas_menuitem);
            menu2.ShowAll();

            new_button.Clicked += NewClicked;
            open_button.Clicked += OpenClicked;
            save_button.Clicked += SaveClicked;

            ReloadTitle();
        }
コード例 #19
0
 public GladyWindow(WindowType windowType, string filename)
 {
     if (useGlade)
     {
         using (var file = App.GetEmbeddedResourceStream("glade." + filename + ".glade"))
         {
             Glade.XML gxml = new Glade.XML(file, gladeElementId, "");
             gxml.Autoconnect(this);
         }
     }
     else
     {
         using (var file = App.GetEmbeddedResourceStream("glade." + filename + ".gtk.xml"))
         {
             var builder = new Gtk.Builder();
             using (var reader = new StreamReader(file))
             {
                 builder.AddFromString(reader.ReadToEnd());
                 _window = builder.GetObject(gladeElementId) as Gtk.Window;
             }
         }
     }
     Window.Icon = Gdk.Pixbuf.LoadFromResource(App.GetEmbeddedResourceName("resources.app.png"));
 }
コード例 #20
0
ファイル: MainWindow.GUI.cs プロジェクト: Zodge/MonoGame
		protected virtual void Build ()
		{
			global::Stetic.Gui.Initialize (this);
			// Widget MonoGame.Tools.Pipeline.MainWindow
			this.UIManager = new global::Gtk.UIManager ();
			global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default");
			this.FileAction = new global::Gtk.Action ("FileAction", global::Mono.Unix.Catalog.GetString ("File"), null, null);
			this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("File");
			w1.Add (this.FileAction, null);
            this.NewAction = new global::Gtk.Action ("NewAction", global::Mono.Unix.Catalog.GetString ("New..."), null, "gtk-new");
			this.NewAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New...");
			w1.Add (this.NewAction, "<Control>n");
            this.OpenAction = new global::Gtk.Action ("OpenAction", global::Mono.Unix.Catalog.GetString ("Open..."), null, "gtk-open");
			this.OpenAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open...");
			w1.Add (this.OpenAction, "<Control>o");
			this.OpenRecentAction = new global::Gtk.Action ("OpenRecentAction", global::Mono.Unix.Catalog.GetString ("Open Recent"), null, null);
			this.OpenRecentAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Open Recent");
			w1.Add (this.OpenRecentAction, null);
            this.CloseAction = new global::Gtk.Action ("CloseAction", global::Mono.Unix.Catalog.GetString ("Close"), null, "gtk-close");
			this.CloseAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Close");
			w1.Add (this.CloseAction, null);
			this.ImportAction = new global::Gtk.Action ("ImportAction", global::Mono.Unix.Catalog.GetString ("Import..."), null, null);
			this.ImportAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Import...");
			w1.Add (this.ImportAction, null);
            this.SaveAction = new global::Gtk.Action ("SaveAction", global::Mono.Unix.Catalog.GetString ("Save"), null, "gtk-save");
			this.SaveAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save");
			w1.Add (this.SaveAction, "<Control>s");
            this.SaveAsAction = new global::Gtk.Action ("SaveAsAction", global::Mono.Unix.Catalog.GetString ("Save As..."), null, "gtk-save-as");
			this.SaveAsAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Save As...");
			w1.Add (this.SaveAsAction, null);
            this.ExitAction = new global::Gtk.Action ("ExitAction", global::Mono.Unix.Catalog.GetString ("Exit"), null, "gtk-quit");
			this.ExitAction.HideIfEmpty = false;
			this.ExitAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Exit");
			w1.Add (this.ExitAction, null);
			this.EditAction = new global::Gtk.Action ("EditAction", global::Mono.Unix.Catalog.GetString ("Edit"), null, null);
			this.EditAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Edit");
			w1.Add (this.EditAction, null);
            this.UndoAction = new global::Gtk.Action ("UndoAction", global::Mono.Unix.Catalog.GetString ("Undo"), null, "gtk-undo");
			this.UndoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Undo");
			w1.Add (this.UndoAction, "<Control>z");
            this.RedoAction = new global::Gtk.Action ("RedoAction", global::Mono.Unix.Catalog.GetString ("Redo"), null, "gtk-redo");
			this.RedoAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Redo");
			w1.Add (this.RedoAction, "<Control>y");
			RenameAction = new Action ("RenameAction", global::Mono.Unix.Catalog.GetString ("Rename"), null, null);
			RenameAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Rename");
			w1.Add (RenameAction, null);
            this.DeleteAction = new global::Gtk.Action ("DeleteAction", global::Mono.Unix.Catalog.GetString ("Delete"), null, "gtk-delete");
			this.DeleteAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Delete");
			w1.Add (this.DeleteAction, null);
			this.BuildAction = new global::Gtk.Action ("BuildAction", global::Mono.Unix.Catalog.GetString ("Build"), null, null);
			this.BuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Build");
			w1.Add (this.BuildAction, null);
            this.BuildAction1 = new global::Gtk.Action ("BuildAction1", global::Mono.Unix.Catalog.GetString ("Build"), null, "gtk-execute");
			this.BuildAction1.ShortLabel = global::Mono.Unix.Catalog.GetString ("Build");
			w1.Add (this.BuildAction1, "<Mod2>F6");
            this.RebuildAction = new global::Gtk.Action ("RebuildAction", global::Mono.Unix.Catalog.GetString ("Rebuild"), null, "gtk-execute");
			this.RebuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Rebuild");
			w1.Add (this.RebuildAction, null);
			this.CleanAction = new global::Gtk.Action ("CleanAction", global::Mono.Unix.Catalog.GetString ("Clean"), null, null);
			this.CleanAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Clean");
            w1.Add (this.CleanAction, null);
            this.DebugModeAction = new global::Gtk.ToggleAction ("DebugModeAction", global::Mono.Unix.Catalog.GetString ("Debug Mode"), null, null);
            this.DebugModeAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Debug Mode");
            w1.Add (this.DebugModeAction, null);
            this.FilterOutputAction = new global::Gtk.ToggleAction ("FilterOutputAction", global::Mono.Unix.Catalog.GetString ("Filter Output"), null, null);
            this.FilterOutputAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Filter Output");
            this.FilterOutputAction.Active = true;
            w1.Add (this.FilterOutputAction, null);
			this.HelpAction = new global::Gtk.Action ("HelpAction", global::Mono.Unix.Catalog.GetString ("Help"), null, null);
			this.HelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Help");
			w1.Add (this.HelpAction, null);
            this.ViewHelpAction = new global::Gtk.Action ("ViewHelpAction", global::Mono.Unix.Catalog.GetString ("View Help"), null, "gtk-help");
			this.ViewHelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("View Help");
			w1.Add (this.ViewHelpAction, "<Mod2>F1");
            this.AboutAction = new global::Gtk.Action ("AboutAction", global::Mono.Unix.Catalog.GetString ("About"), null, "gtk-about");
			this.AboutAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("About");
			w1.Add (this.AboutAction, null);
            this.CancelBuildAction = new global::Gtk.Action ("CancelBuildAction", global::Mono.Unix.Catalog.GetString ("Cancel Build"), null, "gtk-stop");
			this.CancelBuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Cancel Build");
			w1.Add (this.CancelBuildAction, null);
			this.AddAction = new global::Gtk.Action ("AddAction", global::Mono.Unix.Catalog.GetString ("Add"), null, null);
			this.AddAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add");
			w1.Add (this.AddAction, null);
            this.NewItemAction = new global::Gtk.Action ("NewItemAction", global::Mono.Unix.Catalog.GetString ("New Item..."), null, "gtk-file");
			this.NewItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New Item...");
			w1.Add (this.NewItemAction, null);
            this.NewFolderAction = new global::Gtk.Action ("NewFolderAction", global::Mono.Unix.Catalog.GetString ("New Folder..."), null, "gtk-directory");
			this.NewFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("New Folder...");
			w1.Add (this.NewFolderAction, null);
			this.ExistingItemAction = new global::Gtk.Action ("ExistingItemAction", global::Mono.Unix.Catalog.GetString ("Existing Item..."), null, null);
			this.ExistingItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add Existing Item...");
			w1.Add (this.ExistingItemAction, null);
			this.ExistingFolderAction = new global::Gtk.Action ("ExistingFolderAction", global::Mono.Unix.Catalog.GetString ("Existing Folder..."), null, null);
			this.ExistingFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Add Existing Folder...");
			w1.Add (this.ExistingFolderAction, null);
			this.UIManager.InsertActionGroup (w1, 0);
			this.AddAccelGroup (this.UIManager.AccelGroup);
			this.Name = "MonoGame.Tools.Pipeline.MainWindow";
			this.Icon = global::Gdk.Pixbuf.LoadFromResource ("MonoGame.Tools.Pipeline.App.ico");
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			// Container child MonoGame.Tools.Pipeline.MainWindow.Gtk.Container+ContainerChild
			this.vbox2 = new global::Gtk.VBox ();
			this.vbox2.Name = "vbox2";
			// Container child vbox2.Gtk.Box+BoxChild
            this.UIManager.AddUiFromString ("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewAction' action='NewAction'/><menuitem name='OpenAction' action='OpenAction'/><menuitem name='OpenRecentAction' action='OpenRecentAction'/><menuitem name='CloseAction' action='CloseAction'/><separator/><menuitem name='ImportAction' action='ImportAction'/><separator/><menuitem name='SaveAction' action='SaveAction'/><menuitem name='SaveAsAction' action='SaveAsAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='EditAction' action='EditAction'><menuitem name='UndoAction' action='UndoAction'/><menuitem name='RedoAction' action='RedoAction'/><separator/><menu name='AddAction' action='AddAction'><menuitem name='NewItemAction' action='NewItemAction'/><menuitem name='NewFolderAction' action='NewFolderAction'/><separator/><menuitem name='ExistingItemAction' action='ExistingItemAction'/><menuitem name='ExistingFolderAction' action='ExistingFolderAction'/></menu><separator/><menuitem name='RenameAction' action='RenameAction'/><menuitem name='DeleteAction' action='DeleteAction'/></menu><menu name='BuildAction' action='BuildAction'><menuitem name='BuildAction1' action='BuildAction1'/><menuitem name='RebuildAction' action='RebuildAction'/><menuitem name='CleanAction' action='CleanAction'/><menuitem name='CancelBuildAction' action='CancelBuildAction'/><separator name='sep1'/><menuitem name='DebugModeAction' action='DebugModeAction'/><menuitem name='FilterOutputAction' action='FilterOutputAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='ViewHelpAction' action='ViewHelpAction'/><separator/><menuitem name='AboutAction' action='AboutAction'/></menu></menubar></ui>");
			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar1")));
			this.menubar1.Name = "menubar1";
			this.vbox2.Add (this.menubar1);

            toolBar1 = new Toolbar();

            toolNew = new ToolButton(new Image(null, "Toolbar.New.png"), "New");
            toolNew.TooltipText = toolNew.Label;
            toolBar1.Add(toolNew);

            toolOpen = new ToolButton(new Image(null, "Toolbar.Open.png"), "Open");
            toolOpen.TooltipText = toolOpen.Label;
            toolBar1.Add(toolOpen);

            toolSave = new ToolButton(new Image(null, "Toolbar.Save.png"), "Save");
            toolSave.TooltipText = toolSave.Label;
            toolBar1.Add(toolSave);

            toolBar1.Add(new SeparatorToolItem());

            toolNewItem = new ToolButton(new Image(null, "Toolbar.NewItem.png"), "Add New Item");
            toolNewItem.TooltipText = toolNewItem.Label;
            toolBar1.Add(toolNewItem);

            toolAddItem = new ToolButton(new Image(null, "Toolbar.ExistingItem.png"), "Add Existing Item");
            toolAddItem.TooltipText = toolAddItem.Label;
            toolBar1.Add(toolAddItem);

            toolNewFolder = new ToolButton(new Image(null, "Toolbar.NewFolder.png"), "Add New Folder");
            toolNewFolder.TooltipText = toolNewFolder.Label;
            toolBar1.Add(toolNewFolder);

            toolAddFolder = new ToolButton(new Image(null, "Toolbar.ExistingFolder.png"), "Add Existing Folder");
            toolAddFolder.TooltipText = toolAddFolder.Label;
            toolBar1.Add(toolAddFolder);

            toolBar1.Add(new SeparatorToolItem());

            toolBuild = new ToolButton(new Image(null, "Toolbar.Build.png"), "Build");
            toolBuild.TooltipText = toolBuild.Label;
            toolBar1.Add(toolBuild);

            toolRebuild = new ToolButton(new Image(null, "Toolbar.Rebuild.png"), "Rebuild");
            toolRebuild.TooltipText = toolRebuild.Label;
            toolBar1.Add(toolRebuild);

            toolClean = new ToolButton(new Image(null, "Toolbar.Clean.png"), "Clean");
            toolClean.TooltipText = toolClean.Label;
            toolBar1.Add(toolClean);

            toolBar1.Add(new SeparatorToolItem());

            toolFilterOutput = new ToggleToolButton();
            toolFilterOutput.Label = toolFilterOutput.TooltipText = "Filter Output";
            toolFilterOutput.IconWidget = new Image(null, "Toolbar.FilterOutput.png");
            toolBar1.Add(toolFilterOutput);

            if (!Global.UseHeaderBar)
                this.vbox2.PackStart(toolBar1, false, true, 0);

			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.menubar1]));
			w2.Position = 0;
			w2.Expand = false;
			w2.Fill = false;
			// Container child vbox2.Gtk.Box+BoxChild
			this.hpaned1 = new global::Gtk.HPaned ();
			this.hpaned1.CanFocus = true;
			this.hpaned1.Name = "hpaned1";
			this.hpaned1.Position = 179;
			// Container child hpaned1.Gtk.Paned+PanedChild
			this.vpaned2 = new global::Gtk.VPaned ();
			this.vpaned2.CanFocus = true;
			this.vpaned2.Name = "vpaned2";
			this.vpaned2.Position = 247;
			// Container child vpaned2.Gtk.Paned+PanedChild
			this.projectview1 = new global::MonoGame.Tools.Pipeline.ProjectView ();
			this.projectview1.Events = ((global::Gdk.EventMask)(256));
			this.projectview1.Name = "projectview1";
			this.vpaned2.Add (this.projectview1);
			global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.projectview1]));
			w3.Resize = false;
			// Container child vpaned2.Gtk.Paned+PanedChild
			this.propertiesview1 = new global::MonoGame.Tools.Pipeline.PropertiesView ();
			this.propertiesview1.Events = ((global::Gdk.EventMask)(256));
			this.propertiesview1.Name = "propertiesview1";
			this.vpaned2.Add (this.propertiesview1);
			global::Gtk.Paned.PanedChild w4 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.propertiesview1]));
			w4.Resize = false;
			this.hpaned1.Add (this.vpaned2);
			global::Gtk.Paned.PanedChild w5 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vpaned2]));
			w5.Resize = false;
			// Container child hpaned1.Gtk.Paned+PanedChild
            buildOutput1 = new BuildOutput();
            this.hpaned1.Add (this.buildOutput1);
			this.vbox2.Add (this.hpaned1);
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hpaned1]));
			w8.Position = 2;
			this.Add (this.vbox2);

            treeview1 = new TreeView();

            #if GTK3
            if(Global.UseHeaderBar)
            {
                Builder builder = new Builder(null, "MonoGame.Tools.Pipeline.Gtk.MainWindow.HeaderBar.glade", null);
                hbar = new HeaderBar(builder.GetObject("headerbar").Handle);
                builder.Autoconnect(this);

                hbar.AttachToWindow(this);
                hbar.ShowCloseButton = true;
                hbar.Show();

                foreach(var o in menubar1.Children)
                {
                    menubar1.Remove(o);
                    menu2.Insert(o, 4);
                }

                new_button.Clicked += OnNewActionActivated;
                save_button.Clicked += OnSaveActionActivated;
                build_button.Clicked += OnBuildAction1Activated;
                rebuild_button.Clicked += OnRebuildActionActivated;
                cancel_button.Clicked += OnCancelBuildActionActivated;

                filteroutput_button.ButtonReleaseEvent += ToggleFilterOutput;
                filteroutput_button.Sensitive = true;

                vbox2.Remove (menubar1);

                open_menubutton = new MenuButton(open_button.Handle);
                var popover = new Popover(open_menubutton);

                var vbox = new VBox();
                vbox.WidthRequest = 350;
                vbox.HeightRequest = 300;

                Gtk3Wrapper.gtk_tree_view_set_activate_on_single_click(treeview1.Handle, true);
                treeview1.HeadersVisible = false;
                treeview1.EnableGridLines = TreeViewGridLines.Horizontal;
                treeview1.HoverSelection = true;
                treeview1.RowActivated += delegate(object o, RowActivatedArgs args) {
                    popover.Hide();

                    TreeIter iter;
                    if(!recentListStore.GetIter(out iter, args.Path))
                        return;

                    OpenProject(recentListStore.GetValue(iter, 1).ToString());
                };

                ScrolledWindow scroll1 = new ScrolledWindow();
                scroll1.WidthRequest = 350;
                scroll1.HeightRequest = 300;
                scroll1.Add(treeview1);

                vbox.PackStart(scroll1, true, true, 0);

                var openButton = new Button("Open Other...");
                openButton.Clicked += delegate(object sender, System.EventArgs e) {
                    popover.Hide();
                    OnOpenActionActivated(sender, e);
                };
                vbox.PackStart(openButton, false, true, 0);

                vbox.ShowAll();

                popover.Add(vbox);
                open_menubutton.Popup = popover;

            }
            #endif

            this.Title = basetitle;

			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.DefaultWidth = 751;
            this.DefaultHeight = 557;

            #if GTK3
            Gdk.Geometry geom = new Gdk.Geometry();
            geom.MinWidth = 400;
            geom.MinHeight = 300;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize);
            #endif

			this.Show ();
			this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
            this.NewAction.Activated += new global::System.EventHandler (this.OnNewActionActivated);
            this.toolNew.Clicked += OnNewActionActivated;
            this.OpenAction.Activated += new global::System.EventHandler (this.OnOpenActionActivated);
            this.toolOpen.Clicked += OnOpenActionActivated;
			this.CloseAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated);
			this.ImportAction.Activated += new global::System.EventHandler (this.OnImportActionActivated);
            this.SaveAction.Activated += new global::System.EventHandler (this.OnSaveActionActivated);
            this.toolSave.Clicked += OnSaveActionActivated;
			this.SaveAsAction.Activated += new global::System.EventHandler (this.OnSaveAsActionActivated);
            this.ExitAction.Activated += new global::System.EventHandler (this.OnExitActionActivated);
			this.UndoAction.Activated += new global::System.EventHandler (this.OnUndoActionActivated);
			this.RedoAction.Activated += new global::System.EventHandler (this.OnRedoActionActivated);
			RenameAction.Activated += this.OnRenameActionActivated;
			this.DeleteAction.Activated += new global::System.EventHandler (this.OnDeleteActionActivated);
			this.BuildAction1.Activated += new global::System.EventHandler (this.OnBuildAction1Activated);
            toolBuild.Clicked += OnBuildAction1Activated;
			this.RebuildAction.Activated += new global::System.EventHandler (this.OnRebuildActionActivated);
            toolRebuild.Clicked += OnRebuildActionActivated;
			this.CleanAction.Activated += new global::System.EventHandler (this.OnCleanActionActivated);
            toolClean.Clicked += OnCleanActionActivated;
			this.ViewHelpAction.Activated += new global::System.EventHandler (this.OnViewHelpActionActivated);
			this.AboutAction.Activated += new global::System.EventHandler (this.OnAboutActionActivated);
            this.NewItemAction.Activated += new global::System.EventHandler (this.OnNewItemActionActivated);
            this.toolNewItem.Clicked += OnNewItemActionActivated;
            this.NewFolderAction.Activated += new global::System.EventHandler (this.OnNewFolderActionActivated);
            this.toolNewFolder.Clicked += OnNewFolderActionActivated;
			this.ExistingItemAction.Activated += new global::System.EventHandler (this.OnAddItemActionActivated);
            this.toolAddItem.Clicked += OnAddItemActionActivated;
			this.ExistingFolderAction.Activated += new global::System.EventHandler (this.OnAddFolderActionActivated);
            this.toolAddFolder.Clicked += OnAddFolderActionActivated;
			this.DebugModeAction.Activated += new global::System.EventHandler (this.OnDebugModeActionActivated); 
            this.FilterOutputAction.Activated += OnFilterOutputActionActivated;
            this.toolFilterOutput.ButtonReleaseEvent += ToggleFilterOutput;
			this.CancelBuildAction.Activated += new global::System.EventHandler (this.OnCancelBuildActionActivated);
			this.SizeAllocated += MainWindow_SizeAllocated;
		}
コード例 #21
0
ファイル: TestForm1.cs プロジェクト: grbd/GBD.Blog.Examples
 /// <summary> Specialised constructor for use only by derived class. </summary>
 /// <param name="builder"> The builder. </param>
 /// <param name="handle">  The handle. </param>
 protected TestForm1(Builder builder, IntPtr handle) : base(handle)
 {
     _builder = builder;
     builder.Autoconnect(this);
     SetupHandlers();
 }
コード例 #22
0
ファイル: TestForm1.cs プロジェクト: grbd/GBD.Blog.Examples
#pragma warning restore 649

        #endregion

        #region Constructors / Destructors
        /// <summary> Default Shared Constructor. </summary>
        /// <returns> A TestForm1. </returns>
        public static TestForm1 Create()
        {
            Builder builder = new Builder(null, "GtkSharp_BasicForm1_CS.App.TestForm1.glade", null);
            return new TestForm1(builder, builder.GetObject("window1").Handle);
        }
コード例 #23
0
        protected void OnAdd(object sender, EventArgs e)
        {
            Gtk.Builder   builder = new Gtk.Builder(null, "Mono.Addins.GuiGtk3.interfaces.NewSiteDialog.ui", null);
            NewSiteDialog dlg     = new NewSiteDialog(builder, builder.GetObject("NewSiteDialog").Handle);

            try {
                if (dlg.Run())
                {
                    string url = dlg.Url;
                    if (!url.StartsWith("http://") && !url.StartsWith("https://") && !url.StartsWith("file://"))
                    {
                        url = "http://" + url;
                    }

                    try {
                        new Uri(url);
                    } catch {
                        Services.ShowError(null, "Invalid url: " + url, null, true);
                    }

                    if (!service.Repositories.ContainsRepository(url))
                    {
                        builder = new Gtk.Builder(null, "Mono.Addins.GuiGtk3.interfaces.ProgressDialog.ui", null);
                        ProgressDialog pdlg = new ProgressDialog(builder, builder.GetObject("ProgressDialog").Handle);
                        pdlg.Show();
                        pdlg.SetMessage(AddinManager.CurrentLocalizer.GetString("Registering repository"));

                        bool            done  = false;
                        AddinRepository rr    = null;
                        Exception       error = null;

                        ThreadPool.QueueUserWorkItem(delegate {
                            try {
                                rr = service.Repositories.RegisterRepository(pdlg, url, true);
                            } catch (System.Exception ex) {
                                error = ex;
                            } finally {
                                done = true;
                            }
                        });

                        while (!done)
                        {
                            if (Gtk.Application.EventsPending())
                            {
                                Gtk.Application.RunIteration();
                            }
                            else
                            {
                                Thread.Sleep(100);
                            }
                        }

                        pdlg.Destroy();

                        if (pdlg.HadError)
                        {
                            if (rr != null)
                            {
                                service.Repositories.RemoveRepository(rr.Url);
                            }
                            return;
                        }

                        if (error != null)
                        {
                            Services.ShowError(error, "The repository could not be registered", null, true);
                            return;
                        }

                        AppendRepository(rr);
                    }
                }
            } finally {
                dlg.Destroy();
            }
        }
コード例 #24
0
        private MainWindow(Gtk.Builder builder) : base(builder.GetObject("MainWindow").Handle)
        {
            builder.Autoconnect(this);
            DeleteEvent += Window_DeleteEvent;

            // Create a status bar context
            _fpsStatusbarContextID = _appStatusbar.GetContextId("FPS");

            // Create the scene editor
            _sceneGLWidget            = new SceneEditorWidget();
            _sceneGLWidget.FpsChange += SceneGLWidgetOnFpsChange;

            // Add the GL widget to the UI
            _sceneGLAlignement.Add(_sceneGLWidget);

            // AlienEngine logo
            _alienEngineLogoSquare.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.AlienEngineLogo");
            _alienEngineLogoSquare.Pixbuf = _alienEngineLogoSquare.Pixbuf.ScaleSimple(36, 36, Gdk.InterpType.Bilinear);

            // Command buttons
            _commandButtonMoveImage.Pixbuf       = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonMove");
            _commandButtonRotateImage.Pixbuf     = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonRotate");
            _commandButtonScaleImage.Pixbuf      = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonScale");
            _commandButtonGlobalViewImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonGlobal");
            _commandButtonLocalViewImage.Pixbuf  = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonLocal");

            // Toolbar buttons
            _commandButtonUndoImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonUndo");
            _commandButtonRedoImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonRedo");

            // Options buttons
            _optionButtonHelpImage.Pixbuf     = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonHelp");
            _optionButtonSettingsImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonSettings");
            _optionButtonProjectsImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonProjects");

            _sceneEditorGameElementsTreeView.RowActivated += _sceneEditorGameElementsTreeView_RowActivated;

            _sceneEditorTransformComponentTranstateSpinX.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentTranstateSpinY.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentTranstateSpinZ.SetRange(double.MinValue, double.MaxValue);

            _sceneEditorTransformComponentRotateSpinX.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentRotateSpinY.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentRotateSpinZ.SetRange(double.MinValue, double.MaxValue);

            _sceneEditorTransformComponentScaleSpinX.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentScaleSpinY.SetRange(double.MinValue, double.MaxValue);
            _sceneEditorTransformComponentScaleSpinZ.SetRange(double.MinValue, double.MaxValue);

            _sceneEditorTransformComponentRevealerSwitchImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Components.Transform");
            _sceneEditorTransformComponentRevealerSwitch.Clicked    += (sender, args) => _sceneEditorTransformComponentRevealer.RevealChild = !_sceneEditorTransformComponentRevealer.RevealChild;

            _sceneEditorTransformComponentTranslateImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.move");
            _sceneEditorTransformComponentRotateImage.Pixbuf    = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.rotate");
            _sceneEditorTransformComponentScaleImage.Pixbuf     = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.scale");

            _sceneEditorTransformComponentTranstateSpinX.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentTranstateSpinY.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentTranstateSpinZ.ValueChanged += _sceneEditorTransformComponentChanged;

            _sceneEditorTransformComponentRotateSpinX.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentRotateSpinY.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentRotateSpinZ.ValueChanged += _sceneEditorTransformComponentChanged;

            _sceneEditorTransformComponentScaleSpinX.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentScaleSpinY.ValueChanged += _sceneEditorTransformComponentChanged;
            _sceneEditorTransformComponentScaleSpinZ.ValueChanged += _sceneEditorTransformComponentChanged;

            SceneEditorGameElementsTree.SetTree(ref _sceneEditorGameElementsTreeStore, ref _sceneEditorGameElementsTreeView);
        }
コード例 #25
0
ファイル: Launcher.cs プロジェクト: Troposphir/AtmoLauncher
 public Launcher(LauncherSetup setup, Builder builder) {
     _setup = setup;
     _builder = builder;
 }
コード例 #26
0
ファイル: BuilderDialog.cs プロジェクト: GNOME/gbrainy
 public BuilderDialog(Builder builder, string dialogName)
     : base(builder.GetRawObject (dialogName))
 {
     builder.Autoconnect (this);
     IconName = "gbrainy";
 }
コード例 #27
0
ファイル: Builder.cs プロジェクト: xclaesse/gtk-sharp
 public SignalConnector(Builder builder, object handler)
 {
     this.builder = builder;
     this.handler = handler;
     handler_type = handler.GetType();
 }
コード例 #28
0
ファイル: Builder.cs プロジェクト: xclaesse/gtk-sharp
 public SignalConnector(Builder builder, Type handler_type)
 {
     this.builder      = builder;
     this.handler      = null;
     this.handler_type = handler_type;
 }
コード例 #29
0
		protected void OnAdd (object sender, EventArgs e)
		{
			Gtk.Builder builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.NewSiteDialog.ui", null);
			NewSiteDialog dlg = new NewSiteDialog (builder, builder.GetObject ("NewSiteDialog").Handle);
			try {
				if (dlg.Run ()) {
					string url = dlg.Url;
					if (!url.StartsWith ("http://") && !url.StartsWith ("https://") && !url.StartsWith ("file://")) {
						url = "http://" + url;
					}
					
					try {
						new Uri (url);
					} catch {
						Services.ShowError (null, "Invalid url: " + url, null, true);
					}
					
					if (!service.Repositories.ContainsRepository (url)) {
						builder = new Gtk.Builder (null, "Mono.Addins.GuiGtk3.interfaces.ProgressDialog.ui", null);
						ProgressDialog pdlg = new ProgressDialog (builder, builder.GetObject ("ProgressDialog").Handle);
						pdlg.Show ();
						pdlg.SetMessage (AddinManager.CurrentLocalizer.GetString ("Registering repository"));
						
						bool done = false;
						AddinRepository rr = null;
						Exception error = null;
						
						ThreadPool.QueueUserWorkItem (delegate {
							try {
								rr = service.Repositories.RegisterRepository (pdlg, url, true);
							} catch (System.Exception ex) {
								error = ex;
							} finally {
								done = true;
							}
						});
						
						while (!done) {
							if (Gtk.Application.EventsPending ())
								Gtk.Application.RunIteration ();
							else
								Thread.Sleep (100);
						}

						pdlg.Destroy ();
						
						if (pdlg.HadError) {
							if (rr != null)
								service.Repositories.RemoveRepository (rr.Url);
							return;
						}
						
						if (error != null) {
							Services.ShowError (error, "The repository could not be registered", null, true);
							return;
						}
						
						AppendRepository (rr);
					}
				}
			} finally {
				dlg.Destroy ();
			}
		}
コード例 #30
0
		public ProgressDialog (Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			Services.PlaceDialog (this, parent);
			ShowAll ();
		}
コード例 #31
0
ファイル: Builder.cs プロジェクト: Gankov/gtk-sharp
 public SignalConnector(Builder builder, Type handler_type)
 {
     this.builder = builder;
     this.handler = null;
     this.handler_type = handler_type;
 }
コード例 #32
0
ファイル: Builder.cs プロジェクト: Gankov/gtk-sharp
 public SignalConnector(Builder builder, object handler)
 {
     this.builder = builder;
     this.handler = handler;
     handler_type = handler.GetType ();
 }
コード例 #33
0
ファイル: Window.cs プロジェクト: konne88/MyInventory
        private Window(Builder builder)
            : base(builder.GetRawObject("myInventoryWindow"))
        {
            builder.Autoconnect (this);

            DeleteEvent += OnWindowDelete;
        }
コード例 #34
0
ファイル: Builder.cs プロジェクト: Gankov/gtk-sharp
            public void ConnectFunc(Builder builder, GLib.Object objekt, string signal_name, string handler_name, GLib.Object connect_object, GLib.ConnectFlags flags)
            {
                /* search for the event to connect */
                System.Reflection.MemberInfo[] evnts = objekt.GetType ().
                    FindMembers (System.Reflection.MemberTypes.Event,
                         System.Reflection.BindingFlags.Instance
                         | System.Reflection.BindingFlags.Static
                         | System.Reflection.BindingFlags.Public
                         | System.Reflection.BindingFlags.NonPublic,
                         new System.Reflection.MemberFilter (SignalFilter), signal_name);
                foreach (System.Reflection.EventInfo ei in evnts) {
                    bool connected = false;
                    System.Reflection.MethodInfo add = ei.GetAddMethod ();
                    System.Reflection.ParameterInfo[] addpi = add.GetParameters ();
                    if (addpi.Length == 1) { /* this should be always true, unless there's something broken */
                        Type delegate_type = addpi[0].ParameterType;

                        /* look for an instance method */
                        if (connect_object != null || handler != null)
                            try {
                                Delegate d = Delegate.CreateDelegate (delegate_type, connect_object != null ? connect_object : handler, handler_name);
                                add.Invoke (objekt, new object[] { d } );
                                connected = true;
                            } catch (ArgumentException) { /* ignore if there is not such instance method */
                            }

                        /* look for a static method if no instance method has been found */
                        if (!connected && handler_type != null)
                            try  {
                                Delegate d = Delegate.CreateDelegate (delegate_type, handler_type, handler_name);
                                add.Invoke (objekt, new object[] { d } );
                                connected = true;
                            } catch (ArgumentException) { /* ignore if there is not such static method */
                            }

                        if (!connected) {
                            string msg = ExplainError (ei.Name, delegate_type, handler_type, handler_name);
                            throw new HandlerNotFoundException (msg, handler_name, signal_name, ei, delegate_type);
                        }
                    }
                }
            }
コード例 #35
0
 private View(GtkLib.Builder builder) : base(builder.GetObject("View").Handle)
 {
     builder.Autoconnect(this);
 }