Пример #1
0
        private void Initialize()
        {
            // Pressing enter should save and close the dialog
            //Dialog.DefaultResponse = Gtk.ResponseType.Ok;
            ok_button.HasDefault = true;

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = Dialog.SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            Dialog.SetGeometryHints(Dialog, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            type_combo.RemoveText(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            ok_button.Sensitive = true;
            type_combo.GrabFocus();
        }
Пример #2
0
        private void SetMinMax(Size?size)
        {
            var geom = new Gdk.Geometry();

            geom.MinWidth  = minimumSize.Width;
            geom.MinHeight = minimumSize.Height;
            geom.MaxWidth  = 9999999;
            geom.MaxHeight = 9999999;

            if (!resizable)
            {
                if (size != null)
                {
                    geom.MinWidth  = geom.MaxWidth = size.Value.Width;
                    geom.MinHeight = geom.MaxHeight = size.Value.Height;
                }
                else if (Control.IsRealized)
                {
                    geom.MinWidth  = geom.MaxWidth = Control.Allocation.Width;
                    geom.MinHeight = geom.MaxHeight = Control.Allocation.Height;
                }
                else
                {
                    geom.MinWidth  = geom.MaxWidth = Control.DefaultWidth;
                    geom.MinHeight = geom.MaxHeight = Control.DefaultHeight;
                }
            }

            Control.SetGeometryHints(Control, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
        }
Пример #3
0
        private void OnConfigureGeometry(object o, EventArgs args)
        {
            Requisition minimum_size, natural_size;

            GetPreferredSize(out minimum_size, out natural_size);
            var limits = new Gdk.Geometry()
            {
                MinWidth = minimum_size.Width,
                MaxWidth = Gdk.Screen.Default.Width
            };

            if (details_expander.Expanded)
            {
                int list_min_height, list_natural_height;
                list_view.GetPreferredHeight(out list_min_height, out list_natural_height);
                limits.MinHeight = minimum_size.Height + list_min_height;
                limits.MaxHeight = Gdk.Screen.Default.Height;
            }
            else
            {
                limits.MinHeight = -1;
                limits.MaxHeight = -1;
            }

            SetGeometryHints(this, limits,
                             Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
        private void BuildContents()
        {
            VBox box = new VBox();

            box.BorderWidth = 8;
            box.Spacing     = 10;
            box.Show();

            header_label.Xalign = 0.0f;

            header_label.Show();
            description_label.Show();
            normal_controls_table.Show();
            advanced_controls_table.Show();

            advanced_expander.Add(advanced_controls_table);
            advanced_expander.Show();

            box.PackStart(header_label, false, false, 0);
            box.PackStart(description_label, false, false, 0);
            box.PackStart(normal_controls_table, false, false, 5);
            box.PackStart(advanced_expander, false, false, 0);

            if (sexpr_results != null)
            {
                ScrolledWindow scroll = new Gtk.ScrolledWindow();
                scroll.HscrollbarPolicy = PolicyType.Automatic;
                scroll.VscrollbarPolicy = PolicyType.Automatic;
                scroll.ShadowType       = ShadowType.In;
                sexpr_results.WrapMode  = WrapMode.Word;
                sexpr_results.SetSizeRequest(-1, 100);
                scroll.Add(sexpr_results);
                scroll.ShowAll();

                VSeparator sep = new VSeparator();
                sep.Show();

                Label label = new Label();
                label.Markup = "<b>S-Expr Results</b>";
                label.Xalign = 0.0f;
                label.Show();

                box.PackStart(sep, false, false, 0);
                box.PackStart(label, false, false, 0);
                box.PackStart(scroll, false, false, 0);
            }

            VBox.PackStart(box, false, false, 0);

            SetSizeRequest(350, -1);

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #5
0
        public override void SetMinSize(int width, int height)
        {
            Gdk.Geometry g   = new Gdk.Geometry();
            var          dec = GetDecorationSize();

            g.MinWidth  = width - dec.Horizontal; //note: gtks size functions are in client area
            g.MinHeight = height - dec.Vertical;
            window.SetGeometryHints(window, g, Gdk.WindowHints.MinSize);
        }
        private void Build()
        {
            this.Title = Catalog.GetString("Select Folder");
            this.DefaultWidth = 350;

#if GTK2
            VBox w1 = this.VBox;
#elif GTK3
            Box w1 = this.ContentArea;
#endif
            w1.Spacing = 6;
            w1.BorderWidth = ((uint)(2));

            vbox1 = new VBox();
            vbox1.Spacing = 4;

            hbox1 = new HBox();

            entryPath = new Entry();
            hbox1.PackStart(entryPath, true, true, 0);

            buttonBrowse = new Button("...");
            buttonBrowse.Clicked += ButtonBrowse_Clicked;
            hbox1.PackStart(buttonBrowse, false, false, 1);

            vbox1.Add(hbox1);

            hbox2 = new HBox();

            for (uint i = 0; i < symbols.Length; i++)
            {
                var buttonSymbol = new Button(symbols[i]);
                buttonSymbol.Clicked += ButtonSymbol_Clicked;
                hbox2.PackStart(buttonSymbol, true, true, i);
            }

            vbox1.Add(hbox2);

            w1.Add(vbox1);

            this.AddButton(Catalog.GetString("Ok"), ResponseType.Ok);
            this.AddButton(Catalog.GetString("Cancel"), ResponseType.Cancel);
            this.DefaultResponse = ResponseType.Ok;

#if GTK3
            var geom = new Gdk.Geometry();
            geom.MinWidth = this.DefaultWidth;
            geom.MinHeight = this.DefaultHeight;
            geom.MaxWidth = 1000;
            geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#endif

            this.Response += OnResponse;
            this.ShowAll();
        }
        private void SetHeightLimit()
        {
            Gdk.Geometry limits = new Gdk.Geometry();

            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            limits.MinWidth  = SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;

            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #8
0
        // Constructor
        public SkipToWindow(IPlayer p)
        {
            Glade.XML gxml = new Glade.XML(null, "SkipToWindow.glade", "window", null);
            gxml.Autoconnect(this);

            window.TransientFor = p.Window;

            geo_no_resize_height          = new Gdk.Geometry();
            geo_no_resize_height.MaxWidth = Int32.MaxValue;

            player            = p;
            player.TickEvent += OnTickEvent;

            OnTickEvent(player.Position);
        }
Пример #9
0
        private void SetHeightLimit()
        {
            Gdk.Geometry limits = new Gdk.Geometry();

            limits.MinHeight = -1;
            limits.MaxHeight = -1;

            int minimum_width, natural_width;

            GetPreferredWidth(out minimum_width, out natural_width);
            limits.MinWidth = minimum_width;
            limits.MaxWidth = Gdk.Screen.Default.Width;

            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #10
0
        // Constructor
        public ProgressWindow(Window parent)
        {
            Glade.XML gxml =
                new Glade.XML(null, "ProgressWindow.glade", "window", null);

            gxml.Autoconnect(this);

            window.TransientFor = parent;

            window.SetDefaultSize(300, -1);

            string string_loading_esc =
                StringUtils.EscapeForPango(string_loading);

            loading_label.Markup =
                String.Format("<b>{0}</b>", string_loading_esc);

            geo_no_resize_height          = new Gdk.Geometry();
            geo_no_resize_height.MaxWidth = Int32.MaxValue;
        }
Пример #11
0
        private void ConfigureGeometry()
        {
            Gdk.Geometry limits = new Gdk.Geometry();

            limits.MinWidth = Dialog.SizeRequest().Width;
            limits.MaxWidth = Gdk.Screen.Default.Width;

            if (details_expander.Expanded)
            {
                limits.MinHeight = Dialog.SizeRequest().Height + list_view.SizeRequest().Height;
                limits.MaxHeight = Gdk.Screen.Default.Height;
            }
            else
            {
                limits.MinHeight = -1;
                limits.MaxHeight = -1;
            }

            Dialog.SetGeometryHints(Dialog, limits,
                                    Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #12
0
        private void OnConfigureGeometry(object o, EventArgs args)
        {
            var limits = new Gdk.Geometry()
            {
                MinWidth = SizeRequest().Width,
                MaxWidth = Gdk.Screen.Default.Width
            };

            if (expander1.Expanded)
            {
                limits.MinHeight = SizeRequest().Height + table2.SizeRequest().Height;
                limits.MaxHeight = Gdk.Screen.Default.Height;
            }
            else
            {
                limits.MinHeight = -1;
                limits.MaxHeight = -1;
            }

            SetGeometryHints(this, limits,
                             Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #13
0
        private void BuildContents()
        {
            VBox box = new VBox();
            box.BorderWidth = 8;
            box.Spacing = 10;
            box.Show();

            header_label.Xalign = 0.0f;

            header_label.Show();
            description_label.Show();
            normal_controls_table.Show();
            advanced_controls_table.Show();

            advanced_expander.Add(advanced_controls_table);
            advanced_expander.Show();

            box.PackStart(header_label, false, false, 0);
            box.PackStart(description_label, false, false, 0);
            box.PackStart(normal_controls_table, false, false, 5);
            box.PackStart(advanced_expander, false, false, 0);

            if(sexpr_results != null) {
                ScrolledWindow scroll = new Gtk.ScrolledWindow();
                scroll.HscrollbarPolicy = PolicyType.Automatic;
                scroll.VscrollbarPolicy = PolicyType.Automatic;
                scroll.ShadowType = ShadowType.In;
                sexpr_results.WrapMode = WrapMode.Word;
                sexpr_results.SetSizeRequest(-1, 100);
                scroll.Add(sexpr_results);
                scroll.ShowAll();

                VSeparator sep = new VSeparator();
                sep.Show();

                Label label = new Label();
                label.Markup = "<b>S-Expr Results</b>";
                label.Xalign = 0.0f;
                label.Show();

                box.PackStart(sep, false, false, 0);
                box.PackStart(label, false, false, 0);
                box.PackStart(scroll, false, false, 0);
            }

            ContentArea.PackStart(box, false, false, 0);

            SetSizeRequest(350, -1);

            Gdk.Geometry limits = new Gdk.Geometry();
            int minimum_width, natural_width;
            GetPreferredWidth (out minimum_width, out natural_width);
            limits.MinWidth = minimum_width;
            limits.MaxWidth = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #14
0
        private void OnConfigureGeometry (object o, EventArgs args)
        {
            var limits = new Gdk.Geometry () {
                MinWidth = SizeRequest ().Width,
                MaxWidth = Gdk.Screen.Default.Width
            };

            if (details_expander.Expanded) {
                limits.MinHeight = SizeRequest ().Height + list_view.SizeRequest ().Height;
                limits.MaxHeight = Gdk.Screen.Default.Height;
            } else {
                limits.MinHeight = -1;
                limits.MaxHeight = -1;
            }

            SetGeometryHints (this, limits,
                Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
        private static Gtk.ResponseType showErrDialog(Exception e, bool canContinue)
        {
            Gtk.Table          pnlError;
            Gtk.Image          pctError;
            Gtk.Label          lblError;
            Gtk.ScrolledWindow scrError;
            Gtk.TextView       txtError;
            Gtk.Button         cmdReport;
            Gtk.Button         cmdIgnore;
            Gtk.Button         cmdExit;

            pnlError               = new Gtk.Table(2, 2, false);
            pnlError.Name          = "pnlError";
            pnlError.RowSpacing    = 6;
            pnlError.ColumnSpacing = 6;

            pctError      = new Gtk.Image();
            pctError.Name = "pctError";
            pctError.Xpad = 8;
            pctError.Ypad = 8;
            if (CurrentOS.IsMac)
            {
                pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.os_x.advanced_nettest_error.png");
            }
            else
            {
                pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.linux.advanced_nettest_error.png");
            }
            pnlError.Attach(pctError, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            lblError        = new Gtk.Label();
            lblError.Name   = "lblError";
            lblError.Xalign = 0F;
            lblError.Yalign = 0.5F;
            if (e.TargetSite == null)
            {
                lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error</span>";
            }
            else
            {
                lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error in " + e.TargetSite.Name + "</span>";
            }
            var signal = GLib.Signal.Lookup(lblError, "size-allocate", typeof(SizeAllocatedArgs));

            signal.AddDelegate(new EventHandler <SizeAllocatedArgs>(SizeAllocateLabel));
            lblError.LineWrap  = true;
            lblError.UseMarkup = true;
            pnlError.Attach(lblError, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0);

            scrError                  = new Gtk.ScrolledWindow();
            scrError.Name             = "scrError";
            scrError.VscrollbarPolicy = PolicyType.Automatic;
            scrError.HscrollbarPolicy = PolicyType.Never;
            scrError.ShadowType       = ShadowType.In;

            txtError            = new Gtk.TextView();
            txtError.CanFocus   = true;
            txtError.Name       = "txtError";
            txtError.Editable   = false;
            txtError.AcceptsTab = false;
            txtError.WrapMode   = WrapMode.Word;

            scrError.Add(txtError);
            pnlError.Attach(scrError, 1, 2, 1, 2, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            txtError.Buffer.Text = "Error: " + e.Message;
            if (!string.IsNullOrEmpty(e.StackTrace))
            {
                if (e.StackTrace.Contains("\n"))
                {
                    txtError.Buffer.Text += "\n" + e.StackTrace.Substring(0, e.StackTrace.IndexOf("\n"));
                }
                else
                {
                    txtError.Buffer.Text += "\n" + e.StackTrace;
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(e.Source))
                {
                    txtError.Buffer.Text += "\n @ " + e.Source;
                    if (e.TargetSite != null)
                    {
                        txtError.Buffer.Text += "." + e.TargetSite.Name;
                    }
                }
                else
                {
                    if (e.TargetSite != null)
                    {
                        txtError.Buffer.Text += "\n @ " + e.TargetSite.Name;
                    }
                }
            }

            cmdReport              = new Gtk.Button();
            cmdReport.CanDefault   = true;
            cmdReport.CanFocus     = true;
            cmdReport.Name         = "cmdReport";
            cmdReport.UseUnderline = false;
            cmdReport.Label        = "Report Error";

            if (canContinue)
            {
                cmdIgnore              = new Gtk.Button();
                cmdIgnore.CanDefault   = true;
                cmdIgnore.CanFocus     = true;
                cmdIgnore.Name         = "cmdIgnore";
                cmdIgnore.UseUnderline = false;
                cmdIgnore.Label        = "Ignore and Continue";
            }
            else
            {
                cmdIgnore = null;
            }

            cmdExit              = new global::Gtk.Button();
            cmdExit.CanFocus     = true;
            cmdExit.Name         = "cmdExit";
            cmdExit.UseUnderline = true;
            cmdExit.Label        = global::Mono.Unix.Catalog.GetString("Exit Application");

            Gtk.Dialog dlgErr = new Gtk.Dialog("Error in " + modFunctions.ProductName, null, DialogFlags.Modal | DialogFlags.DestroyWithParent, cmdReport);

            dlgErr.TypeHint        = Gdk.WindowTypeHint.Dialog;
            dlgErr.WindowPosition  = WindowPosition.CenterAlways;
            dlgErr.SkipPagerHint   = true;
            dlgErr.SkipTaskbarHint = true;
            dlgErr.AllowShrink     = true;
            dlgErr.AllowGrow       = true;

            VBox pnlErrorDialog = dlgErr.VBox;

            pnlErrorDialog.Name        = "pnlErrorDialog";
            pnlErrorDialog.BorderWidth = 2;
            pnlErrorDialog.Add(pnlError);

            Box.BoxChild pnlError_BC = (Box.BoxChild)pnlErrorDialog[pnlError];
            pnlError_BC.Position = 0;

            Gtk.HButtonBox dlgErrorAction = dlgErr.ActionArea;
            dlgErrorAction.Name        = "dlgErrorAction";
            dlgErrorAction.Spacing     = 10;
            dlgErrorAction.BorderWidth = 5;
            dlgErrorAction.LayoutStyle = ButtonBoxStyle.End;

            dlgErr.AddActionWidget(cmdReport, ResponseType.Ok);
            if (canContinue)
            {
                dlgErr.AddActionWidget(cmdIgnore, ResponseType.No);
            }
            dlgErr.AddActionWidget(cmdExit, ResponseType.Reject);

            dlgErr.ShowAll();
            Gdk.Geometry minGeo = new Gdk.Geometry();
            minGeo.MinWidth  = dlgErr.Allocation.Width;
            minGeo.MinHeight = dlgErr.Allocation.Height;
            if (minGeo.MinWidth > 1 & minGeo.MinHeight > 1)
            {
                dlgErr.SetGeometryHints(null, minGeo, Gdk.WindowHints.MinSize);
            }

            Gtk.ResponseType dRet;
            do
            {
                dRet = (Gtk.ResponseType)dlgErr.Run();
            } while (dRet == ResponseType.None);
            dlgErr.Hide();
            dlgErr.Destroy();
            dlgErr = null;
            return(dRet);
        }
Пример #16
0
        private void SetHeightLimit()
        {
            Gdk.Geometry limits = new Gdk.Geometry ();

            limits.MinHeight = -1;
            limits.MaxHeight = -1;

            int minimum_width, natural_width;
            GetPreferredWidth (out minimum_width, out natural_width);
            limits.MinWidth = minimum_width;
            limits.MaxWidth = Gdk.Screen.Default.Width;

            SetGeometryHints (this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #17
0
        private void Build()
        {
            this.Title = "MonoGame Packager";
            this.DefaultWidth = this.WidthRequest = 640;
            this.DefaultHeight = this.HeightRequest = 480;

#if WINDOWS
            this.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255));
#endif

#if GTK3
            var geom = new Gdk.Geometry();
            geom.MinWidth = geom.MaxWidth = this.DefaultWidth;
            geom.MinHeight = geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#else
            this.Resizable = false;
#endif

            vbox1 = new VBox();
            vbox1.Spacing = 4;

            notebook1 = new Notebook();
            notebook1.ShowBorder = false;
            notebook1.ShowTabs = false;

            // Wizard Page 0

            vbox2 = new VBox();
            vbox2.Spacing = 10;

            label1 = new Label();
            label1.Wrap = true;
            label1.LineWrapMode = Pango.WrapMode.Word;
            label1.Text = "Welcome to MonoGame Packager\n" +
                "\n" +
                "This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies.";
            vbox2.PackStart(label1, true, true, 0);

            label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n");
            vbox2.PackStart(label2, false, true, 1);

            notebook1.Add(vbox2);

            // Wizaed Page 1

            table1 = new Table(5, 3, false);

            table1.Attach(new Label(), 0, 3, 0, 1);

            label3 = new Label(" Select game folder: ");
            label3.SetAlignment(0f, 0.5f);
            table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryGameDir = new Entry();
            entryGameDir.Sensitive = false;
            table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            btnBrowse = new Button("Browse...");
            btnBrowse.Clicked += BtnBrowse_Clicked;
            table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label4 = new Label(" Select game .exe file:");
            label4.SetAlignment(0f, 0.5f);
            table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            scroll1 = new ScrolledWindow();
            scroll1.HeightRequest = 200;

            treeview1 = new TreeView();
            treeview1.HeightRequest = scroll1.HeightRequest;
            treeview1.HeadersVisible = false;
            treeview1.Reorderable = false;
            treeview1.CursorChanged += Treeview1_CursorChanged;

            scroll1.Add(treeview1);

            table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table1.Attach(new Label(), 0, 3, 4, 5);

            notebook1.Add(table1);

            // Wizard Page 2

            table2 = new Table(10, 3, false);

            table2.Attach(new Label(), 0, 3, 0, 1);

            imageIcon = new Image();

            btnIcon = new Button(imageIcon);
            btnIcon.WidthRequest = btnIcon.HeightRequest = 64;
            btnIcon.Clicked += BtnIcon_Clicked;
            table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label5 = new Label("Title:");
            label5.SetAlignment(0f, 0.5f);
            table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            entryTitle = new Entry();
            table2.Attach(entryTitle, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label6 = new Label("Version:");
            label6.SetAlignment(0f, 0.5f);
            table2.Attach(label6, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryVersion = new Entry();
            table2.Attach(entryVersion, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label7 = new Label("Creator:");
            label7.SetAlignment(0f, 0.5f);
            table2.Attach(label7, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryCompany = new Entry();
            table2.Attach(entryCompany, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table2.Attach(new HSeparator(), 0, 3, 4, 5, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table3 = new Table(3, 5, false);

            label8 = new Label("Generate bundle of binaries:");
            label8.SetAlignment(0f, 0.5f);
            table3.Attach(label8, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var bundlers = Generators.GetBundlerList();
            for (int i = 0; i < bundlers.Count; i++)
            {
                var checkButton = new TagCheckButton(bundlers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag = bundlers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 0, 1, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkBundlers.Add(checkButton);
            }

            label9 = new Label("Generate installer:");
            label9.SetAlignment(0f, 0.5f);
            table3.Attach(label9, 2, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var installers = Generators.GetInstallerList();
            for (int i = 0; i < installers.Count; i++)
            {
                var checkButton = new TagCheckButton(installers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag = installers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 2, 3, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkInstallers.Add(checkButton);
            }

            table2.Attach(table3, 0, 3, 5, 6, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 40, 4);

            table2.Attach(new Label(), 0, 3, 6, 7);

            notebook1.Add(table2);

            // Wizard Page 3

            vbox3 = new VBox();
            vbox3.BorderWidth = 4;
            vbox3.Spacing = 4;

            label10 = new Label("Select output folder:");
            label10.SetAlignment(0f, 1f);
            vbox3.PackStart(label10, true, true, 0);

            hbox2 = new HBox();
            hbox2.Spacing = 4;

            entryOutputDir = new Entry();
            entryOutputDir.Sensitive = false;
            hbox2.PackStart(entryOutputDir, true, true, 0);

            btnBrowse2 = new Button("Browse...");
            btnBrowse2.Clicked += BtnBrowse2_Clicked;
            hbox2.PackStart(btnBrowse2, false, true, 1);

            vbox3.PackStart(hbox2, false, false, 1);

            vbox3.PackStart(new Label(), true, true, 2);

            notebook1.Add(vbox3);

            // Wizard Page 4

            scroll2 = new ScrolledWindow();

            textView1 = new TextView();
            scroll2.Add(textView1);

            notebook1.Add(scroll2);

            // Control Buttons

            vbox1.PackStart(notebook1, true, true, 0);

            var eventBox = new EventBox ();
#if WINDOWS
            eventBox.ModifyBg (StateType.Normal, new Gdk.Color (240, 240, 240));
#endif

            hbox1 = new HBox();
            hbox1.BorderWidth = 10;

            btnCancel = new Button("Cancel");
            btnCancel.WidthRequest = 90;
            btnCancel.Clicked += (sender, e) => Application.Quit();
            hbox1.PackStart(btnCancel, false, false, 0);

            hbox1.PackStart(new Label(), true, true, 1);

            btnPrev = new Button("Previous");
            btnPrev.WidthRequest = btnCancel.WidthRequest;
            btnPrev.Clicked += BtnPrev_Clicked;
            btnPrev.Sensitive = false;
            hbox1.PackStart(btnPrev, false, false, 2);

            btnNext = new Button("Next");
            btnNext.WidthRequest = btnCancel.WidthRequest;
            btnNext.Clicked += BtnNext_Clicked;
            hbox1.PackStart(btnNext, false, false, 3);

            eventBox.Add (hbox1);
            vbox1.PackStart(eventBox, false, true, 1);

            this.Add(vbox1);
            this.ShowAll();

            this.DeleteEvent += OnDeleteEvent;
        }
Пример #18
0
        public SegmentedBarTestModule () : base ("Segmented Bar")
        {
            BorderWidth = 10;
            AppPaintable = true;

            box = new VBox ();
            box.Spacing = 10;
            Add (box);

            int space = 55;
            bar = new SegmentedBar ();
            bar.HorizontalPadding = bar.BarHeight / 2;
            bar.AddSegmentRgb ("Audio", 0.00187992456702332, 0x3465a4);
            bar.AddSegmentRgb ("Other", 0.0788718162651326, 0xf57900);
            bar.AddSegmentRgb ("Video", 0.0516869922033282, 0x73d216);
            bar.AddSegment ("Free Space", 0.867561266964516, bar.RemainderColor, false);

            bar.ValueFormatter = delegate (SegmentedBar.Segment segment) {
                return String.Format ("{0} GB", space * segment.Percent);
            };

            HBox controls = new HBox ();
            controls.Spacing = 5;

            Label label = new Label ("Height:");
            controls.PackStart (label, false, false, 0);

            SpinButton height = new SpinButton (new Adjustment (bar.BarHeight, 5, 100, 1, 1, 1), 1, 0);
            height.Activated += delegate { bar.BarHeight = height.ValueAsInt; };
            height.Changed += delegate { bar.BarHeight = height.ValueAsInt; bar.HorizontalPadding = bar.BarHeight / 2; };
            controls.PackStart (height, false, false, 0);

            CheckButton reflect = new CheckButton ("Reflection");
            reflect.Active = bar.ShowReflection;
            reflect.Toggled += delegate { bar.ShowReflection = reflect.Active; };
            controls.PackStart (reflect, false, false, 0);

            CheckButton labels = new CheckButton ("Labels");
            labels.Active = bar.ShowLabels;
            labels.Toggled += delegate { bar.ShowLabels = labels.Active; };
            controls.PackStart (labels, false, false, 0);

            box.PackStart (controls, false, false, 0);
            box.PackStart (new HSeparator (), false, false, 0);
            box.PackStart (bar, false, false, 0);
            box.ShowAll ();

            SetSizeRequest (350, -1);

            Gdk.Geometry limits = new Gdk.Geometry ();
            limits.MinWidth = SizeRequest ().Width;
            limits.MaxWidth = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            SetGeometryHints (this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #19
0
        protected virtual void Build(FileType filetype, string fileloc)
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MonoGame.Tools.Pipeline.AddFileDialog
            this.Name           = "MonoGame.Tools.Pipeline.AddFileDialog";
            this.Title          = Mono.Unix.Catalog.GetString("Add " + filetype + " Action");
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            this.BorderWidth    = ((uint)(4));
            // Internal child MonoGame.Tools.Pipeline.AddFileDialog.VBox
            #if GTK2
            global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
            w1.Name        = "dialog1_VBox";
            w1.Spacing     = 6;
            w1.BorderWidth = ((uint)(2));
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.label1           = new global::Gtk.Label();
            this.label1.Name      = "label1";
            this.label1.Xalign    = 0F;
            this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("The " + filetype.ToString().ToLower() + " <b>" + fileloc + "</b> is outside of the target directory. What would you like to do?");
            this.label1.Wrap      = true;
            w1.Add(this.label1);
            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.label1]));
            w2.Position = 0;
            w2.Expand   = false;
            w2.Fill     = false;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonCopy               = new Gtk.RadioButton(Mono.Unix.Catalog.GetString("Copy the " + filetype.ToString().ToLower() + " to the directory"));
            this.radiobuttonCopy.CanFocus      = true;
            this.radiobuttonCopy.Name          = "radiobuttonCopy";
            this.radiobuttonCopy.Active        = true;
            this.radiobuttonCopy.DrawIndicator = true;
            this.radiobuttonCopy.UseUnderline  = true;
            w1.Add(this.radiobuttonCopy);
            global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonCopy]));
            w3.Position = 1;
            w3.Expand   = false;
            w3.Fill     = false;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonLink               = new Gtk.RadioButton(Mono.Unix.Catalog.GetString("Add a link to the " + filetype.ToString().ToLower()));
            this.radiobuttonLink.CanFocus      = true;
            this.radiobuttonLink.Name          = "radiobuttonLink";
            this.radiobuttonLink.DrawIndicator = true;
            this.radiobuttonLink.UseUnderline  = true;
            this.radiobuttonLink.Group         = this.radiobuttonCopy.Group;
            w1.Add(this.radiobuttonLink);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonLink]));
            w4.Position = 2;
            w4.Expand   = false;
            w4.Fill     = false;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonSkip               = new Gtk.RadioButton(Mono.Unix.Catalog.GetString("Skip adding the " + filetype.ToString().ToLower()));
            this.radiobuttonSkip.CanFocus      = true;
            this.radiobuttonSkip.Name          = "radiobuttonSkip";
            this.radiobuttonSkip.DrawIndicator = true;
            this.radiobuttonSkip.UseUnderline  = true;
            this.radiobuttonSkip.Group         = this.radiobuttonCopy.Group;
            w1.Add(this.radiobuttonSkip);
            global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonSkip]));
            w5.Position = 3;
            w5.Expand   = false;
            w5.Fill     = false;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.checkbutton1               = new global::Gtk.CheckButton();
            this.checkbutton1.CanFocus      = true;
            this.checkbutton1.Name          = "checkbutton1";
            this.checkbutton1.Label         = Mono.Unix.Catalog.GetString("Use the same action for all selected " + filetype.ToString().ToLower() + "s");
            this.checkbutton1.DrawIndicator = true;
            this.checkbutton1.UseUnderline  = true;
            w1.Add(this.checkbutton1);
            global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.checkbutton1]));
            w6.PackType = ((global::Gtk.PackType)(1));
            w6.Position = 5;
            w6.Expand   = false;
            w6.Fill     = false;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.alignment1      = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
            this.alignment1.Name = "alignment1";
            w1.Add(this.alignment1);
            global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.alignment1]));
            w7.PackType = ((global::Gtk.PackType)(1));
            w7.Position = 6;
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 398;
            this.DefaultHeight = 261;

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

            this.Show();
            this.Response += new global::Gtk.ResponseHandler(this.OnResponse);
        }
        protected virtual void Build()
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MonoGame.Tools.Pipeline.CollectionEditorDialog
            this.Name           = "MonoGame.Tools.Pipeline.CollectionEditorDialog";
            this.Title          = global::Mono.Unix.Catalog.GetString("Reference Editor");
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            // Internal child MonoGame.Tools.Pipeline.CollectionEditorDialog.VBox
            #if GTK2
            global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
            w1.Name        = "dialog1_VBox";
            w1.BorderWidth = ((uint)(2));
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.hpaned1          = new global::Gtk.HPaned();
            this.hpaned1.CanFocus = true;
            this.hpaned1.Name     = "hpaned1";
            this.hpaned1.Position = 573;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.vbox2         = new global::Gtk.VBox();
            this.vbox2.Name    = "vbox2";
            this.vbox2.Spacing = 6;
            // Container child vbox2.Gtk.Box+BoxChild
            this.filechooserwidget1 = new global::Gtk.FileChooserWidget(((global::Gtk.FileChooserAction)(0)));
            #if GTK3
            this.filechooserwidget1.Expand = true;
            #endif
            this.filechooserwidget1.Name = "filechooserwidget1";
            this.vbox2.Add(this.filechooserwidget1);
            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.filechooserwidget1]));
            w2.Position = 0;
            // Container child vbox2.Gtk.Box+BoxChild
            this.hbox2         = new global::Gtk.HBox();
            this.hbox2.Name    = "hbox2";
            this.hbox2.Spacing = 6;
            // Container child hbox2.Gtk.Box+BoxChild
            this.alignment1      = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
            this.alignment1.Name = "alignment1";
            this.hbox2.Add(this.alignment1);
            global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.alignment1]));
            w3.Position = 0;
            // Container child hbox2.Gtk.Box+BoxChild
            this.button9              = new global::Gtk.Button();
            this.button9.CanFocus     = true;
            this.button9.Name         = "button9";
            this.button9.UseStock     = true;
            this.button9.UseUnderline = true;
            this.button9.Label        = "gtk-add";
            this.hbox2.Add(this.button9);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.button9]));
            w4.Position = 1;
            w4.Expand   = false;
            w4.Fill     = false;
            this.vbox2.Add(this.hbox2);
            global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2]));
            w5.Position = 1;
            w5.Expand   = false;
            w5.Fill     = false;
            this.hpaned1.Add(this.vbox2);
            global::Gtk.Paned.PanedChild w6 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vbox2]));
            w6.Resize = false;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.vbox3         = new global::Gtk.VBox();
            this.vbox3.Name    = "vbox3";
            this.vbox3.Spacing = 6;
            // Container child vbox3.Gtk.Box+BoxChild
            this.hbox1         = new global::Gtk.HBox();
            this.hbox1.Name    = "hbox1";
            this.hbox1.Spacing = 6;
            // Container child hbox1.Gtk.Box+BoxChild
            this.alignment2      = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
            this.alignment2.Name = "alignment2";
            this.hbox1.Add(this.alignment2);
            global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.alignment2]));
            w7.Position = 0;
            // Container child hbox1.Gtk.Box+BoxChild
            this.button10              = new global::Gtk.Button();
            this.button10.CanFocus     = true;
            this.button10.Name         = "button10";
            this.button10.UseStock     = true;
            this.button10.UseUnderline = true;
            this.button10.Label        = "gtk-remove";
            this.hbox1.Add(this.button10);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button10]));
            w8.Position = 1;
            w8.Expand   = false;
            w8.Fill     = false;
            this.vbox3.Add(this.hbox1);
            global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox1]));
            w9.Position = 0;
            w9.Expand   = false;
            w9.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            this.GtkScrolledWindow2            = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow2.Name       = "GtkScrolledWindow2";
            this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
            this.treeview1                = new global::Gtk.TreeView();
            this.treeview1.CanFocus       = true;
            this.treeview1.Name           = "treeview1";
            this.treeview1.EnableSearch   = false;
            this.treeview1.HeadersVisible = false;
            this.GtkScrolledWindow2.Add(this.treeview1);
            this.vbox3.Add(this.GtkScrolledWindow2);
            global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.GtkScrolledWindow2]));
            w11.Position = 1;
            this.hpaned1.Add(this.vbox3);
            w1.Add(this.hpaned1);
            global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1]));
            w13.Position = 0;
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 800;
            this.DefaultHeight = 397;

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

            this.Show();
            this.Response += new global::Gtk.ResponseHandler(this.OnResponse);
            this.filechooserwidget1.FileActivated += new global::System.EventHandler(this.AddFileEvent);
            this.button9.Clicked  += new global::System.EventHandler(this.AddFileEvent);
            this.button10.Clicked += new global::System.EventHandler(this.RemoveFileEvent);
        }
Пример #21
0
        private void set_height_limit(MagicCoverImage mci)
        {
            int height = 0;
            int width = 0;

            GetSize (out width, out height);

            Gdk.Geometry limits = new Gdk.Geometry ();
            limits.MinHeight = height;
            limits.MaxHeight = height;
            limits.MinWidth = SizeRequest ().Width;
            limits.MaxWidth = Gdk.Screen.Default.Width;

            SetGeometryHints (this, limits,
                      Gdk.WindowHints.MaxSize |
                      Gdk.WindowHints.MinSize);
        }
Пример #22
0
        protected virtual void Build()
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MonoGame.Tools.Pipeline.TextEditorDialog
            this.Name           = "MonoGame.Tools.Pipeline.TextEditorDialog";
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            this.BorderWidth    = ((uint)(4));
            // Internal child MonoGame.Tools.Pipeline.TextEditorDialog.VBox
            #if GTK2
            global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
            w1.Name        = "dialog1_VBox";
            w1.Spacing     = 4;
            w1.BorderWidth = ((uint)(2));
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.label2           = new global::Gtk.Label();
            this.label2.Name      = "label2";
            this.label2.Xalign    = 0F;
            this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("label2");
            w1.Add(this.label2);
            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.label2]));
            w2.Position = 0;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.entry1 = new global::Gtk.Entry();
            #if GTK3
            entry1.Expand = true;
            #endif
            this.entry1.CanFocus      = true;
            this.entry1.Name          = "entry1";
            this.entry1.IsEditable    = true;
            this.entry1.InvisibleChar = '●';
            w1.Add(this.entry1);
            global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.entry1]));
            w3.Position = 1;
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.label3 = new global::Gtk.Label();
            this.label3.HeightRequest = 0;
            this.label3.Name          = "label3";

            #if GTK3
            if (Global.GtkMajorVersion == 3 && Global.GtkMinorVersion >= 8)
            {
                Gtk3Wrapper.gtk_widget_set_opacity(label3.Handle, 0.7);
            }
            #endif

            w1.Add(this.label3);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.label3]));
            w4.Position = 2;
            w4.Expand   = false;
            w4.Fill     = false;
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 367;
            this.DefaultHeight = 143;
            this.label3.Hide();

            #if GTK3
            Gdk.Geometry geom = new Gdk.Geometry();
            geom.MinWidth  = this.DefaultWidth;
            geom.MinHeight = this.DefaultHeight;
            geom.MaxWidth  = 1000;
            geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
            #endif

            this.Show();
            this.Response         += new global::Gtk.ResponseHandler(this.OnResponse);
            this.entry1.Changed   += new global::System.EventHandler(this.OnEntry1Changed);
            this.entry1.Activated += OnEntry1Activated;
        }
        private void SetHeightLimit()
        {
            Gdk.Geometry limits = new Gdk.Geometry();

            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            limits.MinWidth = SizeRequest().Width;
            limits.MaxWidth = Gdk.Screen.Default.Width;

            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #24
0
		protected virtual void Build ()
		{
			global::Stetic.Gui.Initialize (this);
			// Widget MonoGame.Tools.Pipeline.NewTemplateDialog
			this.WidthRequest = 340;
			this.Name = "MonoGame.Tools.Pipeline.NewTemplateDialog";
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			// Internal child MonoGame.Tools.Pipeline.NewTemplateDialog.VBox
            #if GTK2
			global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
			w1.Name = "dialog1_VBox";
			w1.BorderWidth = ((uint)(2));
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.vbox2 = new global::Gtk.VBox ();
			this.vbox2.Name = "vbox2";
			// Container child vbox2.Gtk.Box+BoxChild
			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
			this.treeview1 = new global::Gtk.TreeView ();
            #if GTK3
            this.treeview1.Expand = true;
            #endif
			this.treeview1.CanFocus = true;
			this.treeview1.Name = "treeview1";
			this.treeview1.HeadersVisible = false;
			this.GtkScrolledWindow.Add (this.treeview1);
			this.vbox2.Add (this.GtkScrolledWindow);
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow]));
			// Container child vbox2.Gtk.Box+BoxChild
			this.hbox1 = new global::Gtk.HBox ();
			this.hbox1.Name = "hbox1";
			this.hbox1.Spacing = 6;
			// Container child hbox1.Gtk.Box+BoxChild
			this.label1 = new global::Gtk.Label ();
			this.label1.Name = "label1";
			this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Name:");
			this.hbox1.Add (this.label1);
			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
			w4.Position = 0;
			w4.Expand = false;
			w4.Fill = false;
			// Container child hbox1.Gtk.Box+BoxChild
			this.entry1 = new global::Gtk.Entry ();
			this.entry1.CanFocus = true;
			this.entry1.Name = "entry1";
			this.entry1.IsEditable = true;
			this.entry1.InvisibleChar = '●';
			this.hbox1.Add (this.entry1);
			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entry1]));
			w5.Position = 1;
			this.vbox2.Add (this.hbox1);
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
			w6.Expand = false;
			w6.Fill = false;
			// Container child vbox2.Gtk.Box+BoxChild
			this.label2 = new global::Gtk.Label ();
			this.label2.Name = "label2";

            #if GTK3
            if(Global.GtkMajorVersion == 3 && Global.GtkMinorVersion >= 8)
                Gtk3Wrapper.gtk_widget_set_opacity(label2.Handle, 0.7);
            #endif

			this.vbox2.Add (this.label2);
			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label2]));

            this.BorderWidth = 3;
            this.vbox2.Spacing = 3;
            w1.Spacing = 3;

            if (Global.UseHeaderBar)
            {
                w3.Position = 2;
                w6.Position = 0;
                w7.Position = 1;
            }
            else
            {
                w3.Position = 0;
                w6.Position = 1;
                w7.Position = 2;
            }

			w7.Expand = false;
			w7.Fill = false;
			w1.Add (this.vbox2);
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
			w8.Position = 0;

			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.DefaultWidth = 340;
            this.DefaultHeight = ((Global.UseHeaderBar) ? 32 : 0) + 352;
            this.label2.Hide ();

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

			this.Show ();
			this.Response += new global::Gtk.ResponseHandler (this.OnResponse);
			this.treeview1.CursorChanged += new global::System.EventHandler (this.OnTreeview1CursorChanged);
			this.entry1.Changed += new global::System.EventHandler (this.OnEntry1Changed);
		}
Пример #25
0
        private void OnConfigureGeometry(object o, EventArgs args)
        {
            Requisition minimum_size, natural_size;
            GetPreferredSize (out minimum_size, out natural_size);
            var limits = new Gdk.Geometry () {
                MinWidth = minimum_size.Width,
                MaxWidth = Gdk.Screen.Default.Width
            };

            if (details_expander.Expanded) {
                int list_min_height, list_natural_height;
                list_view.GetPreferredHeight (out list_min_height, out list_natural_height);
                limits.MinHeight = minimum_size.Height + list_min_height;
                limits.MaxHeight = Gdk.Screen.Default.Height;
            } else {
                limits.MinHeight = -1;
                limits.MaxHeight = -1;
            }

            SetGeometryHints (this, limits,
                Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #26
0
        public EqualizerWindow(Window parent) : base(Catalog.GetString("Equalizer"))
        {
            if (instance == null)
            {
                instance = this;
            }

            TransientFor    = parent;
            WindowPosition  = WindowPosition.CenterOnParent;
            TypeHint        = Gdk.WindowTypeHint.Dialog;
            SkipPagerHint   = true;
            SkipTaskbarHint = true;
            AppPaintable    = true;

            SetDefaultSize(-1, 180);

            VBox box = new VBox();

            header_box             = new HBox();
            header_box.BorderWidth = 4;
            header_box.Spacing     = 2;

            box.PackStart(header_box, false, false, 0);
            box.PackStart(new HSeparator(), false, false, 0);

            eq_view             = new EqualizerView();
            eq_view.BorderWidth = 10;
            eq_view.SetSizeRequest(-1, 110);
            eq_view.Frequencies = ((IEqualizer)ServiceManager.PlayerEngine.ActiveEngine).EqualizerFrequencies;
            eq_view.Show();

            eq_enabled_checkbox = new CheckButton(Catalog.GetString("Enabled"));

            eq_preset_combo          = new EqualizerPresetComboBox();
            eq_preset_combo.Changed += OnPresetChanged;
            eq_preset_combo.Show();

            Button new_preset_button = new Button(new Image(Stock.Add, IconSize.Button));

            new_preset_button.Relief   = ReliefStyle.None;
            new_preset_button.Clicked += OnNewPreset;

            Button delete_preset_button = new Button(new Image(Stock.Remove, IconSize.Button));

            delete_preset_button.Relief   = ReliefStyle.None;
            delete_preset_button.Clicked += OnDeletePreset;

            VBox combo_box = new VBox();

            combo_box.PackStart(eq_preset_combo, true, false, 0);

            header_box.PackStart(combo_box, false, false, 0);
            header_box.PackStart(new_preset_button, false, false, 0);
            header_box.PackStart(delete_preset_button, false, false, 0);
            header_box.PackEnd(eq_enabled_checkbox, false, false, 0);

            box.PackStart(eq_view, true, true, 0);

            eq_enabled_checkbox.Active = EqualizerSetting.EnabledSchema.Get();
            eq_preset_combo.ActivatePreferredEqualizer(EqualizerSetting.PresetSchema.Get());

            if (eq_enabled_checkbox.Active)
            {
                // enable equalizer if was enabled last session
                EqualizerManager.Instance.Enable(eq_preset_combo.ActiveEqualizer);
            }

            if (eq_preset_combo.ActiveEqualizer == null)
            {
                // user has no presets, so create one
                OnNewPreset(null, null);

                // enable our new preset (it has no effect though, since all bands are 0db)
                eq_enabled_checkbox.Active = true;
                OnEnableDisable(null, null);
            }

            eq_enabled_checkbox.Clicked += OnEnableDisable;

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = -1;
            limits.MaxWidth  = -1;
            limits.MinHeight = SizeRequest().Height;
            limits.MaxHeight = Gdk.Screen.Default.Height;
            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize);

            KeyPressEvent += OnKeyPress;

            Add(box);
            box.ShowAll();
        }
		private void UpdateGraphicObjects()
		{
			// Set window icon
			Gtk.Window.DefaultIcon = Gdk.Pixbuf.LoadFromResource("themonospot.png");
			
			// Instance glade xml object using glade file
			Glade.XML gxml =  new Glade.XML("MainWindow.glade", "MainWindow");
			
			// Aonnect glade xml object to this Gtk.Window
			gxml.Autoconnect(this);
			
			// Main Window Title
			MainWindow.Title = "Themonospot [Gtk] v" + GlobalData.GuiRelease;
			Gdk.Geometry geo = new Gdk.Geometry();
			geo.MinHeight = 350;
			geo.MinWidth = 650;
			MainWindow.SetGeometryHints(grpResult, geo, Gdk.WindowHints.MinSize);
			
			for (int g=tabContainer.NPages-1; g>=0; g--)
			{
				tabContainer.RemovePage(g);
			}
			
			// LANGUAGE 
			((Label)menuFile.Child).TextWithMnemonic = 
				GlobalData.GetLanguageKeyValue("MAINFILE").Replace("&","_");
			((Label)menuOptions.Child).TextWithMnemonic = 
				GlobalData.GetLanguageKeyValue("MAINOPTIONS").Replace("&","_");
			((Label)menuAbout.Child).TextWithMnemonic = 
				GlobalData.GetLanguageKeyValue("MAINABOUT").Replace("&","_");
			
			((Label)menuScanFile.Child).Text =
				GlobalData.GetLanguageKeyValue("SCANFILE");
			btnScanFile.Label = ((Label)menuScanFile.Child).Text;
			((Label)menuScanFolder.Child).Text =
				GlobalData.GetLanguageKeyValue("SCANFOLDER");
			btnScanFolder.Label = ((Label)menuScanFolder.Child).Text;
			((Label)menuScanFolderSubfolders.Child).Text =
				GlobalData.GetLanguageKeyValue("SCANSUBFOLDERS");
			btnScanFolderSubfolders.Label = ((Label)menuScanFolderSubfolders.Child).Text;
			((Label)menuSaveReport.Child).Text =
				GlobalData.GetLanguageKeyValue("SAVEREPORT");
			btnSaveReport.Label = ((Label)menuSaveReport.Child).Text;
			((Label)menuExit.Child).Text =
				GlobalData.GetLanguageKeyValue("EXIT");
			btnExit.Label = ((Label)menuExit.Child).Text;
			
			((Label)menuAutoReport.Child).Text =
				GlobalData.GetLanguageKeyValue("AUTOREPORT");
			
			((Label)menuAboutWindow.Child).Text =
				GlobalData.GetLanguageKeyValue("INFOABOUT") + " Themonospot [Gtk]";
			
			lblResult.Markup = "<b>" + GlobalData.GetLanguageKeyValue("TITLERESULT") + "</b>";
			

			// STATUS TIP FOR WIDGETS NOT IMPLEMENTED

				
			// LANGUAGE TOOL TIP
			btnScanFile.TooltipText = GlobalData.GetLanguageKeyValue("SCANFILETT");
			menuScanFile.TooltipText = btnScanFile.TooltipText;
			btnScanFolder.TooltipText = GlobalData.GetLanguageKeyValue("SCANFOLDERTT");
			menuScanFolder.TooltipText = btnScanFolder.TooltipText;			
			btnScanFolderSubfolders.TooltipText = GlobalData.GetLanguageKeyValue("SCANSUBFOLDERSTT");
			menuScanFolderSubfolders.TooltipText = btnScanFolderSubfolders.TooltipText;
			btnSaveReport.TooltipText = GlobalData.GetLanguageKeyValue("SAVEREPORTTT");
			menuSaveReport.TooltipText = btnSaveReport.TooltipText;
			btnExit.TooltipText = GlobalData.GetLanguageKeyValue("EXITTT");
			menuExit.TooltipText = btnExit.TooltipText;
			menuAutoReport.TooltipText = GlobalData.GetLanguageKeyValue("AUTOREPORTTT");
			menuAboutWindow.TooltipText = GlobalData.GetLanguageKeyValue("INFOABOUTTT");

			
			MainWindow.Show();
			
		}
Пример #28
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;
		}
Пример #29
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;
        }
Пример #30
0
		protected virtual void Build ()
		{
			global::Stetic.Gui.Initialize (this);
			// Widget MonoGame.Tools.Pipeline.TextEditorDialog
			this.Name = "MonoGame.Tools.Pipeline.TextEditorDialog";
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			this.BorderWidth = ((uint)(4));
			// Internal child MonoGame.Tools.Pipeline.TextEditorDialog.VBox
            #if GTK2
			global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
			w1.Name = "dialog1_VBox";
			w1.Spacing = 4;
			w1.BorderWidth = ((uint)(2));
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.label2 = new global::Gtk.Label ();
			this.label2.Name = "label2";
			this.label2.Xalign = 0F;
			this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("label2");
			w1.Add (this.label2);
			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.label2]));
			w2.Position = 0;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.entry1 = new global::Gtk.Entry ();
            #if GTK3
            entry1.Expand = true;
            #endif
			this.entry1.CanFocus = true;
			this.entry1.Name = "entry1";
			this.entry1.IsEditable = true;
			this.entry1.InvisibleChar = '●';
			w1.Add (this.entry1);
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.entry1]));
			w3.Position = 1;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.label3 = new global::Gtk.Label ();
			this.label3.HeightRequest = 0;
			this.label3.Name = "label3";

            #if GTK3
            if(Global.GtkMajorVersion == 3 && Global.GtkMinorVersion >= 8)
                Gtk3Wrapper.gtk_widget_set_opacity(label3.Handle, 0.7);
            #endif

			w1.Add (this.label3);
			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.label3]));
			w4.Position = 2;
			w4.Expand = false;
			w4.Fill = false;
			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.DefaultWidth = 367;
			this.DefaultHeight = 143;
            this.label3.Hide ();

            #if GTK3
            Gdk.Geometry geom = new Gdk.Geometry();
            geom.MinWidth = this.DefaultWidth;
            geom.MinHeight = this.DefaultHeight;
            geom.MaxWidth = 1000;
            geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
            #endif

			this.Show ();
			this.Response += new global::Gtk.ResponseHandler (this.OnResponse);
			this.entry1.Changed += new global::System.EventHandler (this.OnEntry1Changed);
            this.entry1.Activated += OnEntry1Activated;
		}
Пример #31
0
        public SegmentedBarTestModule() : base("Segmented Bar")
        {
            BorderWidth  = 10;
            AppPaintable = true;

            box = new VBox {
                Spacing = 10
            };
            Add(box);

            int space = 55;

            bar = new SegmentedBar();
            bar.HorizontalPadding = bar.BarHeight / 2;
            bar.AddSegmentRgb("Audio", 0.00187992456702332, 0x3465a4);
            bar.AddSegmentRgb("Other", 0.0788718162651326, 0xf57900);
            bar.AddSegmentRgb("Video", 0.0516869922033282, 0x73d216);
            bar.AddSegment("Free Space", 0.867561266964516, bar.RemainderColor, false);

            bar.ValueFormatter = delegate(SegmentedBar.Segment segment) {
                return(string.Format("{0} GB", space * segment.Percent));
            };

            var controls = new HBox {
                Spacing = 5
            };

            var label = new Label("Height:");

            controls.PackStart(label, false, false, 0);

            var height = new SpinButton(new Adjustment(bar.BarHeight, 5, 100, 1, 1, 1), 1, 0);

            height.Activated += delegate { bar.BarHeight = height.ValueAsInt; };
            height.Changed   += delegate { bar.BarHeight = height.ValueAsInt; bar.HorizontalPadding = bar.BarHeight / 2; };
            controls.PackStart(height, false, false, 0);

            var reflect = new CheckButton("Reflection")
            {
                Active = bar.ShowReflection
            };

            reflect.Toggled += delegate { bar.ShowReflection = reflect.Active; };
            controls.PackStart(reflect, false, false, 0);

            var labels = new CheckButton("Labels")
            {
                Active = bar.ShowLabels
            };

            labels.Toggled += delegate { bar.ShowLabels = labels.Active; };
            controls.PackStart(labels, false, false, 0);

            box.PackStart(controls, false, false, 0);
            box.PackStart(new HSeparator(), false, false, 0);
            box.PackStart(bar, false, false, 0);
            box.ShowAll();

            SetSizeRequest(350, -1);

            var limits = new Gdk.Geometry {
                MinWidth  = SizeRequest().Width,
                MaxWidth  = Gdk.Screen.Default.Width,
                MinHeight = -1,
                MaxHeight = -1
            };

            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);
        }
Пример #32
0
        public EqualizerWindow(Window parent) : base(Catalog.GetString("Equalizer"))
        {
            if (instance == null)
            {
                instance = this;
            }

            TransientFor    = parent;
            WindowPosition  = WindowPosition.CenterOnParent;
            TypeHint        = Gdk.WindowTypeHint.Dialog;
            SkipPagerHint   = true;
            SkipTaskbarHint = true;

            SetDefaultSize(-1, 230);

            VBox box = new VBox();

            header_box             = new HBox();
            header_box.BorderWidth = 4;
            header_box.Spacing     = 2;

            box.PackStart(header_box, false, false, 0);
            box.PackStart(new HSeparator(), false, false, 0);

            eq_view             = new EqualizerView();
            eq_view.BorderWidth = 10;
            eq_view.SetSizeRequest(-1, 110);
            eq_view.Frequencies = ((IEqualizer)ServiceManager.PlayerEngine.ActiveEngine).EqualizerFrequencies;
            eq_view.Show();

            eq_enabled_checkbox = new CheckButton(Catalog.GetString("Enabled"));

            eq_preset_combo          = new EqualizerPresetComboBox();
            eq_preset_combo.Changed += OnPresetChanged;
            eq_preset_combo.Show();

            Button new_preset_button = new Button(new Image(Stock.Add, IconSize.Button));

            new_preset_button.Relief   = ReliefStyle.None;
            new_preset_button.Clicked += OnNewPreset;

            delete_preset_button          = new Button(new Image(Stock.Remove, IconSize.Button));
            delete_preset_button.Relief   = ReliefStyle.None;
            delete_preset_button.Clicked += OnDeletePreset;

            VBox combo_box = new VBox();

            combo_box.PackStart(eq_preset_combo, true, false, 0);

            header_box.PackStart(combo_box, false, false, 0);
            header_box.PackStart(new_preset_button, false, false, 0);
            header_box.PackStart(delete_preset_button, false, false, 0);
            header_box.PackEnd(eq_enabled_checkbox, false, false, 0);

            box.PackStart(eq_view, true, true, 0);

            var button_box = new ButtonBox(Orientation.Horizontal);

            button_box.Layout      = ButtonBoxStyle.End;
            button_box.BorderWidth = 12;
            var button = new Button(Stock.Close)
            {
                UseStock = true
            };

            button.Clicked += delegate { Destroy(); };
            button_box.Add(button);
            box.PackEnd(button_box, false, true, 0);

            eq_enabled_checkbox.Active      = EqualizerManager.Instance.IsActive;
            eq_enabled_checkbox.Clicked    += OnEnableDisable;
            eq_preset_combo.ActiveEqualizer = EqualizerManager.Instance.SelectedEqualizer;

            int minimum_height, natural_height;

            GetPreferredHeight(out minimum_height, out natural_height);
            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = -1;
            limits.MaxWidth  = -1;
            limits.MinHeight = minimum_height;
            limits.MaxHeight = Gdk.Screen.Default.Height;
            SetGeometryHints(this, limits, Gdk.WindowHints.MaxSize);

            KeyPressEvent += OnKeyPress;

            Add(box);
            box.ShowAll();
        }
Пример #33
0
        public EqualizerWindow (Window parent) : base (Catalog.GetString ("Equalizer"))
        {
            if (instance == null) {
                instance = this;
            }

            TransientFor = parent;
            WindowPosition = WindowPosition.CenterOnParent;
            TypeHint = Gdk.WindowTypeHint.Dialog;
            SkipPagerHint = true;
            SkipTaskbarHint = true;
            AppPaintable = true;

            SetDefaultSize (-1, 180);

            VBox box = new VBox ();
            header_box = new HBox ();
            header_box.BorderWidth = 4;
            header_box.Spacing = 2;

            box.PackStart (header_box, false, false, 0);
            box.PackStart (new HSeparator (), false, false, 0);

            eq_view = new EqualizerView ();
            eq_view.BorderWidth = 10;
            eq_view.SetSizeRequest (-1, 110);
            eq_view.Frequencies = ((IEqualizer)ServiceManager.PlayerEngine.ActiveEngine).EqualizerFrequencies;
            eq_view.Show ();

            eq_enabled_checkbox = new CheckButton (Catalog.GetString ("Enabled"));

            eq_preset_combo = new EqualizerPresetComboBox ();
            eq_preset_combo.Changed += OnPresetChanged;
            eq_preset_combo.Show ();

            Button new_preset_button = new Button (new Image (Stock.Add, IconSize.Button));
            new_preset_button.Relief = ReliefStyle.None;
            new_preset_button.Clicked += OnNewPreset;

            delete_preset_button = new Button (new Image (Stock.Remove, IconSize.Button));
            delete_preset_button.Relief = ReliefStyle.None;
            delete_preset_button.Clicked += OnDeletePreset;

            VBox combo_box = new VBox ();
            combo_box.PackStart (eq_preset_combo, true, false, 0);

            header_box.PackStart (combo_box, false, false, 0);
            header_box.PackStart (new_preset_button, false, false, 0);
            header_box.PackStart (delete_preset_button, false, false, 0);
            header_box.PackEnd (eq_enabled_checkbox, false, false, 0);

            box.PackStart (eq_view, true, true, 0);

            eq_enabled_checkbox.Active = EqualizerManager.Instance.IsActive;
            eq_enabled_checkbox.Clicked += OnEnableDisable;
            eq_preset_combo.ActiveEqualizer = EqualizerManager.Instance.SelectedEqualizer;

            Gdk.Geometry limits = new Gdk.Geometry ();
            limits.MinWidth = -1;
            limits.MaxWidth = -1;
            limits.MinHeight = SizeRequest ().Height;
            limits.MaxHeight = Gdk.Screen.Default.Height;
            SetGeometryHints (this, limits, Gdk.WindowHints.MaxSize);

            KeyPressEvent += OnKeyPress;

            Add (box);
            box.ShowAll ();
        }
Пример #34
0
        protected virtual void Build()
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MonoGame.Tools.Pipeline.NewTemplateDialog
            this.WidthRequest   = 340;
            this.Name           = "MonoGame.Tools.Pipeline.NewTemplateDialog";
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            // Internal child MonoGame.Tools.Pipeline.NewTemplateDialog.VBox
            #if GTK2
            global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
            w1.Name        = "dialog1_VBox";
            w1.BorderWidth = ((uint)(2));
            // Container child dialog1_VBox.Gtk.Box+BoxChild
            this.vbox2      = new global::Gtk.VBox();
            this.vbox2.Name = "vbox2";
            // Container child vbox2.Gtk.Box+BoxChild
            this.GtkScrolledWindow            = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow.Name       = "GtkScrolledWindow";
            this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
            this.treeview1 = new global::Gtk.TreeView();
            #if GTK3
            this.treeview1.Expand = true;
            #endif
            this.treeview1.CanFocus       = true;
            this.treeview1.Name           = "treeview1";
            this.treeview1.HeadersVisible = false;
            this.GtkScrolledWindow.Add(this.treeview1);
            this.vbox2.Add(this.GtkScrolledWindow);
            global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow]));
            // Container child vbox2.Gtk.Box+BoxChild
            this.hbox1         = new global::Gtk.HBox();
            this.hbox1.Name    = "hbox1";
            this.hbox1.Spacing = 6;
            // Container child hbox1.Gtk.Box+BoxChild
            this.label1           = new global::Gtk.Label();
            this.label1.Name      = "label1";
            this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Name:");
            this.hbox1.Add(this.label1);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
            w4.Position = 0;
            w4.Expand   = false;
            w4.Fill     = false;
            // Container child hbox1.Gtk.Box+BoxChild
            this.entry1               = new global::Gtk.Entry();
            this.entry1.CanFocus      = true;
            this.entry1.Name          = "entry1";
            this.entry1.IsEditable    = true;
            this.entry1.InvisibleChar = '●';
            this.hbox1.Add(this.entry1);
            global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entry1]));
            w5.Position = 1;
            this.vbox2.Add(this.hbox1);
            global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
            w6.Expand = false;
            w6.Fill   = false;
            // Container child vbox2.Gtk.Box+BoxChild
            this.label2      = new global::Gtk.Label();
            this.label2.Name = "label2";

            #if GTK3
            if (Global.GtkMajorVersion == 3 && Global.GtkMinorVersion >= 8)
            {
                Gtk3Wrapper.gtk_widget_set_opacity(label2.Handle, 0.7);
            }
            #endif

            this.vbox2.Add(this.label2);
            global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label2]));

            this.BorderWidth   = 3;
            this.vbox2.Spacing = 3;
            w1.Spacing         = 3;

            if (Global.UseHeaderBar)
            {
                w3.Position = 2;
                w6.Position = 0;
                w7.Position = 1;
            }
            else
            {
                w3.Position = 0;
                w6.Position = 1;
                w7.Position = 2;
            }

            w7.Expand = false;
            w7.Fill   = false;
            w1.Add(this.vbox2);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
            w8.Position = 0;

            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 340;
            this.DefaultHeight = ((Global.UseHeaderBar) ? 32 : 0) + 352;
            this.label2.Hide();

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

            this.Show();
            this.Response += new global::Gtk.ResponseHandler(this.OnResponse);
            this.treeview1.CursorChanged += new global::System.EventHandler(this.OnTreeview1CursorChanged);
            this.entry1.Changed          += new global::System.EventHandler(this.OnEntry1Changed);
        }
        private void Build()
        {
            this.Title         = "MonoGame Packager";
            this.DefaultWidth  = this.WidthRequest = 640;
            this.DefaultHeight = this.HeightRequest = 480;

#if WINDOWS
            this.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
#endif

#if GTK3
            var geom = new Gdk.Geometry();
            geom.MinWidth  = geom.MaxWidth = this.DefaultWidth;
            geom.MinHeight = geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#else
            this.Resizable = false;
#endif

            vbox1         = new VBox();
            vbox1.Spacing = 4;

            notebook1            = new Notebook();
            notebook1.ShowBorder = false;
            notebook1.ShowTabs   = false;

            // Wizard Page 0

            vbox2         = new VBox();
            vbox2.Spacing = 10;

            label1              = new Label();
            label1.Wrap         = true;
            label1.LineWrapMode = Pango.WrapMode.Word;
            label1.Text         = "Welcome to MonoGame Packager\n" +
                                  "\n" +
                                  "This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies.";
            vbox2.PackStart(label1, true, true, 0);

            label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n");
            vbox2.PackStart(label2, false, true, 1);

            notebook1.Add(vbox2);

            // Wizaed Page 1

            table1 = new Table(5, 3, false);

            table1.Attach(new Label(), 0, 3, 0, 1);

            label3 = new Label(" Select game folder: ");
            label3.SetAlignment(0f, 0.5f);
            table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryGameDir           = new Entry();
            entryGameDir.Sensitive = false;
            table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            btnBrowse          = new Button("Browse...");
            btnBrowse.Clicked += BtnBrowse_Clicked;
            table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label4 = new Label(" Select game .exe file:");
            label4.SetAlignment(0f, 0.5f);
            table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            scroll1 = new ScrolledWindow();
            scroll1.HeightRequest = 200;

            treeview1 = new TreeView();
            treeview1.HeightRequest  = scroll1.HeightRequest;
            treeview1.HeadersVisible = false;
            treeview1.Reorderable    = false;
            treeview1.CursorChanged += Treeview1_CursorChanged;

            scroll1.Add(treeview1);

            table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table1.Attach(new Label(), 0, 3, 4, 5);

            notebook1.Add(table1);

            // Wizard Page 2

            table2 = new Table(10, 3, false);

            table2.Attach(new Label(), 0, 3, 0, 1);

            imageIcon = new Image();

            btnIcon = new Button(imageIcon);
            btnIcon.WidthRequest = btnIcon.HeightRequest = 64;
            btnIcon.Clicked     += BtnIcon_Clicked;
            table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label5 = new Label("Title:");
            label5.SetAlignment(0f, 0.5f);
            table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            entryTitle = new Entry();
            table2.Attach(entryTitle, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label6 = new Label("Version:");
            label6.SetAlignment(0f, 0.5f);
            table2.Attach(label6, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryVersion = new Entry();
            table2.Attach(entryVersion, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label7 = new Label("Creator:");
            label7.SetAlignment(0f, 0.5f);
            table2.Attach(label7, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryCompany = new Entry();
            table2.Attach(entryCompany, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table2.Attach(new HSeparator(), 0, 3, 4, 5, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table3 = new Table(3, 5, false);

            label8 = new Label("Generate bundle of binaries:");
            label8.SetAlignment(0f, 0.5f);
            table3.Attach(label8, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var bundlers = Generators.GetBundlerList();
            for (int i = 0; i < bundlers.Count; i++)
            {
                var checkButton = new TagCheckButton(bundlers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag      = bundlers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 0, 1, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkBundlers.Add(checkButton);
            }

            label9 = new Label("Generate installer:");
            label9.SetAlignment(0f, 0.5f);
            table3.Attach(label9, 2, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var installers = Generators.GetInstallerList();
            for (int i = 0; i < installers.Count; i++)
            {
                var checkButton = new TagCheckButton(installers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag      = installers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 2, 3, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkInstallers.Add(checkButton);
            }

            table2.Attach(table3, 0, 3, 5, 6, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 40, 4);

            table2.Attach(new Label(), 0, 3, 6, 7);

            notebook1.Add(table2);

            // Wizard Page 3

            vbox3             = new VBox();
            vbox3.BorderWidth = 4;
            vbox3.Spacing     = 4;

            label10 = new Label("Select output folder:");
            label10.SetAlignment(0f, 1f);
            vbox3.PackStart(label10, true, true, 0);

            hbox2         = new HBox();
            hbox2.Spacing = 4;

            entryOutputDir           = new Entry();
            entryOutputDir.Sensitive = false;
            hbox2.PackStart(entryOutputDir, true, true, 0);

            btnBrowse2          = new Button("Browse...");
            btnBrowse2.Clicked += BtnBrowse2_Clicked;
            hbox2.PackStart(btnBrowse2, false, true, 1);

            vbox3.PackStart(hbox2, false, false, 1);

            vbox3.PackStart(new Label(), true, true, 2);

            notebook1.Add(vbox3);

            // Wizard Page 4

            scroll2 = new ScrolledWindow();

            textView1 = new TextView();
            scroll2.Add(textView1);

            notebook1.Add(scroll2);

            // Control Buttons

            vbox1.PackStart(notebook1, true, true, 0);

            var eventBox = new EventBox();
#if WINDOWS
            eventBox.ModifyBg(StateType.Normal, new Gdk.Color(240, 240, 240));
#endif

            hbox1             = new HBox();
            hbox1.BorderWidth = 10;

            btnCancel = new Button("Cancel");
            btnCancel.WidthRequest = 90;
            btnCancel.Clicked     += (sender, e) => Application.Quit();
            hbox1.PackStart(btnCancel, false, false, 0);

            hbox1.PackStart(new Label(), true, true, 1);

            btnPrev = new Button("Previous");
            btnPrev.WidthRequest = btnCancel.WidthRequest;
            btnPrev.Clicked     += BtnPrev_Clicked;
            btnPrev.Sensitive    = false;
            hbox1.PackStart(btnPrev, false, false, 2);

            btnNext = new Button("Next");
            btnNext.WidthRequest = btnCancel.WidthRequest;
            btnNext.Clicked     += BtnNext_Clicked;
            hbox1.PackStart(btnNext, false, false, 3);

            eventBox.Add(hbox1);
            vbox1.PackStart(eventBox, false, true, 1);

            this.Add(vbox1);
            this.ShowAll();

            this.DeleteEvent += OnDeleteEvent;
        }
Пример #36
0
        protected virtual void Build (FileType filetype, string fileloc)
		{
			global::Stetic.Gui.Initialize (this);
			// Widget MonoGame.Tools.Pipeline.AddFileDialog
            this.Name = "MonoGame.Tools.Pipeline.AddFileDialog";
            this.Title = Mono.Unix.Catalog.GetString ("Add " + filetype + " Action");
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			this.BorderWidth = ((uint)(4));
			// Internal child MonoGame.Tools.Pipeline.AddFileDialog.VBox
            #if GTK2
            global::Gtk.VBox w1 = this.VBox;
            #elif GTK3
            global::Gtk.Box w1 = this.ContentArea;
            #endif
			w1.Name = "dialog1_VBox";
			w1.Spacing = 6;
			w1.BorderWidth = ((uint)(2));
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.label1 = new global::Gtk.Label ();
			this.label1.Name = "label1";
            this.label1.Xalign = 0F;
            this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("The " + filetype.ToString().ToLower() + " <b>" + fileloc + "</b> is outside of the target directory. What would you like to do?");
			this.label1.Wrap = true;
			w1.Add (this.label1);
			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.label1]));
			w2.Position = 0;
			w2.Expand = false;
			w2.Fill = false;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonCopy = new Gtk.RadioButton (Mono.Unix.Catalog.GetString("Copy the " + filetype.ToString().ToLower() + " to the directory"));
			this.radiobuttonCopy.CanFocus = true;
			this.radiobuttonCopy.Name = "radiobuttonCopy";
			this.radiobuttonCopy.Active = true;
			this.radiobuttonCopy.DrawIndicator = true;
			this.radiobuttonCopy.UseUnderline = true;
			w1.Add (this.radiobuttonCopy);
			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonCopy]));
			w3.Position = 1;
			w3.Expand = false;
			w3.Fill = false;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonLink = new Gtk.RadioButton (Mono.Unix.Catalog.GetString ("Add a link to the " + filetype.ToString().ToLower()));
			this.radiobuttonLink.CanFocus = true;
			this.radiobuttonLink.Name = "radiobuttonLink";
			this.radiobuttonLink.DrawIndicator = true;
			this.radiobuttonLink.UseUnderline = true;
			this.radiobuttonLink.Group = this.radiobuttonCopy.Group;
			w1.Add (this.radiobuttonLink);
			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonLink]));
			w4.Position = 2;
			w4.Expand = false;
			w4.Fill = false;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
            this.radiobuttonSkip = new Gtk.RadioButton (Mono.Unix.Catalog.GetString("Skip adding the " + filetype.ToString().ToLower()));
			this.radiobuttonSkip.CanFocus = true;
			this.radiobuttonSkip.Name = "radiobuttonSkip";
			this.radiobuttonSkip.DrawIndicator = true;
			this.radiobuttonSkip.UseUnderline = true;
			this.radiobuttonSkip.Group = this.radiobuttonCopy.Group;
			w1.Add (this.radiobuttonSkip);
			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.radiobuttonSkip]));
			w5.Position = 3;
			w5.Expand = false;
			w5.Fill = false;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.checkbutton1 = new global::Gtk.CheckButton ();
			this.checkbutton1.CanFocus = true;
			this.checkbutton1.Name = "checkbutton1";
            this.checkbutton1.Label = Mono.Unix.Catalog.GetString("Use the same action for all selected " + filetype.ToString().ToLower() + "s");
			this.checkbutton1.DrawIndicator = true;
			this.checkbutton1.UseUnderline = true;
			w1.Add (this.checkbutton1);
			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.checkbutton1]));
			w6.PackType = ((global::Gtk.PackType)(1));
			w6.Position = 5;
			w6.Expand = false;
			w6.Fill = false;
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
			this.alignment1.Name = "alignment1";
			w1.Add (this.alignment1);
			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.alignment1]));
			w7.PackType = ((global::Gtk.PackType)(1));
			w7.Position = 6;
			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.DefaultWidth = 398;
            this.DefaultHeight = 261;

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

			this.Show ();
			this.Response += new global::Gtk.ResponseHandler (this.OnResponse);
		}