Пример #1
0
        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;
        }
Пример #2
0
		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;
		}
Пример #3
0
		private LocationsBox(Builder builder)
		: base(builder.GetRawObject("locationsBox"))
		{
			builder.Autoconnect (this);
			
			locationsViewFilter.ExposeEvent += OnExposeDescriptionEntry;
		}
Пример #4
0
        public FindReplaceWidget(DataBook db, IFinder iFinder)
        {
            finder   = iFinder;
            dataBook = db;

            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "FindReplacePlugin.ui"));
            builder.Autoconnect(this);

            this.Shown += OnWidgetShown;
            SearchPatternEntry.Activated  += OnSearchPatternEntryActivated;
            ReplacePatternEntry.Activated += OnReplacePatternEntryActivated;

            SearchPatternEntry.FocusGrabbed  += OnFocusGrabbed;
            ReplacePatternEntry.FocusGrabbed += OnFocusGrabbed;

            SearchAsComboBox.Active  = 0;
            ReplaceAsComboBox.Active = 0;

            SearchPatternEntry.Completion            = new EntryCompletion();
            SearchPatternEntry.Completion.Model      = new ListStore(typeof(string));
            SearchPatternEntry.Completion.TextColumn = 0;

            ReplacePatternEntry.Completion            = new EntryCompletion();
            ReplacePatternEntry.Completion.Model      = new ListStore(typeof(string));
            ReplacePatternEntry.Completion.TextColumn = 0;

            // initialize replace pattern
            replacePattern = new byte[0];

            this.Add(FindReplaceTable);
            this.ShowAll();
        }
Пример #5
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 ();
		}
Пример #6
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 ();
		}
Пример #7
0
        public SelectRangeWidget(DataBook db)
        {
            dataBook = db;

            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "SelectRangePlugin.ui"));
            builder.Autoconnect(this);

            // set up entry completions
            FromEntry.Completion            = new EntryCompletion();
            FromEntry.Completion.Model      = new ListStore(typeof(string));
            FromEntry.Completion.TextColumn = 0;

            ToEntry.Completion            = new EntryCompletion();
            ToEntry.Completion.Model      = new ListStore(typeof(string));
            ToEntry.Completion.TextColumn = 0;

            // set button sensitivity
            OnEntryChanged(null, null);

            this.Shown += OnWidgetShown;

            this.Add(SelectRangeHBox);
            this.ShowAll();
        }
Пример #8
0
		public MainWindow(Builder builder, IntPtr handle) : base(handle)
		{
			builder.Autoconnect(this);
			this.DeleteEvent +=  (o, args) => {
				Gtk.Application.Quit();
				args.RetVal = true;
			};
		}
Пример #9
0
        public ProgressDisplayBar()
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "ProgressDisplayPlugin.ui"));
            builder.Autoconnect(this);

            this.Add(ProgressBarHBox);
            this.Hide();
        }
Пример #10
0
        void InitWidget()
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "PreferencesDialog.ui"));
            builder.Autoconnect(this);

            LoadPreviousSessionCheckButton.Toggled     += OnLoadPreviousSessionToggled;
            AskBeforeLoadingSessionCheckButton.Toggled += AskBeforeLoadingSessionToggled;
            RememberCursorPositionCheckButton.Toggled  += RememberCursorPositionToggled;
            RememberWindowGeometryCheckButton.Toggled  += RememberWindowGeometryToggled;
        }
Пример #11
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 ();
		}
Пример #12
0
        void InitWidget()
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "PreferencesDialog.ui"));
            builder.Autoconnect(this);

            UndoLimitedRadioButton.Toggled     += OnUndoLimitedToggled;
            UndoActionsSpinButton.ValueChanged += OnUndoActionsValueChanged;

            KeepUndoAlwaysRadioButton.Toggled += OnKeepUndoAlwaysToggled;
            KeepUndoMemoryRadioButton.Toggled += OnKeepUndoMemoryToggled;
            KeepUndoNeverRadioButton.Toggled  += OnKeepUndoNeverToggled;
        }
Пример #13
0
        void InitWidget()
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "PreferencesDialog.ui"));
            builder.Autoconnect(this);

            SelectTempDirButton.Clicked += OnSelectTempDirButtonClicked;
            SelectLayoutButton.Clicked  += OnSelectLayoutClicked;

            LayoutFileEntry.Changed             += OnLayoutFileChanged;
            UseCurrentLayoutCheckButton.Toggled += OnUseCurrentLayoutToggled;
            DefaultEditModeComboBox.Changed     += OnDefaultEditModeChanged;
            TempDirEntry.FocusOutEvent          += OnTempDirFocusOutEvent;
        }
Пример #14
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 ();
		}
Пример #15
0
        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 ();
        }
Пример #16
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 ();
		}
Пример #17
0
        public ProgressDialog(string primary, Gtk.Window main) : base(primary)
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "ProgressDialog.ui"));
            builder.Autoconnect(this);

            // setup window
            this.SkipTaskbarHint = false;
            this.TypeHint        = Gdk.WindowTypeHint.Dialog;
            this.TransientFor    = main;
            this.BorderWidth     = 6;

            MessageLabel.Markup = "<span weight=\"bold\" size=\"larger\">" + primary + "</span>";

            this.Add(ProgressVBox);
            this.Hide();
        }
Пример #18
0
		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;
		}
Пример #19
0
		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 ();
		}
Пример #20
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();
        }
Пример #21
0
        public BitwiseOperationsWidget(DataBook db, Gtk.Action action)
        {
            dataBook      = db;
            performAction = action;

            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "BitwiseOperationsPlugin.ui"));
            builder.Autoconnect(this);

            OperationComboBox.Active = 0;
            OperandAsComboBox.Active = 0;
            numberBase = 16;

            // set button sensitivity
            OnOperandEntryChanged(null, null);

            this.Shown += OnWidgetShown;

            this.Add(BitwiseOperationsHBox);
            this.ShowAll();
        }
Пример #22
0
        public PreferencesDialog(Window parent)
            : base(Catalog.GetString("Bless Preferences"), parent, DialogFlags.DestroyWithParent)
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "PreferencesDialog.ui"));
            builder.Autoconnect(this);

            mainWindow = parent;

            generalPreferences = new GeneralPreferences(mainWindow);
            sessionPreferences = new SessionPreferences(mainWindow);
            undoPreferences    = new UndoPreferences(mainWindow);
            LoadPreferencesTreeView();

            this.Modal        = false;
            this.TransientFor = parent;
            this.BorderWidth  = 6;
            this.AddButton(Gtk.Stock.Close, ResponseType.Close);
            this.Response += new ResponseHandler(OnDialogResponse);
            this.VBox.Add(PreferencesPaned);
            this.VBox.ShowAll();
        }
Пример #23
0
        public ExportDialog(DataBook db, Gtk.Window mw)
            : base(Catalog.GetString("Export Bytes"), null, 0)
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "ExportDialog.ui"));
            builder.Autoconnect(this);

            dataBook      = db;
            mainWindow    = mw;
            pluginManager = PluginManager.GetForType(typeof(ExportPlugin));

            // initialize plugins if we have to
            if (pluginManager == null)
            {
                PluginManager.AddForType(typeof(ExportPlugin), new object[0]);
                pluginManager = PluginManager.GetForType(typeof(ExportPlugin));
            }

            exportFinishedEvent = new AutoResetEvent(false);

            SetupExportPlugins();

            ExportPatternComboEntry.Model      = new ListStore(typeof(string));
            ExportPatternComboEntry.TextColumn = 0;
            LoadFromPatternFile((ListStore)ExportPatternComboEntry.Model);

            ProgressHBox.Visible = false;
            cancelClicked        = false;

            this.Modal        = false;
            this.BorderWidth  = 6;
            this.HasSeparator = false;
            CloseButton       = (Gtk.Button) this.AddButton(Gtk.Stock.Close, ResponseType.Close);
            ExportButton      = (Gtk.Button) this.AddButton(Catalog.GetString("Export"), ResponseType.Ok);
            this.Response    += new ResponseHandler(OnDialogResponse);
            this.VBox.Add(ExportDialogVBox);
        }
Пример #24
0
        public ConversionTable(DataBook db)
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "ConversionTablePlugin.ui"));
            builder.Autoconnect(this);

            littleEndian  = true;
            unsignedAsHex = false;
            dataBook      = db;

            foreach (DataViewDisplay dvd in dataBook.Children)
            {
                OnDataViewAdded(dvd.View);
            }

            dataBook.PageAdded  += new DataView.DataViewEventHandler(OnDataViewAdded);
            dataBook.Removed    += new RemovedHandler(OnDataViewRemoved);
            dataBook.SwitchPage += new SwitchPageHandler(OnSwitchPage);

            Preferences.Proxy.Subscribe("Tools.ConversionTable.Show", "ct2", new PreferencesChangedHandler(OnPreferencesChanged));

            this.Add(ConversionTableWidget);
            this.ShowAll();
        }
Пример #25
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();
        }
Пример #26
0
        public LayoutSelectionDialog(DataBook db)
            : base(Catalog.GetString("Select Layout"), null, 0)
        {
            Gtk.Builder builder = new Gtk.Builder();
            builder.AddFromFile(FileResourcePath.GetDataPath("ui", "LayoutSelectionDialog.ui"));
            builder.Autoconnect(this);

            dataBook = db;

            // create the preview area
            dataPreview = new DataView();
            ByteBuffer bb = new ByteBuffer();

            bb.Append(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 0, 16);
            bb.Append(new byte[] { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }, 0, 16);
            dataPreview.Buffer = bb;

            PreviewFrame.Add(dataPreview.Display);
            PreviewFrame.ShowAll();

            layoutDir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "bless");
            layoutDir = System.IO.Path.Combine(layoutDir, "layouts");

            // Initialize list
            PopulateLayoutList();

            this.DefaultWidth  = 600;
            this.DefaultHeight = 300;
            this.Modal         = false;
            this.BorderWidth   = 6;
            this.HasSeparator  = false;
            this.AddButton(Gtk.Stock.Close, ResponseType.Close);
            this.AddButton(Gtk.Stock.Ok, ResponseType.Ok);
            this.Response += new ResponseHandler(OnDialogResponse);
            this.VBox.Add(LayoutSelectionPaned);
        }
Пример #27
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);
        }
Пример #28
0
 public BuilderDialog(Builder builder, string dialogName)
     : base(builder.GetRawObject (dialogName))
 {
     builder.Autoconnect (this);
     IconName = "gbrainy";
 }
Пример #29
0
    public BlessMain(string[] args)
    {
        Application.Init();

        //
        Catalog.Init(ConfigureDefines.GETTEXT_PACKAGE, ConfigureDefines.LOCALE_DIR);

        try {
            Portable.AddLocalFontFile(FileResourcePath.GetDataPath("bless-courier.ttf"));
        }
        catch (Exception) {
            System.Console.WriteLine("Warning: Could not add built-in Courier font, will fall back to system Courier font as needed.");
        }

        // load main window from GtkBuilder XML
        Gtk.Builder builder = new Gtk.Builder();
        builder.AddFromFile(FileResourcePath.GetDataPath("ui", "MainWindow.ui"));
        builder.Autoconnect(this);

        // set the application icon
        MainWindow.Icon = new Gdk.Pixbuf(FileResourcePath.GetDataPath("bless-48x48.png"));

        string blessConfDir = FileResourcePath.GetUserPath();

        // make sure local configuration directory exists
        try {
            if (!Directory.Exists(blessConfDir))
            {
                Directory.CreateDirectory(blessConfDir);
            }
        }
        catch (Exception ex) {
            ErrorAlert ea = new ErrorAlert(Catalog.GetString("Cannot create user configuration directory"), ex.Message + Catalog.GetString("\n\nSome features of Bless may not work properly."), MainWindow);
            ea.Run();
            ea.Destroy();
        }

        Preferences.Proxy.Enable = false;
        // load default preferences
        Preferences.Default.Load(FileResourcePath.GetDataPath("default-preferences.xml"));
        Preferences.Default["Default.Layout.File"] = FileResourcePath.GetDataPath("bless-default.layout");

        // load user preferences
        LoadPreferences(Path.Combine(blessConfDir, "preferences.xml"));
        Preferences.Instance.AutoSavePath = Path.Combine(blessConfDir, "preferences.xml");

        // add the (empty) Menubar and toolbar
        uiManager = new UIManager();
        MainWindow.AddAccelGroup(uiManager.AccelGroup);
        uiManager.AddUiFromString(uiXml);

        actionEntries = new ActionEntry[] {
            new ActionEntry("File", null, Catalog.GetString("_File"), null, null, null),
            new ActionEntry("Edit", null, Catalog.GetString("_Edit"), null, null, null),
            new ActionEntry("View", null, Catalog.GetString("_View"), null, null, null),
            new ActionEntry("Search", null, Catalog.GetString("_Search"), null, null, null),
            new ActionEntry("Tools", null, Catalog.GetString("_Tools"), null, null, null),
            new ActionEntry("Help", null, Catalog.GetString("_Help"), null, null, null)
        };

        ActionGroup group = new ActionGroup("MainMenuActions");

        group.Add(actionEntries);
        group.Add(new ToggleActionEntry[] {
            new ToggleActionEntry("ToolbarAction", null, Catalog.GetString("Toolbar"), null, null,
                                  new EventHandler(OnViewToolbarToggled), false)
        });

        uiManager.InsertActionGroup(group, 0);

        Widget mb = uiManager.GetWidget("/menubar");

        MainVBox.PackStart(mb, false, false, 0);
        MainVBox.ReorderChild(mb, 0);
        Widget tb = uiManager.GetWidget("/toolbar");

        tb.Visible = false;
        MainVBox.PackStart(tb, false, false, 0);
        MainVBox.ReorderChild(tb, 1);

        // create the DataBook
        dataBook             = new DataBook();
        dataBook.PageAdded  += new DataView.DataViewEventHandler(OnDataViewAdded);
        dataBook.Removed    += new RemovedHandler(OnDataViewRemoved);
        dataBook.SwitchPage += new SwitchPageHandler(OnSwitchPage);

        DataViewBox.PackStart(dataBook);


        // create the widget groups that hold utility widgets
        WidgetGroup widgetGroup0     = new WidgetGroup();
        WidgetGroup widgetGroup1     = new WidgetGroup();
        WidgetGroup sideWidgetGroup0 = new WidgetGroup();
        WidgetGroup sideWidgetGroup1 = new WidgetGroup();

        widgetGroup0.Show();
        widgetGroup1.Show();
        sideWidgetGroup0.Show();
        sideWidgetGroup1.Show();

        MainVBox.PackStart(widgetGroup0, false, false, 0);
        MainVBox.ReorderChild(widgetGroup0, 3);
        MainVBox.PackStart(widgetGroup1, false, false, 0);
        MainVBox.ReorderChild(widgetGroup1, 4);

        DataViewBox.PackStart(sideWidgetGroup0, false, false, 0);
        DataViewBox.ReorderChild(sideWidgetGroup0, 0);
        DataViewBox.PackEnd(sideWidgetGroup1, false, false, 0);
        //MainVBox.ReorderChild(widgetGroup1, 4);


        Services.File    = new FileService(dataBook, MainWindow);
        Services.Session = new SessionService(dataBook, MainWindow);
        Services.UI      = new UIService(uiManager);
        //Services.Info=new InfoService(infobar);

        // Add area plugins
        PluginManager.AddForType(typeof(AreaPlugin), new object[0]);
        PluginManager areaPlugins = PluginManager.GetForType(typeof(AreaPlugin));

        foreach (AreaPlugin p in areaPlugins.Plugins)
        {
            Area.AddFactoryItem(p.Name, p.CreateArea);
        }

        // Load GUI plugins
        PluginManager.AddForType(typeof(GuiPlugin), new object[] { MainWindow, uiManager });
        PluginManager guiPlugins = PluginManager.GetForType(typeof(GuiPlugin));

        foreach (Plugin p in guiPlugins.Plugins)
        {
            guiPlugins.LoadPlugin(p);
        }

        // load recent file history
        try {
            History.Instance.Load(Path.Combine(blessConfDir, "history.xml"));
        }
        catch (Exception e) {
            System.Console.WriteLine(e.Message);
        }

        // if user specified files on the command line
        // try to load them
        if (args.Length > 0)
        {
            Services.File.LoadFiles(args);
        }
        else if (Preferences.Instance["Session.LoadPrevious"] == "True")
        {
            bool   loadIt          = true;
            string prevSessionFile = Path.Combine(blessConfDir, "last.session");

            if (Preferences.Instance["Session.AskBeforeLoading"] == "True" &&
                File.Exists(prevSessionFile))
            {
                MessageDialog md = new MessageDialog(MainWindow,
                                                     DialogFlags.DestroyWithParent,
                                                     MessageType.Question,
                                                     ButtonsType.YesNo, Catalog.GetString("Do you want to load your previous session?"));

                ResponseType result = (ResponseType)md.Run();
                md.Destroy();

                if (result == ResponseType.Yes)
                {
                    loadIt = true;
                }
                else
                {
                    loadIt = false;
                }
            }
            // try to load previous session
            if (loadIt)
            {
                Services.Session.Load(prevSessionFile);
            }
        }

        // if nothing has been loaded, create a new file
        if (dataBook.NPages == 0)
        {
            ByteBuffer bb = Services.File.NewFile();

            // create and setup a  DataView
            DataView dv = Services.File.CreateDataView(bb);

            // append the DataView to the DataBook
            dataBook.AppendView(dv, new CloseViewDelegate(Services.File.CloseFile), Path.GetFileName(bb.Filename));
        }

        PreferencesChangedHandler handler = new PreferencesChangedHandler(OnPreferencesChanged);

        Preferences.Proxy.Subscribe("View.Toolbar.Show", "mainwin", handler);


        // register drag and drop of files
        MainWindow.DragDataReceived += OnDragDataReceived;
        Gtk.Drag.DestSet(MainWindow, DestDefaults.Motion | DestDefaults.Drop, dropTargets, Gdk.DragAction.Copy | Gdk.DragAction.Move);

        DataViewBox.ShowAll();

        Preferences.Proxy.Enable = true;
        // fire the preferences changed event
        // so things are setup according to the preferences
        Preferences.Proxy.NotifyAll();

        Application.Run();
    }
Пример #30
0
		public ProgressDialog (Builder builder, IntPtr handle): base (handle)
		{
			builder.Autoconnect (this);
//			Services.PlaceDialog (this, parent);
			ShowAll ();
		}
Пример #31
0
        public MainWindow(Builder builder)
            : base(builder.GetObject ("mainWindow").Handle)
        {
            builder.Autoconnect (this);

            taskEditor = new TaskEditor (builder);
            taskTree = new TaskTree (builder);

            taskTree.SelectedTaskChanged += (sender, e) => {
                taskEditor.SetCurrentTask (e);
                taskEditor.LoadTask ();
            };

            Destroyed += (sender, e) => Application.Quit ();

            DeleteEvent += (o, args) => {
                if (TaskManager.Instance.ModelModified) {
                    switch (UiUtils.ShowYesNoCancelDialog (this, "Save changes?")) {
                    case ResponseType.Yes:
                        TaskManager.Instance.SaveModel ();
                        break;
                    case ResponseType.Cancel:
                        args.RetVal = true;
                        break;
                    }
                }
            };

            removeDoneButton.Clicked += (sender, e) => TaskManager.Instance.RemoveTasks (task => task.IsDone);

            addNewTaskButton.Clicked += AddNewTaskButton_Clicked;

            saveToFileButton.Clicked += (sender, e) => TaskManager.Instance.SaveModel ();

            TaskManager.Instance.ModelStateModified += TaskManager_Instance_ModelStateModified;

            taskEditor.SetCurrentTask (null);

            RadioToolButton[] filterButtons = {
                allTasksToolButton,
                todaysTasksToolButton,
                thisWeekToolButton,
                expiredToolButton,
                noDeadlineToolButton
            };

            ProcessTaskFunc[] filterFuncs = {
                task => true,
                task => task.Deadline.HasValue && task.Deadline.Value.Date == DateTime.Now.Date,
                task => task.Deadline.HasValue && task.Deadline.Value.Date >= DateTime.Now.Date && task.Deadline.Value.Date < DateTime.Now.Date.AddDays (7),
                task => task.Deadline.HasValue && task.Deadline.Value.Date < DateTime.Now.Date,
                task => !task.Deadline.HasValue
            };

            foreach (var btn in filterButtons) {
                btn.Toggled += (sender, e) => {
                    if ((sender as RadioToolButton).Active) {
                        int index = Array.IndexOf (filterButtons, sender);
                        taskTree.SetFilterFunc (filterFuncs [index]);
                    }
                };
            }

            TaskManager.Instance.LoadModel ();
        }
Пример #32
0
		private ItemCreateBox(Builder builder)
		: base(builder.GetRawObject("itemCreateBox"))
		{
			builder.Autoconnect (this);
		}
Пример #33
0
        public AddinManagerDialog(Builder builder, IntPtr handle)
            : base(handle)
        {
            builder.Autoconnect (this);
            //			TransientFor = parent;
            //			HasSeparator = false;
            addininfoInstalled = new AddinInfoView ();
            addininfoInstalled.InstallClicked += OnInstallClicked;
            addininfoInstalled.UninstallClicked += OnUninstallClicked;
            addininfoInstalled.UpdateClicked += OnUpdateClicked;
            addininfoInstalled.EnableDisableClicked += OnEnableDisableClicked;
            eventbox2.Child = addininfoInstalled;
            addininfoGallery = new AddinInfoView ();
            addininfoGallery.InstallClicked += OnInstallClicked;
            addininfoGallery.UninstallClicked += OnUninstallClicked;
            addininfoGallery.UpdateClicked += OnUpdateClicked;
            addininfoGallery.EnableDisableClicked += OnEnableDisableClicked;
            eventbox1.Child = addininfoGallery;
            addininfoUpdates = new AddinInfoView ();
            addininfoUpdates.InstallClicked += OnInstallClicked;
            addininfoUpdates.UninstallClicked += OnUninstallClicked;
            addininfoUpdates.UpdateClicked += OnUpdateClicked;
            addininfoUpdates.EnableDisableClicked += OnEnableDisableClicked;
            eventbox3.Child = addininfoUpdates;

            //			Services.PlaceDialog (this, parent);
            Show ();

            addininfoInstalled.Init (service);
            addininfoGallery.Init (service);

            addinTree.Selection.Mode = SelectionMode.Multiple;
            tree = new AddinTreeWidget (addinTree);
            addinTree.Selection.Changed += OnSelectionChanged;
            tree.VersionVisible = false;

            galleryTreeView.Selection.Mode = SelectionMode.Multiple;
            galleryTree = new AddinTreeWidget (galleryTreeView);
            galleryTree.VersionVisible = false;
            galleryTree.ShowInstalledMarkers = true;
            galleryTreeView.Selection.Changed += OnGallerySelectionChanged;

            updatesTreeView.Selection.Mode = SelectionMode.Multiple;
            updatesTree = new AddinTreeWidget (updatesTreeView);
            updatesTree.VersionVisible = false;
            updatesTree.ShowCategories = false;
            updatesTree.ShowInstalledMarkers = true;
            updatesTreeView.Selection.Changed += OnGallerySelectionChanged;

            //Wiring more buttons
            buttonUpdateAll.Clicked += OnUpdateAll;
            buttonRefreshUpdates.Clicked += OnButtonRefreshClicked;
            buttonRefresh.Clicked += OnButtonRefreshClicked;
            buttonInstallFromFile.Clicked += OnButtonInstallFromFileClicked;
            repoCombo.Changed += OnRepoComboChanged;

            repoStore = new ListStore (typeof(string), typeof(string));
            repoCombo.Model = repoStore;
            CellRendererText crt = new CellRendererText ();
            repoCombo.PackStart (crt, true);
            repoCombo.AddAttribute (crt, "text", 0);
            repoCombo.RowSeparatorFunc = delegate(ITreeModel model, TreeIter iter) {
                string val = (string) model.GetValue (iter, 0);
                return val == "---";
            };

            // Make sure the tree has the focus when switching tabs

            vboxUpdates.FocusChain = new Widget [] { scrolledUpdates, eboxRepoUpdates };
            vboxGallery.FocusChain = new Widget [] { scrolledGallery, eboxRepo };

            // Improve the look of the headers

            HBox tab = new HBox (false, 3);
            tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("plugin-22.png")), false, false, 0);
            installedTabLabel = new Label (Catalog.GetString ("Installed"));
            tab.PackStart (installedTabLabel, true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll ();
            notebook.SetTabLabel (notebook.GetNthPage (0), tab);

            tab = new HBox (false, 3);
            tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("plugin-update-22.png")), false, false, 0);
            updatesTabLabel = new Label (Catalog.GetString ("Updates"));
            tab.PackStart (updatesTabLabel, true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll ();
            notebook.SetTabLabel (notebook.GetNthPage (1), tab);

            tab = new HBox (false, 3);
            tab.PackStart (new Image (Gdk.Pixbuf.LoadFromResource ("update-16.png")), false, false, 0);
            galleryTabLabel = new Label (Catalog.GetString ("Gallery"));
            tab.PackStart (galleryTabLabel, true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll ();
            notebook.SetTabLabel (notebook.GetNthPage (2), tab);

            // Gradient header for the updates and gallery tabs

            HeaderBox hb = new HeaderBox (1, 0, 1, 1);
            hb.SetPadding (6,6,6,6);
            hb.GradientBackround = true;
            hb.Show ();
            hb.Replace (eboxRepo);

            hb = new HeaderBox (1, 0, 1, 1);
            hb.SetPadding (6,6,6,6);
            hb.GradientBackround = true;
            hb.Show ();
            hb.Replace (eboxRepoUpdates);

            InsertFilterEntry ();

            FillRepos ();
            repoCombo.Active = 0;

            LoadAll ();

            ShowAll ();
        }
Пример #34
0
 private View(GtkLib.Builder builder) : base(builder.GetObject("View").Handle)
 {
     builder.Autoconnect(this);
 }
Пример #35
0
 /// <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();
 }
Пример #36
0
		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;
		}
Пример #37
0
        private Window(Builder builder)
            : base(builder.GetRawObject("myInventoryWindow"))
        {
            builder.Autoconnect (this);

            DeleteEvent += OnWindowDelete;
        }
Пример #38
0
        void BuildUI()
        {
            bool show_toolbar;

            Builder builder = new Builder ("gbrainy.ui");
            builder.Autoconnect (this);

            show_toolbar = Preferences.Get <bool> (Preferences.ToolbarShowKey) == true;

            // Toolbar creation
            toolbar = new Widgets.Toolbar (main_hbox, framework_vbox);
            toolbar.Attach ((Gtk.Orientation) Preferences.Get <int> (Preferences.ToolbarOrientationKey));
            toolbar.AllButton.Clicked += OnAllGames;
            toolbar.LogicButton.Clicked += OnLogicOnly;
            toolbar.CalculationButton.Clicked += OnMathOnly;
            toolbar.MemoryButton.Clicked += OnMemoryOnly;
            toolbar.VerbalButton.Clicked += OnVerbalOnly;
            toolbar.PauseButton.Clicked += OnPauseGame;
            toolbar.FinishButton.Clicked += OnEndGame;

            drawing_area = new GameDrawingArea ();
            drawing_area.Drawable = session;
                        drawing_area.Vexpand = true;
                        drawing_area.SetSizeRequest (drawing_vbox.WidthRequest, drawing_vbox.HeightRequest);
            GameSensitiveUI ();

            EventBox eb = new EventBox (); // Provides a window for drawing area windowless widget

            eb.Events = Gdk.EventMask.PointerMotionMask;
            drawing_vbox.Add (eb);

            eb.Add (drawing_area);

            eb.MotionNotifyEvent += OnMouseMotionEvent;
            eb.ButtonPressEvent += OnHandleButtonPress;

            show_toolbar = Preferences.Get <bool> (Preferences.ToolbarShowKey) == true;

            // We only disable the Arrow if we are going to show the toolbar.
            // It has an impact on the total window width size even if we do not show it
            if (show_toolbar)
                toolbar.ShowArrow = false;

            app_window.IconName = "gbrainy";

            app_window.ShowAll ();

            toolbar_orientation_menuitem.Sensitive = toolbar.Visible;

            // Check default radio button
            switch (toolbar.Orientation) {
            case Gtk.Orientation.Vertical:
                vertical_radiomenuitem.Active = true;
                break;
            case Gtk.Orientation.Horizontal:
                horizontal_radiomenuitem.Active = true;
                break;
            default:
                throw new InvalidOperationException ();
            }

            // The toolbar by default is enabled. By setting this menu entry to false
            // triggers the OnActivateToolbar event that hides the toolbar
            if (show_toolbar == false)
                showtoolbar_menuitem.Active = false;

            #if MONO_ADDINS
            extensions_menuitem.Activated += delegate (object sender, EventArgs ar)
            {
                if (pluggins_loaded == false)
                {
                    session.GameManager.LoadPlugins ();
                }
                Mono.Addins.Gui.AddinManagerWindow.Run (app_window);
                GameManagerPreload (session.GameManager);
                CustomGameDialog.Clear ();
            };
            #else
            extensions_menuitem.Visible = false;
            #endif
            ActiveInputControls (false);
        }