Пример #1
0
            public ICSShell(ICSClient client)
                : base()
            {
                this.client = client;
                max_chars = 16 * 1024;
                textView = new TextView ();
                textView.ModifyFont (Pango.FontDescription.
                             FromString
                             ("Monospace 9"));
                client.LineReceivedEvent += OnLineReceived;

                commandEntry = new Entry ();
                sendButton =
                    new Button (Catalog.
                            GetString ("Send"));

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (textView);

                  PackStart (win, true, true, 4);
                HBox box = new HBox ();
                  box.PackStart (commandEntry, true, true, 4);
                  box.PackStart (sendButton, false, false, 4);
                  PackStart (box, false, true, 4);

                  textView.Editable = false;

                  commandEntry.Activated += OnCommand;
                  sendButton.Clicked += OnCommand;
                  ShowAll ();
            }
Пример #2
0
            public ICSShell(ICSClient client)
                : base()
            {
                this.client = client;
                textView = new ShellTextView (client);

                commandEntry = new Entry ();
                sendButton =
                    new Button (Catalog.
                            GetString ("Send"));

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (textView);

                  PackStart (win, true, true, 4);
                HBox box = new HBox ();
                  box.PackStart (commandEntry, true, true, 4);
                  box.PackStart (sendButton, false, false, 4);
                  PackStart (box, false, true, 4);

                  textView.Editable = false;

                  commandEntry.Activated += OnCommand;
                  sendButton.Clicked += OnCommand;
                  ShowAll ();
            }
            public GameAdvertisementGraph(ICSClient c)
            {
                graph = new Graph ();
                categories = new Hashtable ();
                categories["blitz"] = 1;
                categories["standard"] = 1;
                categories["lightning"] = 1;
                categories["untimed"] = 1;

                graph.GameFocusedEvent += OnGameFocused;
                graph.GameClickedEvent += OnGameClicked;

                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                this.client = c;

                client.GameAdvertisementAddEvent +=
                    OnGameAdvertisementAddEvent;
                client.GameAdvertisementRemoveEvent +=
                    OnGameAdvertisementRemoveEvent;
                client.GameAdvertisementsClearedEvent +=
                    OnGameAdvertisementsCleared;
                SetSizeRequest (600, 400);

                image = new Gtk.Image ();
                PackStart (graph, true, true, 4);

                HBox box = new HBox ();
                  box.PackStart (image, false, false, 4);
                  box.PackStart (infoLabel, true, true, 4);

                  PackStart (box, false, true, 4);
                  ShowAll ();
            }
            public RelayTournamentsView(ICSClient c)
            {
                client = c;
                tournamentIter = TreeIter.Zero;
                store = new TreeStore (typeof (int),
                               typeof (string),
                               typeof (string));
                  create_tree ();
                  refreshButton = new Button (Stock.Refresh);
                  refreshButton.Clicked += OnClicked;
                  infoLabel = new Label ();
                  infoLabel.UseMarkup = true;
                  infoLabel.Xalign = 0;
                  infoLabel.Xpad = 4;
                //infoLabel.Yalign = 0;
                //infoLabel.Ypad = 4;
                HBox box = new HBox ();
                  box.PackStart (infoLabel, true, true, 4);
                  box.PackStart (refreshButton, false, false,
                         4);
                  PackStart (box, false, true, 4);

                ScrolledWindow scroll = new ScrolledWindow ();
                  scroll.HscrollbarPolicy =
                    scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                  scroll.Add (tree);
                  PackStart (scroll, true, true, 4);
                  client.AuthEvent += OnAuth;
                  ShowAll ();
            }
Пример #5
0
	static void SetUpGui ()
	{
		Window w = new Window ("Sign Up");
		
		firstname_entry = new Entry ();
		lastname_entry = new Entry ();
		email_entry = new Entry ();
		
		VBox outerv = new VBox ();
		outerv.BorderWidth = 12;
		outerv.Spacing = 12;
		w.Add (outerv);
		
		Label l = new Label ("Enter your name and preferred address");
		l.Xalign = 0;
		//l.UseMarkup = true;
		outerv.PackStart (l, false, false, 0);
		
		HBox h = new HBox ();
		//h.Spacing = 6;
		outerv.PackStart (h);
		
		VBox v = new VBox ();
		//v.Spacing = 6;
		h.PackStart (v, false, false, 0);
		
		Button l2;
		l2 = new Button ("First Name:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;
		
		l2 = new Button ("Last Name:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;
		
		l2 = new Button ("Email Address:");
		//l.Xalign = 0;
		v.PackStart (l2, true, false, 0);
		//l.MnemonicWidget = firstname_entry;

		v = new VBox ();
		//v.Spacing = 6;
		h.PackStart (v, true, true, 0);
		
		v.PackStart (firstname_entry, true, true, 0);
		v.PackStart (lastname_entry, true, true, 0);
		v.PackStart (email_entry, true, true, 0);
		
		w.ShowAll ();
	}
Пример #6
0
		public Command Run (WindowFrame transientFor, MessageDescription message)
		{
			this.icon = GetIcon (message.Icon);
			if (ConvertButtons (message.Buttons, out buttons)) {
				// Use a system message box
				if (message.SecondaryText == null)
					message.SecondaryText = String.Empty;
				else {
					message.Text = message.Text + "\r\n\r\n" + message.SecondaryText;
					message.SecondaryText = String.Empty;
				}
				var wb = (WindowFrameBackend)Toolkit.GetBackend (transientFor);
				if (wb != null) {
					this.dialogResult = MessageBox.Show (wb.Window, message.Text, message.SecondaryText,
														this.buttons, this.icon, this.defaultResult, this.options);
				}
				else {
					this.dialogResult = MessageBox.Show (message.Text, message.SecondaryText, this.buttons,
														this.icon, this.defaultResult, this.options);
				}
				return ConvertResultToCommand (this.dialogResult);
			}
			else {
				// Custom message box required
				Dialog dlg = new Dialog ();
				dlg.Resizable = false;
				dlg.Padding = 0;
				HBox mainBox = new HBox { Margin = 25 };

				if (message.Icon != null) {
					var image = new ImageView (message.Icon.WithSize (32,32));
					mainBox.PackStart (image, vpos: WidgetPlacement.Start);
				}
				VBox box = new VBox () { Margin = 3, MarginLeft = 8, Spacing = 15 };
				mainBox.PackStart (box, true);
				var text = new Label {
					Text = message.Text ?? ""
				};
				Label stext = null;
				box.PackStart (text);
				if (!string.IsNullOrEmpty (message.SecondaryText)) {
					stext = new Label {
						Text = message.SecondaryText
					};
					box.PackStart (stext);
				}
				dlg.Buttons.Add (message.Buttons.ToArray ());
				if (mainBox.Surface.GetPreferredSize (true).Width > 480) {
					text.Wrap = WrapMode.Word;
					if (stext != null)
						stext.Wrap = WrapMode.Word;
					mainBox.WidthRequest = 480;
				}
				var s = mainBox.Surface.GetPreferredSize (true);

				dlg.Content = mainBox;
				return dlg.Run ();
			}
		}
            public GamesListWidget()
                : base()
            {
                HBox hbox = new HBox ();
                  hbox.PackStart (new
                          Label (Catalog.
                             GetString
                             ("Filter")), false,
                          false, 4);
                  searchEntry = new Entry ();
                  hbox.PackStart (searchEntry, true, true, 4);
                  tree = new TreeView ();
                  PackStart (hbox, false, true, 0);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy = PolicyType.Automatic;
                  win.VscrollbarPolicy = PolicyType.Automatic;
                  win.Add (tree);
                  PackStart (win, true, true, 4);

                  SetupTree ();
                  ShowAll ();
                  searchEntry.Activated += OnSearch;
            }
            public GamesListWidget()
                : base()
            {
                HBox hbox = new HBox ();
                hbox.PackStart (new
                        Label (Catalog.
                               GetString
                               ("Filter")), false,
                        false, 4);

                view = CreateIconView ();
                win = new ScrolledWindow ();
                win.HscrollbarPolicy = PolicyType.Automatic;
                win.VscrollbarPolicy = PolicyType.Automatic;
                win.Add (view);
                PackStart (win, true, true, 4);

                ShowAll ();
            }
            public ObservingGamePage(ICSGameObserverWidget
						  widget,
						  MoveDetails details)
                : base()
            {
                this.win = widget;
                gameId = details.gameNumber;

                InitGameWidget (details);

                movesWidget = new ChessMovesWidget ();
                movesWidget.CursorChanged += OnCursorChanged;

                gameWidget.WhiteAtBottom =
                    !details.blackAtBottom;
                board.side = details.blackAtBottom;
                gameWidget.whiteClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);
                gameWidget.blackClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);

                white = details.white;
                black = details.black;
                gameWidget.White = white;
                gameWidget.Black = black;

                gameWidget.Show ();
                board.Show ();
                movesWidget.Show ();

                HBox box = new HBox ();
                Button closeButton;
                if (Config.WindowsBuild)
                    closeButton =
                        new Button (Stock.Close);
                else
                  {
                      closeButton = new Button ("");
                      closeButton.Image =
                          new Image (Stock.Close,
                                 IconSize.Menu);
                  }
                resultLabel = new Label ();
                resultLabel.Xalign = 0;
                box.PackStart (resultLabel, true, true, 2);
                box.PackStart (closeButton, false, false, 2);

                PackStart (box, false, true, 2);

                box = new HBox ();
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy = PolicyType.Never;
                scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                scroll.Add (movesWidget);

                VBox movesBox = new VBox ();
                movesBox.PackStart (scroll, true, true, 2);
                AddGameNavigationButtons (movesBox);

                box.PackStart (gameWidget, true, true, 2);
                box.PackStart (movesBox, false, true, 2);
                PackStart (box, true, true, 2);

                closeButton.Clicked += OnCloseButtonClicked;

                Update (details);
                ShowAll ();
            }
Пример #10
0
	public static void Main(string [] args)
	{
		Application.Init();

		Window w = new Window("EFL# Demo App");
		
		VBox vbx = new VBox ();
		vbx.Spacing = 4;
		
		MenuBar mb = new MenuBar();
		
		vbx.PackStart (mb, false, false, 0);
		
		MenuItem item = new MenuItem ("File");
		Menu file_menu = new Menu ();
		item.Submenu = file_menu;
		
		MenuItem file_item = new MenuItem ("Open");
		file_item.Activated += FileOpenHandler;
		file_menu.Append (file_item);
		
		
		
		
		file_item = new MenuItem ("Close");
		file_menu.Append (file_item);
		Menu close_menu = new Menu ();
		file_item.Submenu = close_menu;
		MenuItem close_menu_item = new MenuItem ("Close This");
		close_menu.Append (close_menu_item);
		close_menu_item = new MenuItem ("Close All");
		close_menu.Append (close_menu_item);
		
		
		
		
		file_item = new MenuItem ("Save");
		file_menu.Append (file_item);
		
		file_item = new MenuItem ("Save As");
                file_menu.Append (file_item);
		
		file_item = new MenuItem ("Quit");
		file_item.Activated += FileQuitHandler;		
                file_menu.Append (file_item);
		
		mb.Append (item);
		
		item = new MenuItem ("Edit");
		Menu edit_menu = new Menu ();
		item.Submenu = edit_menu;
		mb.Append (item);
		
		item = new MenuItem ("About");
		Menu about_menu = new Menu ();		
		item.Submenu = about_menu;
		
		MenuItem about_item = new MenuItem ("Help");
		about_item.Activated += AboutHelpHandler;
		about_menu.Append (about_item);
		
		about_item = new MenuItem ("Authors");
		about_item.Activated += AboutAuthorsHandler;
		about_menu.Append (about_item);
		
		mb.Append (item);
				
		HBox bx = new HBox ();
		
		vbx.PackStart (bx);
		
		bx.Spacing = 0;
		Button l1 = new Button ("one");				
		Button l2 = new Button ("two");
		Button l3 = new Button ("three");
		Button l4 = new Button ("four");
		Button l5 = new Button ("five");		

		l5.Clicked +=  Button_Clicked;
		
		bx.PackStart(l1);
		bx.PackStart(l2);
		bx.PackStart(l3);
		bx.PackStart(l4);
		bx.PackStart(l5);
		
		HBox inbox = new HBox ();
		inbox.Spacing = 5;
		inbox.BorderWidth = 2;
		vbx.PackStart (inbox);
		Label input_label = new Label ("What is your name?");
		input_label.Xalign = 0;
		inbox.PackStart (input_label, false, false, 0);
		input = new Entry ();
		inbox.PackStart (input);
		
		HBox bbox = new HBox ();
		Button get_text = new Button ("Get Text");
		get_text.Clicked += Get_Text;
		bbox.PackStart (get_text, false, false, 0);
		vbx.PackStart (bbox, false, false, 0);
		
		w.Add(vbx);
		w.SetDefaultSize(300, 200);
		w.ShowAll();
		
		Application.Run();
	}
Пример #11
0
        public override Control CreatePanelWidget()
        {
            HBox  hbox  = new HBox(false, 6);
            Label label = new Label();

            label.MarkupWithMnemonic = GettextCatalog.GetString("_Policy:");
            hbox.PackStart(label, false, false, 0);

            store       = new ListStore(typeof(string), typeof(PolicySet));
            policyCombo = new ComboBox(store);
            CellRenderer renderer = new CellRendererText();

            policyCombo.PackStart(renderer, true);
            policyCombo.AddAttribute(renderer, "text", 0);

            label.MnemonicWidget         = policyCombo;
            policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) =>
                                           ((string)model.GetValue(iter, 0)) == "--";
            hbox.PackStart(policyCombo, false, false, 0);

            VBox vbox = new VBox(false, 6);

            vbox.PackStart(hbox, false, false, 0);
            vbox.ShowAll();

            // Warning message to be shown when the user modifies the default policy

            warningMessage         = new HBox();
            warningMessage.Spacing = 6;
            Image img = new Image(Stock.Warning, IconSize.Menu);

            warningMessage.PackStart(img, false, false, 0);
            Label wl = new Label(GettextCatalog.GetString("Changes done in this section will only be applied to new projects. " +
                                                          "Settings for existing projects can be modified in the project (or solution) options dialog."));

            wl.Xalign       = 0;
            wl.Wrap         = true;
            wl.WidthRequest = 450;
            warningMessage.PackStart(wl, true, true, 0);
            warningMessage.ShowAll();
            warningMessage.Visible = false;
            vbox.PackEnd(warningMessage, false, false, 0);

            notebook = new Notebook();

            // Get the panels for all mime types

            List <string> types = new List <string> ();

            types.AddRange(DesktopService.GetMimeTypeInheritanceChain(mimeType));

            panelData.SectionLoaded = true;
            panels = panelData.Panels;
            foreach (IMimeTypePolicyOptionsPanel panel in panelData.Panels)
            {
                panel.SetParentSection(this);
                Widget child = panel.CreateMimePanelWidget();

                Label tlabel = new Label(panel.Label);
                label.Show();
                child.Show();
                Alignment align = new Alignment(0.5f, 0.5f, 1f, 1f);
                align.BorderWidth = 6;
                align.Add(child);
                align.Show();

                notebook.AppendPage(align, tlabel);
                panel.LoadCurrentPolicy();
            }
            notebook.SwitchPage += delegate(object o, SwitchPageArgs args) {
                if (notebook.Page >= 0 && notebook.Page < this.panels.Count)
                {
                    this.panels[notebook.Page].PanelSelected();
                }
            };
            notebook.Show();
            vbox.PackEnd(notebook, true, true, 0);

            FillPolicies();
            policyCombo.Active = 0;

            loading = false;

            if (!isRoot && panelData.UseParentPolicy)
            {
                //in this case "parent" is always first in the list
                policyCombo.Active = 0;
                notebook.Sensitive = false;
            }
            else
            {
                UpdateSelectedNamedPolicy();
            }

            policyCombo.Changed += HandlePolicyComboChanged;

            return(vbox);
        }
Пример #12
0
        protected override void Initialize(IPadWindow window)
        {
            window.Title = GettextCatalog.GetString("Errors");

            DockItemToolbar toolbar = window.GetToolbar(DockPositionType.Top);

            var btnBox = new HBox(false, 2);

            btnBox.PackStart(new ImageView(Stock.Error, Gtk.IconSize.Menu));
            errorBtnLbl = new Label();
            btnBox.PackStart(errorBtnLbl);

            errorBtn = new ToggleButton {
                Name = "toggleErrors"
            };
            errorBtn.Active      = ShowErrors;
            errorBtn.Child       = btnBox;
            errorBtn.Toggled    += new EventHandler(FilterChanged);
            errorBtn.TooltipText = GettextCatalog.GetString("Show Errors");
            UpdateErrorsNum();
            toolbar.Add(errorBtn);

            btnBox = new HBox(false, 2);
            btnBox.PackStart(new ImageView(Stock.Warning, Gtk.IconSize.Menu));
            warnBtnLbl = new Label();
            btnBox.PackStart(warnBtnLbl);

            warnBtn = new ToggleButton  {
                Name = "toggleWarnings"
            };
            warnBtn.Active      = ShowWarnings;
            warnBtn.Child       = btnBox;
            warnBtn.Toggled    += new EventHandler(FilterChanged);
            warnBtn.TooltipText = GettextCatalog.GetString("Show Warnings");
            UpdateWarningsNum();
            toolbar.Add(warnBtn);

            btnBox = new HBox(false, 2);
            btnBox.PackStart(new ImageView(Stock.Information, Gtk.IconSize.Menu));
            msgBtnLbl = new Label();
            btnBox.PackStart(msgBtnLbl);

            msgBtn = new ToggleButton  {
                Name = "toggleMessages"
            };
            msgBtn.Active      = ShowMessages;
            msgBtn.Child       = btnBox;
            msgBtn.Toggled    += new EventHandler(FilterChanged);
            msgBtn.TooltipText = GettextCatalog.GetString("Show Messages");
            UpdateMessagesNum();
            toolbar.Add(msgBtn);

            toolbar.Add(new SeparatorToolItem());

            btnBox = new HBox(false, 2);
            btnBox.PackStart(new ImageView("md-message-log", Gtk.IconSize.Menu));
            logBtnLbl = new Label(GettextCatalog.GetString("Build Output"));
            btnBox.PackStart(logBtnLbl);

            logBtn = new ToggleButton {
                Name = "toggleBuildOutput"
            };
            logBtn.Child       = btnBox;
            logBtn.TooltipText = GettextCatalog.GetString("Show build output");
            logBtn.Toggled    += HandleLogBtnToggled;
            toolbar.Add(logBtn);

            //Dummy widget to take all space between "Build Output" button and SearchEntry
            toolbar.Add(new HBox(), true);

            searchEntry = new SearchEntry();
            searchEntry.Entry.Changed += searchPatternChanged;
            searchEntry.WidthRequest   = 200;
            searchEntry.Visible        = true;
            toolbar.Add(searchEntry);

            toolbar.ShowAll();

            UpdatePadIcon();
        }
        public HorizontalSliderSample()
        {
            var sl1 = new HSlider {
                MinimumValue  = 0,
                MaximumValue  = 2,
                StepIncrement = 0.05,
                SnapToTicks   = true,
            };

            var lbl1 = new Label(sl1.Value.ToString("F2"));

            sl1.ValueChanged += (sender, e) => {
                lbl1.Text = (sl1.Value).ToString("F2");
            };

            var sl2 = new HSlider {
                MinimumValue  = -9,
                MaximumValue  = 0,
                StepIncrement = 2,
                SnapToTicks   = true,
            };

            var lbl2 = new Label(sl2.Value.ToString("F2"));

            sl2.ValueChanged += (sender, e) => {
                lbl2.Text = (sl2.Value).ToString("F2");
            };

            var sl21 = new HSlider {
                MinimumValue  = 0,
                MaximumValue  = 9,
                StepIncrement = 2,
                SnapToTicks   = true,
            };

            var lbl21 = new Label(sl21.Value.ToString("F2"));

            sl21.ValueChanged += (sender, e) => {
                lbl21.Text = (sl21.Value).ToString("F2");
            };

            var sl22 = new HSlider {
                MinimumValue  = -9,
                MaximumValue  = 9,
                StepIncrement = 2,
                SnapToTicks   = true,
            };

            var lbl22 = new Label(sl22.Value.ToString("F2"));

            sl22.ValueChanged += (sender, e) => {
                lbl22.Text = (sl22.Value).ToString("F2");
            };


            var sl23 = new HSlider {
                MinimumValue  = -9,
                MaximumValue  = 9,
                StepIncrement = 1,
                SnapToTicks   = true,
            };

            var lbl23 = new Label(sl23.Value.ToString("F2"));

            sl23.ValueChanged += (sender, e) => {
                lbl23.Text = (sl23.Value).ToString("F2");
            };

            var sl3 = new HSlider {
                MinimumValue  = -9,
                MaximumValue  = 9,
                StepIncrement = 2,
                SnapToTicks   = false,
            };

            var lbl3 = new Label(sl3.Value.ToString("F2"));

            sl3.ValueChanged += (sender, e) => {
                lbl3.Text = (sl2.Value = sl21.Value = sl22.Value = sl23.Value = sl3.Value).ToString("F2");
            };

            var sl4 = new HSlider {
                MinimumValue  = -1,
                MaximumValue  = 1,
                StepIncrement = 0.05
            };

            var lbl4 = new Label(sl4.Value.ToString("F"));

            lbl4.ExpandHorizontal = false;

            var sl4box = new VBox();

            sl4box.PackStart(lbl4, false, hpos: WidgetPlacement.Start);
            sl4box.PackStart(sl4);

            sl4.ValueChanged += (sender, e) => {
                var offset = Math.Abs(sl4.Value) % sl4.StepIncrement;
                if (Math.Abs(offset) > double.Epsilon)
                {
                    if (offset > sl4.StepIncrement / 2)
                    {
                        if (sl4.Value >= 0)
                        {
                            sl4.Value += -offset + sl4.StepIncrement;
                        }
                        else
                        {
                            sl4.Value += offset - sl4.StepIncrement;
                        }
                    }
                    else
                    if (sl4.Value >= 0)
                    {
                        sl4.Value -= offset;
                    }
                    else
                    {
                        sl4.Value += offset;
                    }
                }

                lbl4.MarginLeft = sl4.SliderPosition - (lbl4.Size.Width / 2);
                if (lbl4.MarginLeft + lbl4.Size.Width > sl4.Size.Width)
                {
                    lbl4.MarginLeft = sl4.Size.Width - lbl4.Size.Width;
                }
                if (lbl4.MarginLeft < 0)
                {
                    lbl4.MarginLeft = 0;
                }

                lbl4.Text = (sl4.Value).ToString("F2");
            };
            sl4.Value = sl4.MinimumValue;


            var sl4Labels = new HBox();

            sl4Labels.PackStart(new Label("-1"), true);
            sl4Labels.PackStart(new Label("0")
            {
                TextAlignment = Alignment.Center
            }, true);
            sl4Labels.PackStart(new Label("1")
            {
                TextAlignment = Alignment.End
            }, true);
            sl4box.PackStart(sl4Labels);

            Add(sl1, 0, 0, hexpand: true);
            Add(lbl1, 1, 0);
            Add(sl2, 0, 1, hexpand: true);
            Add(lbl2, 1, 1);
            Add(sl21, 0, 2, hexpand: true);
            Add(lbl21, 1, 2);
            Add(sl22, 0, 3, hexpand: true);
            Add(lbl22, 1, 3);
            Add(sl23, 0, 4, hexpand: true);
            Add(lbl23, 1, 4);
            Add(sl3, 0, 5, hexpand: true);
            Add(lbl3, 1, 5);
            Add(sl4box, 0, 6, hexpand: true);
        }
            private VBox GetRightPane()
            {
                VBox vbox = new VBox ();

                // labels
                moveNumberLabel = new Label ();
                nagCommentLabel = new Label ();
                nagCommentLabel.Xalign = 0;
                HBox hbox = new HBox ();
                hbox.PackStart (moveNumberLabel, false, false,
                        2);
                hbox.PackStart (nagCommentLabel, false, false,
                        2);

                vbox.PackStart (hbox, false, false, 2);

                // board
                chessGameDetailsBox = new VBox ();
                chessGameDetailsBox.PackStart (gameView,
                                   true, true, 4);

                vbox.PackStart (chessGameDetailsBox, true,
                        true, 2);

                // buttons
                firstButton = new Button ();
                firstButton.Clicked += on_first_clicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += on_prev_clicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += on_next_clicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += on_last_clicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox bbox = new HBox ();
                bbox.PackStart (firstButton, false, false, 1);
                bbox.PackStart (prevButton, false, false, 1);
                bbox.PackStart (nextButton, false, false, 1);
                bbox.PackStart (lastButton, false, false, 1);
                Alignment alignment =
                    new Alignment (0.5f, 1, 0, 0);
                alignment.Add (bbox);
                alignment.Show ();

                vbox.PackStart (alignment, false, false, 2);

                return vbox;
            }
        public override Widget CreateWidget()
        {
            var icon  = Xwt.Drawing.Image.FromResource("lightning-light-16.png");
            var image = new Xwt.ImageView(icon).ToGtkWidget();

            HBox box = new HBox(false, 6);
            VBox vb  = new VBox();

            vb.PackStart(image, false, false, 0);
            box.PackStart(vb, false, false, 0);
            vb = new VBox(false, 6);
            vb.PackStart(new Gtk.Label()
            {
                Markup = GettextCatalog.GetString("<b>{0}</b> has been thrown", exception.Type),
                Xalign = 0
            });
            messageLabel = new Gtk.Label()
            {
                Xalign    = 0,
                NoShowAll = true
            };
            vb.PackStart(messageLabel);

            var  detailsBtn = new Xwt.LinkLabel(GettextCatalog.GetString("Show Details"));
            HBox hh         = new HBox();

            detailsBtn.NavigateToUrl += (o, e) => dlg.ShowDialog();
            hh.PackStart(detailsBtn.ToGtkWidget(), false, false, 0);
            vb.PackStart(hh, false, false, 0);

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

            vb = new VBox();
            var closeButton = new ImageButton()
            {
                InactiveImage = closeSelImage,
                Image         = closeSelOverImage
            };

            closeButton.Clicked += delegate {
                dlg.ShowMiniButton();
            };
            vb.PackStart(closeButton, false, false, 0);
            box.PackStart(vb, false, false, 0);

            exception.Changed += delegate {
                Application.Invoke(delegate {
                    LoadData();
                });
            };
            LoadData();

            PopoverWidget eb = new PopoverWidget();

            eb.ShowArrow       = true;
            eb.EnableAnimation = true;
            eb.PopupPosition   = PopupPosition.Left;
            eb.ContentBox.Add(box);
            eb.ShowAll();
            return(eb);
        }
            public ObservableGamesWidget(GameObservationManager
						      observer)
            {
                obManager = observer;
                iters = new TreeIter[3, 4];
                gamesView = new TreeView ();
                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                observer.ObservableGameEvent +=
                    OnObservableGameEvent;

                store = new TreeStore (typeof (string),	// used for filtering
                               typeof (int),	// gameid
                               typeof (string),	// markup
                               typeof (string),	//
                               typeof (string));

                  gamesView.HeadersVisible = true;
                  gamesView.HeadersClickable = true;

                  gamesView.AppendColumn (Catalog.
                              GetString ("Games"),
                              new
                              CellRendererText (),
                              "markup", 2);
                  gamesView.AppendColumn (Catalog.
                              GetString ("Time"),
                              new
                              CellRendererText (),
                              "markup", 3);
                  gamesView.AppendColumn (Catalog.
                              GetString
                              ("Category"),
                              new
                              CellRendererText (),
                              "markup", 4);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (gamesView);

                  UpdateInfoLabel ();

                  filterEntry = new Entry ();
                  filterEntry.Changed += OnFilter;

                  filter = new TreeModelFilter (store, null);
                  filter.VisibleFunc = FilterFunc;
                  gamesView.Model = filter;

                  AddParentIters ();

                  infoLabel.UseMarkup = true;
                Button refreshButton =
                    new Button (Stock.Refresh);
                  refreshButton.Clicked +=
                    delegate (object o, EventArgs args)
                {
                    Clear ();
                    obManager.GetGames ();
                };
                Alignment align = new Alignment (0, 1, 0, 0);
                align.Add (refreshButton);

                HBox hbox = new HBox ();
                hbox.PackStart (infoLabel, true, true, 4);
                hbox.PackStart (align, false, false, 4);

                PackStart (hbox, false, true, 4);

                Label tipLabel = new Label ();
                tipLabel.Xalign = 0;
                tipLabel.Xpad = 4;
                tipLabel.Markup =
                    String.
                    Format ("<small><i>{0}</i></small>",
                        Catalog.
                        GetString
                        ("Press the refresh button to get an updated list of games.\nDouble click on a game to observe it."));
                PackStart (tipLabel, false, true, 4);
                PackStart (filterEntry, false, true, 4);
                PackStart (win, true, true, 4);

                gamesView.RowActivated += OnRowActivated;
                SetSizeRequest (600, 400);
                ShowAll ();
            }
Пример #17
0
        void SetLayout()
        {
            var vbox = new VBox();

            vbox.Accessible.Role = Xwt.Accessibility.Role.Filler;
            vbox.MinWidth        = 450;

            var actionLabel = new Label(GettextCatalog.GetString("Breakpoint Action"))
            {
                Font = vbox.Font.WithWeight(FontWeight.Bold)
            };

            vbox.PackStart(actionLabel);

            var breakpointActionGroup = new VBox {
                MarginLeft = 12
            };

            breakpointActionGroup.Accessible.Role = Xwt.Accessibility.Role.Filler;

            breakpointActionGroup.PackStart(breakpointActionPause);
            breakpointActionGroup.PackStart(breakpointActionPrint);

            var printExpressionGroup = new HBox {
                MarginLeft = 18
            };

            printExpressionGroup.Accessible.Role = Xwt.Accessibility.Role.Filler;

            printExpressionGroup.PackStart(entryPrintExpression, true);

            // We'll ignore this label because the content of the label is included in the accessibility Help text of the
            // entryPrintExpression widget
            warningPrintExpression.Accessible.Role = Xwt.Accessibility.Role.Filler;
            printExpressionGroup.PackStart(warningPrintExpression);
            breakpointActionGroup.PackStart(printExpressionGroup);

            breakpointActionGroup.PackEnd(printMessageTip);

            vbox.PackStart(breakpointActionGroup);

            var whenLabel = new Label(GettextCatalog.GetString("When to Take Action"))
            {
                Font = vbox.Font.WithWeight(FontWeight.Bold)
            };

            vbox.PackStart(whenLabel);

            var whenToTakeActionRadioGroup = new VBox {
                MarginLeft = 12
            };

            whenToTakeActionRadioGroup.Accessible.Role = Xwt.Accessibility.Role.Filler;

            // Function group
            {
                whenToTakeActionRadioGroup.PackStart(stopOnFunction);

                hboxFunction.PackStart(entryFunctionName, true);
                hboxFunction.PackEnd(warningFunction);

                whenToTakeActionRadioGroup.PackStart(hboxFunction);
            }

            // Exception group
            {
                whenToTakeActionRadioGroup.PackStart(stopOnException);

                hboxException = new HBox();
                hboxException.Accessible.Role = Xwt.Accessibility.Role.Filler;

                hboxException.PackStart(entryExceptionType, true);
                hboxException.PackEnd(warningException);

                vboxException.PackStart(hboxException);
                vboxException.PackStart(checkIncludeSubclass);
                whenToTakeActionRadioGroup.PackStart(vboxException);
            }

            // Location group
            {
                whenToTakeActionRadioGroup.PackStart(stopOnLocation);

                hboxLocation.PackStart(entryLocationFile, true);
                hboxLocation.PackStart(warningLocation);
                vboxLocation.PackEnd(hboxLocation);

                whenToTakeActionRadioGroup.PackStart(vboxLocation);
            }
            vbox.PackStart(whenToTakeActionRadioGroup);

            var advancedLabel = new Label(GettextCatalog.GetString("Advanced Conditions"))
            {
                Font = vbox.Font.WithWeight(FontWeight.Bold)
            };

            vbox.PackStart(advancedLabel);

            var vboxAdvancedConditions = new VBox {
                MarginLeft = 30
            };

            vboxAdvancedConditions.Accessible.Role = Xwt.Accessibility.Role.Filler;

            var hboxHitCount = new HBox();

            hboxHitCount.Accessible.Role = Xwt.Accessibility.Role.Filler;
            hboxHitCount.PackStart(ignoreHitType, true);
            hboxHitCount.PackStart(ignoreHitCount);
            vboxAdvancedConditions.PackStart(hboxHitCount);

            vboxAdvancedConditions.PackStart(conditionalHitType);
            hboxCondition = new HBox();
            hboxCondition.Accessible.Role = Xwt.Accessibility.Role.Filler;

            hboxCondition.PackStart(entryConditionalExpression, true);
            hboxCondition.PackStart(warningCondition);
            vboxAdvancedConditions.PackStart(hboxCondition);

            conditionalExpressionTip.Accessible.Role = Xwt.Accessibility.Role.Filler;
            vboxAdvancedConditions.PackEnd(conditionalExpressionTip);

            vbox.PackStart(vboxAdvancedConditions);


            Buttons.Add(new DialogButton(Command.Cancel));
            Buttons.Add(buttonOk);

            Content = vbox;

            if (IdeApp.Workbench != null)
            {
                Gtk.Widget parent = ((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget(vbox)).Parent;
                while (parent != null && !(parent is Gtk.Window))
                {
                    parent = parent.Parent;
                }
                if (parent is Gtk.Window)
                {
                    ((Gtk.Window)parent).TransientFor = IdeApp.Workbench.RootWindow;
                }
            }

            OnUpdateControls(null, null);
        }
Пример #18
0
        void HandleScopeChanged(object sender, EventArgs e)
        {
            if (hboxPath != null)
            {
                // comboboxentryPath and buttonBrowsePaths are destroyed with hboxPath
                foreach (Widget w in new Widget[] {
                    labelPath,
                    hboxPath,
                    checkbuttonRecursively
                })
                {
                    tableFindAndReplace.Remove(w);
                    w.Destroy();
                }
                labelPath              = null;
                hboxPath               = null;
                comboboxentryPath      = null;
                buttonBrowsePaths      = null;
                checkbuttonRecursively = null;

                //tableFindAndReplace.NRows = showReplace ? 4u : 3u;

                var childCombo = (Table.TableChild)tableFindAndReplace[labelFileMask];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 3;
                childCombo.BottomAttach = tableFindAndReplace.NRows - 2;

                childCombo              = (Table.TableChild)tableFindAndReplace[searchentry1];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 3;
                childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
            }

            if (comboboxScope.Active == ScopeDirectories)
            {
                // DirectoryScope
                tableFindAndReplace.NRows = showReplace ? 6u : 5u;
                labelPath = new Label {
                    LabelProp    = GettextCatalog.GetString("_Path:"),
                    UseUnderline = true,
                    Xalign       = 0f
                };

                tableFindAndReplace.Add(labelPath);

                var childCombo = (Table.TableChild)tableFindAndReplace[labelPath];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 3;
                childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
                childCombo.XOptions     = childCombo.YOptions = (AttachOptions)4;

                hboxPath = new HBox();
                var properties = PropertyService.Get("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties());
                comboboxentryPath            = new ComboBoxEntry();
                comboboxentryPath.Destroyed += ComboboxentryPathDestroyed;
                LoadHistory("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath);
                hboxPath.PackStart(comboboxentryPath);

                labelPath.MnemonicWidget = comboboxentryPath;

                var boxChild = (Box.BoxChild)hboxPath[comboboxentryPath];
                boxChild.Position = 0;
                boxChild.Expand   = boxChild.Fill = true;

                buttonBrowsePaths = new Button {
                    Label = "..."
                };
                buttonBrowsePaths.Clicked += ButtonBrowsePathsClicked;
                hboxPath.PackStart(buttonBrowsePaths);
                boxChild          = (Box.BoxChild)hboxPath[buttonBrowsePaths];
                boxChild.Position = 1;
                boxChild.Expand   = boxChild.Fill = false;

                tableFindAndReplace.Add(hboxPath);
                childCombo              = (Table.TableChild)tableFindAndReplace[hboxPath];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 3;
                childCombo.BottomAttach = tableFindAndReplace.NRows - 2;
                childCombo.LeftAttach   = 1;
                childCombo.RightAttach  = 2;
                childCombo.XOptions     = childCombo.YOptions = (AttachOptions)4;

                checkbuttonRecursively = new CheckButton {
                    Label        = GettextCatalog.GetString("Re_cursively"),
                    Active       = properties.Get("SearchPathRecursively", true),
                    UseUnderline = true
                };

                checkbuttonRecursively.Destroyed += CheckbuttonRecursivelyDestroyed;
                tableFindAndReplace.Add(checkbuttonRecursively);
                childCombo              = (Table.TableChild)tableFindAndReplace[checkbuttonRecursively];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 2;
                childCombo.BottomAttach = tableFindAndReplace.NRows - 1;
                childCombo.LeftAttach   = 1;
                childCombo.RightAttach  = 2;
                childCombo.XOptions     = childCombo.YOptions = (AttachOptions)4;

                childCombo              = (Table.TableChild)tableFindAndReplace[labelFileMask];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 1;
                childCombo.BottomAttach = tableFindAndReplace.NRows;

                childCombo              = (Table.TableChild)tableFindAndReplace[searchentry1];
                childCombo.TopAttach    = tableFindAndReplace.NRows - 1;
                childCombo.BottomAttach = tableFindAndReplace.NRows;
            }
            Requisition req = SizeRequest();

            Resize(req.Width, req.Height);
            //	this.QueueResize ();
            ShowAll();
        }
Пример #19
0
        /// <summary>
        /// Initialize components.
        /// </summary>
        private void _initializeComponents()
        {
            InfoBox _infoBox    = new InfoBox(Director.Properties.Resources.ExportDialog, DirectorImages.SERVER_IMAGE);
            VBox    _contentBox = new VBox();

            _contentBox.PackStart(_infoBox);

            // Create scenarios frame
            Frame f = new Frame()
            {
                Label   = Director.Properties.Resources.SelectScenarios,
                Padding = 10
            };

            // Scenario view
            ScenarioListWidget = new ScenarioList(ActiveServer);
            f.Content          = ScenarioListWidget;

            // Add to content box
            _contentBox.PackStart(f);

            // Add Export path
            ExportPath = new TextEntry()
            {
                Sensitive           = false,
                HorizontalPlacement = WidgetPlacement.Fill
            };

            // Button for selecting path
            Button SelectPath = new Button("...")
            {
                WidthRequest        = 35,
                MinWidth            = 35,
                HorizontalPlacement = WidgetPlacement.End
            };

            SelectPath.Clicked += delegate
            {
                SaveFileDialog dlg = new SaveFileDialog(Director.Properties.Resources.DialogSaveScenario)
                {
                    Multiselect     = false,
                    InitialFileName = ActiveServer.Name
                };
                dlg.Filters.Add(new FileDialogFilter("Director files", "*.adfe"));
                if (dlg.Run() && dlg.FileNames.Count() == 1)
                {
                    ExportPath.Text = dlg.FileName;
                    if (Path.GetExtension(dlg.FileName) != ".adfe")
                    {
                        ExportPath.Text += ".adfe";
                    }
                }
            };
            Frame save = new Frame()
            {
                Label   = Director.Properties.Resources.DialogSaveScenario,
                Padding = 10
            };
            HBox SaveBox = new HBox();

            SaveBox.PackStart(ExportPath, true, true);
            SaveBox.PackStart(SelectPath, false, false);
            save.Content = SaveBox;
            _contentBox.PackStart(save);

            // Save button
            Button SaveBtn = new Button(Director.Properties.Resources.SaveServer)
            {
                HorizontalPlacement = WidgetPlacement.End,
                ExpandHorizontal    = false,
                ExpandVertical      = false,
                WidthRequest        = (Config.Cocoa) ? 95 : 80,
                MinWidth            = (Config.Cocoa) ? 95 : 80,
                Image = Image.FromResource(DirectorImages.SAVE_SCENARIO_ICON)
            };

            SaveBtn.Clicked += SaveBtn_Clicked;

            // Add to form
            _contentBox.PackStart(SaveBtn, false, WidgetPlacement.End, WidgetPlacement.End);

            // Set content box as content
            Content = _contentBox;
        }
Пример #20
0
		public Boxes ()
		{
			HBox box1 = new HBox ();
			
			VBox box2 = new VBox ();
			box2.PackStart (new SimpleBox (30));
			box2.PackStart (new SimpleBox (30));
			box2.PackStart (new SimpleBox (30), true);
			
			box1.PackStart (box2, true);
			box1.PackStart (new SimpleBox (30));
			box1.PackStart (new SimpleBox (30), expand:true, fill:false);
			PackStart (box1);
			
			HBox box3 = new HBox ();
			box3.PackEnd (new SimpleBox (30));
			box3.PackStart (new SimpleBox (20) {Color = new Color (1, 0.5, 0.5)});
			box3.PackEnd (new SimpleBox (40));
			box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)});
			box3.PackEnd (new SimpleBox (30));
			box3.PackStart (new SimpleBox (10) {Color = new Color (1, 0.5, 0.5)}, true);
			PackStart (box3);
			
			HBox box4 = new HBox ();
			Button b = new Button ("Click me");
			b.Clicked += delegate {
				b.Label = "Button has grown";
			};
			box4.PackStart (new SimpleBox (30), true);
			box4.PackStart (b);
			box4.PackStart (new SimpleBox (30), true);
			PackStart (box4);
			
			HBox box5 = new HBox ();
			Button b2 = new Button ("Hide / Show");
			box5.PackStart (new SimpleBox (30), true);
			var hsb = new SimpleBox (20);
			box5.PackStart (hsb);
			box5.PackStart (b2);
			box5.PackStart (new SimpleBox (30), true);
			b2.Clicked += delegate {
				hsb.Visible = !hsb.Visible;
			};
			PackStart (box5);
			
			HBox box6 = new HBox ();
			for (int n=0; n<15; n++) {
				var w = new Label ("TestLabel" + n);
				w.WidthRequest = 10;
				box6.PackStart (w);
			}
			PackStart (box6);

			VBox box7 = new VBox () { Spacing = 0 };
			box7.BackgroundColor = Colors.White;

			box7.PackStart (new Label("Hi there") { Margin = new WidgetSpacing (10, 10, 0, 0) });
			box7.PackStart (new SpecialWidget() { MarginTop = 15 });
			box7.PackStart (new SpecialWidget() { Margin = 5 });
			PackStart (box7);
		}
Пример #21
0
        void Build()
        {
            Title         = GettextCatalog.GetString("Exception Caught");
            DefaultWidth  = 500;
            DefaultHeight = 500;
            HeightRequest = 350;
            WidthRequest  = 350;
            VBox.Foreach(VBox.Remove);
            VBox.PackStart(CreateExceptionHeader(), false, true, 0);
            paned = new VPanedThin();
            paned.GrabAreaSize = 10;
            paned.Pack1(CreateStackTraceTreeView(), true, false);
            paned.Pack2(CreateExceptionValueTreeView(), true, false);
            paned.Show();
            var vbox            = new VBox(false, 0);
            var whiteBackground = new EventBox();

            whiteBackground.Show();
            whiteBackground.ModifyBg(StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor());
            whiteBackground.Add(vbox);
            hadInnerException = HasInnerException();
            if (hadInnerException)
            {
                vbox.PackStart(new VBox(), false, false, 6);
                vbox.PackStart(CreateInnerExceptionMessage(), false, true, 0);
                vbox.ShowAll();
            }
            vbox.PackStart(paned, true, true, 0);
            vbox.Show();

            if (hadInnerException)
            {
                var box = new HBox();
                box.PackStart(CreateInnerExceptionsTree(), false, false, 0);
                box.PackStart(whiteBackground, true, true, 0);
                box.Show();
                VBox.PackStart(box, true, true, 0);
                DefaultWidth  = 900;
                DefaultHeight = 700;
                WidthRequest  = 550;
                HeightRequest = 450;
            }
            else
            {
                VBox.PackStart(whiteBackground, true, true, 0);
            }
            var actionArea = new HBox(false, 0)
            {
                BorderWidth = 14
            };

            OnlyShowMyCodeCheckbox          = new CheckButton(GettextCatalog.GetString("_Only show my code."));
            OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
            OnlyShowMyCodeCheckbox.Show();
            OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions().ProjectAssembliesOnly;

            var alignment = new Alignment(0.0f, 0.5f, 0.0f, 0.0f)
            {
                Child = OnlyShowMyCodeCheckbox
            };

            alignment.Show();

            actionArea.PackStart(alignment, true, true, 0);
            actionArea.PackStart(CreateButtonBox(), false, true, 0);
            actionArea.PackStart(new VBox(), false, true, 3);               // dummy just to take extra 6px at end to make it 20pixels
            actionArea.ShowAll();

            VBox.PackStart(actionArea, false, true, 0);
        }
Пример #22
0
        public StructureDatabaseView(string fileName)
        {
            this.filename = fileName;

            hbox = new HBox();

            sqlLiteDal = new SqlLiteDal(fileName);

            lblTable = new Label(MainClass.Languages.Translate("tables"));
            hbox.PackStart(lblTable, false, false, 10);

            cbTable          = new ComboBox();
            cbTable.Changed += new EventHandler(OnComboProjectChanged);

            CellRendererText textRenderer = new CellRendererText();

            cbTable.PackStart(textRenderer, true);
            cbTable.AddAttribute(textRenderer, "text", 0);
            cbTable.Model        = tablesComboModel;
            cbTable.WidthRequest = 200;

            hbox.PackStart(cbTable, false, false, 2);
            hbox.PackEnd(new Label(""), true, true, 2);

            HButtonBox hbbAction = new HButtonBox();

            hbbAction.LayoutStyle = Gtk.ButtonBoxStyle.Start;
            hbbAction.Spacing     = 6;

            Button btnAddTable = new Button(MainClass.Languages.Translate("add_table"));

            btnAddTable.Clicked += delegate(object sender, EventArgs e) {
                SqlLiteAddTable addtable = new SqlLiteAddTable(filename);
                int             result   = addtable.Run();
                if (result == (int)ResponseType.Ok)
                {
                    GetTables();
                }
                addtable.Destroy();
            };

            Button btnDeleteTable = new Button(MainClass.Languages.Translate("delete_table"));

            btnDeleteTable.Clicked += delegate(object sender, EventArgs e) {
                if (!CheckSelectTable())
                {
                    return;
                }

                MessageDialogs md     = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("permanently_delete_table", curentTable), "", Gtk.MessageType.Question);
                int            result = md.ShowDialog();
                if (result != (int)Gtk.ResponseType.Yes)
                {
                    return;
                }

                DropTable();
                GetTables();
            };

            Button btnEditTable = new Button(MainClass.Languages.Translate("edit_table"));

            btnEditTable.Clicked += delegate(object sender, EventArgs e) {
                if (!CheckSelectTable())
                {
                    return;
                }

                SqlLiteEditTable editTable = new SqlLiteEditTable(filename, curentTable);
                int result = editTable.Run();
                if (result == (int)ResponseType.Ok)
                {
                    GetTables();
                }
                editTable.Destroy();
            };


            hbbAction.Add(btnAddTable);
            hbbAction.Add(btnDeleteTable);
            hbbAction.Add(btnEditTable);
            hbox.PackEnd(hbbAction, false, false, 10);

            this.PackStart(hbox, false, false, 5);

            ScrolledWindow sw = new ScrolledWindow();

            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            treeView = new TreeView(tableModel);
            GenerateColumns();
            treeView.RulesHint = true;
            //treeView.SearchColumn = (int) Column.Description;
            sw.Add(treeView);

            this.PackStart(sw, true, true, 5);

            ScrolledWindow sw2 = new ScrolledWindow();

            sw2.ShadowType = ShadowType.EtchedIn;
            sw2.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw2.HeightRequest = 50;

            textControl               = new TextView();
            textControl.Editable      = false;
            textControl.HeightRequest = 50;
            sw2.Add(textControl);
            this.PackEnd(sw2, false, false, 5);


            this.ShowAll();
            GetTables();
            //cbTable.Active = 0;
        }
Пример #23
0
        public StatusView(string filepath, Repository vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc       = vc;
            this.filepath = filepath;
            changeSet     = vc.CreateChangeSet(filepath);

            main   = new VBox(false, 6);
            widget = main;

            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            main.PackStart(commandbar, false, false, 0);

            buttonCommit             = new Gtk.ToolButton(new Gtk.Image("vc-commit", Gtk.IconSize.Menu), GettextCatalog.GetString("Commit..."));
            buttonCommit.IsImportant = true;
            buttonCommit.Clicked    += new EventHandler(OnCommitClicked);
            commandbar.Insert(buttonCommit, -1);

            Gtk.ToolButton btnRefresh = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Refresh, IconSize.Menu), GettextCatalog.GetString("Refresh"));
            btnRefresh.IsImportant = true;
            btnRefresh.Clicked    += new EventHandler(OnRefresh);
            commandbar.Insert(btnRefresh, -1);

            buttonRevert             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert"));
            buttonRevert.IsImportant = true;
            buttonRevert.Clicked    += new EventHandler(OnRevert);
            commandbar.Insert(buttonRevert, -1);

            showRemoteStatus             = new Gtk.ToolButton(new Gtk.Image("vc-remote-status", Gtk.IconSize.Menu), GettextCatalog.GetString("Show Remote Status"));
            showRemoteStatus.IsImportant = true;
            showRemoteStatus.Clicked    += new EventHandler(OnShowRemoteStatusClicked);
            commandbar.Insert(showRemoteStatus, -1);

            Gtk.ToolButton btnCreatePatch = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("Create Patch"));
            btnCreatePatch.IsImportant = true;
            btnCreatePatch.Clicked    += new EventHandler(OnCreatePatch);
            commandbar.Insert(btnCreatePatch, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnOpen = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, IconSize.Menu), GettextCatalog.GetString("Open"));
            btnOpen.IsImportant = true;
            btnOpen.Clicked    += new EventHandler(OnOpen);
            commandbar.Insert(btnOpen, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnExpand = new Gtk.ToolButton(null, GettextCatalog.GetString("Expand All"));
            btnExpand.IsImportant = true;
            btnExpand.Clicked    += new EventHandler(OnExpandAll);
            commandbar.Insert(btnExpand, -1);

            Gtk.ToolButton btnCollapse = new Gtk.ToolButton(null, GettextCatalog.GetString("Collapse All"));
            btnCollapse.IsImportant = true;
            btnCollapse.Clicked    += new EventHandler(OnCollapseAll);
            commandbar.Insert(btnCollapse, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnSelectAll = new Gtk.ToolButton(null, GettextCatalog.GetString("Select All"));
            btnSelectAll.IsImportant = true;
            btnSelectAll.Clicked    += new EventHandler(OnSelectAll);
            commandbar.Insert(btnSelectAll, -1);

            Gtk.ToolButton btnSelectNone = new Gtk.ToolButton(null, GettextCatalog.GetString("Select None"));
            btnSelectNone.IsImportant = true;
            btnSelectNone.Clicked    += new EventHandler(OnSelectNone);
            commandbar.Insert(btnSelectNone, -1);

            status = new Label("");
            main.PackStart(status, false, false, 0);

            scroller                = new ScrolledWindow();
            scroller.ShadowType     = Gtk.ShadowType.In;
            filelist                = new FileTreeView();
            filelist.Selection.Mode = SelectionMode.Multiple;

            scroller.Add(filelist);
            scroller.HscrollbarPolicy   = PolicyType.Automatic;
            scroller.VscrollbarPolicy   = PolicyType.Automatic;
            filelist.RowActivated      += OnRowActivated;
            filelist.DiffLineActivated += OnDiffLineActivated;

            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            var crc = new CellRendererIcon();

            crc.StockId       = "vc-comment";
            colCommit         = new TreeViewColumn();
            colCommit.Spacing = 2;
            colCommit.Widget  = new Gtk.Image("vc-commit", Gtk.IconSize.Menu);
            colCommit.Widget.Show();
            colCommit.PackStart(cellToggle, false);
            colCommit.PackStart(crc, false);
            colCommit.AddAttribute(cellToggle, "active", ColCommit);
            colCommit.AddAttribute(cellToggle, "visible", ColShowToggle);
            colCommit.AddAttribute(crc, "visible", ColShowComment);

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererPixbuf();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.AddAttribute(crp, "pixbuf", ColIcon);
            colStatus.AddAttribute(crp, "visible", ColShowStatus);
            colStatus.AddAttribute(crt, "text", ColStatus);
            colStatus.AddAttribute(crt, "foreground", ColStatusColor);

            TreeViewColumn colFile = new TreeViewColumn();

            colFile.Title   = GettextCatalog.GetString("File");
            colFile.Spacing = 2;
            crp             = new CellRendererPixbuf();
            diffRenderer    = new CellRendererDiff();
            colFile.PackStart(crp, false);
            colFile.PackStart(diffRenderer, true);
            colFile.AddAttribute(crp, "pixbuf", ColIconFile);
            colFile.AddAttribute(crp, "visible", ColShowStatus);
            colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData));

            crt             = new CellRendererText();
            crp             = new CellRendererPixbuf();
            colRemote       = new TreeViewColumn();
            colRemote.Title = GettextCatalog.GetString("Remote Status");
            colRemote.PackStart(crp, false);
            colRemote.PackStart(crt, true);
            colRemote.AddAttribute(crp, "pixbuf", ColRemoteIcon);
            colRemote.AddAttribute(crt, "text", ColRemoteStatus);
            colRemote.AddAttribute(crt, "foreground", ColStatusColor);

            filelist.AppendColumn(colStatus);
            filelist.AppendColumn(colRemote);
            filelist.AppendColumn(colCommit);
            filelist.AppendColumn(colFile);

            colRemote.Visible = false;

            filestore               = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(bool));
            filelist.Model          = filestore;
            filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);

            commitBox = new VBox();

            HBox labBox = new HBox();

            labelCommit        = new Gtk.Label(GettextCatalog.GetString("Commit message:"));
            labelCommit.Xalign = 0;
            labBox.PackStart(new Gtk.Image("vc-comment", Gtk.IconSize.Menu), false, false, 0);
            labBox.PackStart(labelCommit, true, true, 3);

            commitBox.PackStart(labBox, false, false, 0);

            Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow();
            frame.ShadowType           = ShadowType.In;
            commitText                 = new TextView();
            commitText.WrapMode        = WrapMode.WordChar;
            commitText.Buffer.Changed += OnCommitTextChanged;
            frame.Add(commitText);
            commitBox.PackStart(frame, true, true, 6);

            VPaned paned = new VPaned();

            paned.Pack1(scroller, true, true);
            paned.Pack2(commitBox, false, false);
            main.PackStart(paned, true, true, 0);

            main.ShowAll();
            status.Visible = false;

            filelist.Selection.Changed += new EventHandler(OnCursorChanged);
            VersionControlService.FileStatusChanged += OnFileStatusChanged;

            filelist.HeadersClickable = true;
            filestore.SetSortFunc(0, CompareNodes);
            colStatus.SortColumnId = 0;
            filestore.SetSortFunc(1, CompareNodes);
            colRemote.SortColumnId = 1;
            filestore.SetSortFunc(2, CompareNodes);
            colCommit.SortColumnId = 2;
            filestore.SetSortFunc(3, CompareNodes);
            colFile.SortColumnId = 3;

            filestore.SetSortColumnId(3, Gtk.SortType.Ascending);

            filelist.ShowContextMenu += OnPopupMenu;

            StartUpdate();
        }
Пример #24
0
	static void SetUpGui ()
	{
		Window w = new Window ("Eap Editor");
		
		appname_entry = new Entry ();
		geninfo_entry = new Entry ();
		comments_entry = new Entry ();
		exe_entry = new Entry ();
		winname_entry = new Entry ();
		winclass_entry = new Entry ();
		
		VBox outerv = new VBox ();
		outerv.BorderWidth = 12;
		outerv.Spacing = 12;
		w.Add (outerv);
		
		HBox h = new HBox ();
		outerv.PackStart (h, false, false, 0);
		
		Button b = new Button ("Select Icon");
		h.PackStart (b, true, false, 0);
		
		h = new HBox ();
		h.Spacing = 6;
		outerv.PackStart (h);
		
		VBox v = new VBox ();
		v.Spacing = 6;
		h.PackStart (v, false, false, 0);
		
		b = new Button ("App name:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Generic Info:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Comments:");
		v.PackStart (b, true, false, 0);

		b = new Button ("Executable:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Window Name:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Window Class:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Startup notify:");
		v.PackStart (b, true, false, 0);
		
		b = new Button ("Wait Exit:");
		v.PackStart (b, true, false, 0);
		
		v = new VBox ();
		v.Spacing = 6;
		h.PackStart (v, true, true, 0);
		
		v.PackStart (appname_entry, true, true, 0);
		v.PackStart (geninfo_entry, true, true, 0);
		v.PackStart (comments_entry, true, true, 0);
		v.PackStart (exe_entry, true, true, 0);
		v.PackStart (winname_entry, true, true, 0);
		v.PackStart (winclass_entry, true, true, 0);
		//v.PackStart (new Entry(), true, true, 0);
		//v.PackStart (new Entry(), true, true, 0);
		
		CheckButton start_cbox = new CheckButton ();
		v.PackStart (start_cbox);
		
		CheckButton wait_cbox= new CheckButton ();
		v.PackStart (wait_cbox);		
		
		h = new HBox ();
		h.Spacing = 0;
		outerv.PackStart (h);
		
		v = new VBox ();		
		b = new Button ("Save");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		v = new VBox ();		
		b = new Button ("Cancel");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		w.ShowAll ();
	}
Пример #25
0
        protected override void Initialize(IPadWindow window)
        {
            this.window = window;

            DockItemToolbar toolbar = window.GetToolbar(DockPositionType.Top);

            buttonSuccess                        = new ToggleButton();
            buttonSuccess.Label                  = GettextCatalog.GetString("Successful Tests");
            buttonSuccess.Accessible.Name        = "TestResultsPad.SuccessfulTests";
            buttonSuccess.Accessible.Description = GettextCatalog.GetString("Show the results for the successful tests");
            buttonSuccess.Active                 = false;
            buttonSuccess.Image                  = new ImageView(TestStatusIcon.Success);
            buttonSuccess.Image.Show();
            buttonSuccess.Toggled    += new EventHandler(OnShowSuccessfulToggled);
            buttonSuccess.TooltipText = GettextCatalog.GetString("Show Successful Tests");
            toolbar.Add(buttonSuccess);

            buttonInconclusive                        = new ToggleButton();
            buttonInconclusive.Label                  = GettextCatalog.GetString("Inconclusive Tests");
            buttonInconclusive.Accessible.Name        = "TestResultsPad.InconclusiveTests";
            buttonInconclusive.Accessible.Description = GettextCatalog.GetString("Show the results for the inconclusive tests");
            buttonInconclusive.Active                 = true;
            buttonInconclusive.Image                  = new ImageView(TestStatusIcon.Inconclusive);
            buttonInconclusive.Image.Show();
            buttonInconclusive.Toggled    += new EventHandler(OnShowInconclusiveToggled);
            buttonInconclusive.TooltipText = GettextCatalog.GetString("Show Inconclusive Tests");
            toolbar.Add(buttonInconclusive);

            buttonFailures                        = new ToggleButton();
            buttonFailures.Label                  = GettextCatalog.GetString("Failed Tests");
            buttonFailures.Accessible.Name        = "TestResultsPad.FailedTests";
            buttonFailures.Accessible.Description = GettextCatalog.GetString("Show the results for the failed tests");
            buttonFailures.Active                 = true;
            buttonFailures.Image                  = new ImageView(TestStatusIcon.Failure);
            buttonFailures.Image.Show();
            buttonFailures.Toggled    += new EventHandler(OnShowFailuresToggled);
            buttonFailures.TooltipText = GettextCatalog.GetString("Show Failed Tests");
            toolbar.Add(buttonFailures);

            buttonIgnored                        = new ToggleButton();
            buttonIgnored.Label                  = GettextCatalog.GetString("Ignored Tests");
            buttonIgnored.Accessible.Name        = "TestResultsPad.IgnoredTests";
            buttonIgnored.Accessible.Description = GettextCatalog.GetString("Show the results for the ignored tests");
            buttonIgnored.Active                 = true;
            buttonIgnored.Image                  = new ImageView(TestStatusIcon.NotRun);
            buttonIgnored.Image.Show();
            buttonIgnored.Toggled    += new EventHandler(OnShowIgnoredToggled);
            buttonIgnored.TooltipText = GettextCatalog.GetString("Show Ignored Tests");
            toolbar.Add(buttonIgnored);

            buttonOutput                        = new ToggleButton();
            buttonOutput.Label                  = GettextCatalog.GetString("Output");
            buttonOutput.Accessible.Name        = "TestResultsPad.Output";
            buttonOutput.Accessible.Description = GettextCatalog.GetString("Show the test output");
            buttonOutput.Active                 = false;
            buttonOutput.Image                  = new ImageView(MonoDevelop.Ide.Gui.Stock.OutputIcon, IconSize.Menu);
            buttonOutput.Image.Show();
            buttonOutput.Toggled    += new EventHandler(OnShowOutputToggled);
            buttonOutput.TooltipText = GettextCatalog.GetString("Show Output");
            toolbar.Add(buttonOutput);

            toolbar.Add(new SeparatorToolItem());

            buttonRun                        = new Button();
            buttonRun.Label                  = GettextCatalog.GetString("Rerun Tests");
            buttonRun.Accessible.Name        = "TestResultsPad.Run";
            buttonRun.Accessible.Description = GettextCatalog.GetString("Start a test run and run all the tests");
            buttonRun.Image                  = new ImageView("md-execute-all", IconSize.Menu);
            buttonRun.Image.Show();
            buttonRun.Sensitive = false;
            toolbar.Add(buttonRun);

            buttonStop = new Button(new ImageView(Ide.Gui.Stock.Stop, Gtk.IconSize.Menu));
            buttonStop.Accessible.Name = "TestResultsPad.Stop";
            buttonStop.Accessible.SetTitle(GettextCatalog.GetString("Stop"));
            buttonStop.Accessible.Description = GettextCatalog.GetString("Stop the current test run");
            toolbar.Add(buttonStop);
            toolbar.ShowAll();

            buttonStop.Clicked += new EventHandler(OnStopClicked);
            buttonRun.Clicked  += new EventHandler(OnRunClicked);

            // Run panel

            DockItemToolbar runPanel = window.GetToolbar(DockPositionType.Bottom);

            infoSep = new VSeparator();

            resultLabel.UseMarkup    = true;
            infoCurrent.Ellipsize    = Pango.EllipsizeMode.Start;
            infoCurrent.WidthRequest = 0;
            runPanel.Add(resultLabel);
            runPanel.Add(progressBar);
            runPanel.Add(infoCurrent, true, 10);

            labels = new HBox(false, 10);

            infoLabel.UseMarkup = true;

            labels.PackStart(infoLabel, true, false, 0);

            runPanel.Add(new Gtk.Label(), true);
            runPanel.Add(labels);
            runPanel.Add(infoSep, false, 10);

            progressBar.HeightRequest = infoLabel.SizeRequest().Height;
            runPanel.ShowAll();
            progressBar.Hide();
            infoSep.Hide();
            resultSummary = new UnitTestResult();
            UpdateCounters();
        }
Пример #26
0
            public GameViewerUI()
                : base()
            {
                menubar = new ViewerMenuBar ();
                // this will be enabled as and when
                menubar.moveCommentMenuItem.Sensitive = false;
                chessGameWidget = new ChessGameWidget (this);

                PackStart (chessGameWidget, true, true, 2);
                statusBar = new Statusbar ();
                progressBar = new ProgressBar ();
                progressBar.Stop ();
                HBox box = new HBox ();
                box.PackStart (progressBar, false, false, 2);
                box.PackStart (statusBar, true, true, 2);
                PackStart (box, false, true, 2);
            }
Пример #27
0
        void IPadContent.Initialize(IPadWindow window)
        {
            this.window = window;

            DockItemToolbar toolbar = window.GetToolbar(PositionType.Top);

            buttonSuccess        = new ToggleButton();
            buttonSuccess.Label  = GettextCatalog.GetString("Successful Tests");
            buttonSuccess.Active = false;
            buttonSuccess.Image  = new Gtk.Image(CircleImage.Success);
            buttonSuccess.Image.Show();
            buttonSuccess.Toggled    += new EventHandler(OnShowSuccessfulToggled);
            buttonSuccess.TooltipText = GettextCatalog.GetString("Show Successful Tests");
            toolbar.Add(buttonSuccess);

            buttonInconclusive        = new ToggleButton();
            buttonInconclusive.Label  = GettextCatalog.GetString("Inconclusive Tests");
            buttonInconclusive.Active = true;
            buttonInconclusive.Image  = new Gtk.Image(CircleImage.Inconclusive);
            buttonInconclusive.Image.Show();
            buttonInconclusive.Toggled    += new EventHandler(OnShowInconclusiveToggled);
            buttonInconclusive.TooltipText = GettextCatalog.GetString("Show Inconclusive Tests");
            toolbar.Add(buttonInconclusive);

            buttonFailures        = new ToggleButton();
            buttonFailures.Label  = GettextCatalog.GetString("Failed Tests");
            buttonFailures.Active = true;
            buttonFailures.Image  = new Gtk.Image(CircleImage.Failure);
            buttonFailures.Image.Show();
            buttonFailures.Toggled    += new EventHandler(OnShowFailuresToggled);
            buttonFailures.TooltipText = GettextCatalog.GetString("Show Failed Tests");
            toolbar.Add(buttonFailures);

            buttonIgnored        = new ToggleButton();
            buttonIgnored.Label  = GettextCatalog.GetString("Ignored Tests");
            buttonIgnored.Active = true;
            buttonIgnored.Image  = new Gtk.Image(CircleImage.NotRun);
            buttonIgnored.Image.Show();
            buttonIgnored.Toggled    += new EventHandler(OnShowIgnoredToggled);
            buttonIgnored.TooltipText = GettextCatalog.GetString("Show Ignored Tests");
            toolbar.Add(buttonIgnored);

            buttonOutput        = new ToggleButton();
            buttonOutput.Label  = GettextCatalog.GetString("Output");
            buttonOutput.Active = false;
            buttonOutput.Image  = ImageService.GetImage(MonoDevelop.Ide.Gui.Stock.OutputIcon, IconSize.Menu);
            buttonOutput.Image.Show();
            buttonOutput.Toggled    += new EventHandler(OnShowOutputToggled);
            buttonOutput.TooltipText = GettextCatalog.GetString("Show Output");
            toolbar.Add(buttonOutput);

            toolbar.Add(new SeparatorToolItem());

            buttonRun       = new Button();
            buttonRun.Label = GettextCatalog.GetString("Rerun Tests");
            buttonRun.Image = new Gtk.Image(Gtk.Stock.Execute, IconSize.Menu);
            buttonRun.Image.Show();
            buttonRun.Sensitive = false;
            toolbar.Add(buttonRun);

            buttonStop = new Button(new Gtk.Image(Gtk.Stock.Stop, Gtk.IconSize.Menu));
            toolbar.Add(buttonStop);
            toolbar.ShowAll();

            buttonStop.Clicked += new EventHandler(OnStopClicked);
            buttonRun.Clicked  += new EventHandler(OnRunClicked);

            // Run panel

            DockItemToolbar runPanel = window.GetToolbar(PositionType.Bottom);

            infoSep = new VSeparator();

            resultLabel.UseMarkup    = true;
            infoCurrent.Ellipsize    = Pango.EllipsizeMode.Start;
            infoCurrent.WidthRequest = 0;
            runPanel.Add(resultLabel);
            runPanel.Add(progressBar);
            runPanel.Add(infoCurrent, true, 10);

            labels = new HBox(false, 10);

            infoLabel.UseMarkup = true;

            labels.PackStart(infoLabel, true, false, 0);

            runPanel.Add(new Gtk.Label(), true);
            runPanel.Add(labels);
            runPanel.Add(infoSep, false, 10);

            progressBar.HeightRequest = infoLabel.SizeRequest().Height;
            runPanel.ShowAll();
            resultSummary = new UnitTestResult();
            UpdateCounters();
        }
Пример #28
0
        void AddMultiOptionCombo(OptionCombo option)
        {
            if (option.Items.Count < 2)
            {
                throw new InvalidOperationException();
            }

            var model    = new ListStore(new Type[] { typeof(string), typeof(object) });
            var renderer = new CellRendererText();

            foreach (var item in option.Items)
            {
                var label = item.Name;
                var sfx   = item.Framework;

                bool hasOtherVersions = false;
                foreach (var other in option.Items)
                {
                    if (sfx == other.Framework)
                    {
                        continue;
                    }
                    if (!string.IsNullOrEmpty(other.Framework.MonoSpecificVersionDisplayName))
                    {
                        continue;
                    }
                    hasOtherVersions = true;
                    break;
                }

                if (hasOtherVersions && string.IsNullOrEmpty(sfx.MonoSpecificVersionDisplayName))
                {
                    label += " or later";
                }

                model.AppendValues(label, item.Targets);
            }

            option.Combo = new ComboBox(model);
            option.Check = new CheckButton();

            option.Combo.PackStart(renderer, true);
            option.Combo.AddAttribute(renderer, "text", 0);

            option.Combo.Active = 0;

            option.Check.Show();
            option.Combo.Show();

            option.Combo.Changed += (sender, e) => {
                if (option.Check.Active)
                {
                    TargetFrameworkChanged(option);
                }
            };
            option.Check.Toggled += (sender, e) => {
                TargetFrameworkChanged(option);
            };

            var hbox = new HBox();

            hbox.PackStart(option.Check, false, false, 0);
            hbox.PackStart(option.Combo, true, true, 0);
            hbox.Show();

            var alignment = new Alignment(0.0f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 18, RightPadding = 18
            };

            alignment.Add(hbox);
            alignment.Show();

            vbox1.PackStart(alignment, false, true, 0);
        }
Пример #29
0
        private void BuildFooter()
        {
            if (mode == EditorMode.View || TrackCount < 2)
            {
                return;
            }

            HBox button_box = new HBox();

            button_box.Spacing = 6;

            if (TrackCount > 1)
            {
                sync_all_button = new PulsingButton();
                sync_all_button.FocusInEvent += delegate {
                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        button.StartPulsing();
                    });
                };

                sync_all_button.FocusOutEvent += delegate {
                    if (sync_all_button.State == StateType.Prelight)
                    {
                        return;
                    }

                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        button.StopPulsing();
                    });
                };

                sync_all_button.StateChanged += delegate {
                    if (sync_all_button.HasFocus)
                    {
                        return;
                    }

                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        if (sync_all_button.State == StateType.Prelight)
                        {
                            button.StartPulsing();
                        }
                        else
                        {
                            button.StopPulsing();
                        }
                    });
                };

                sync_all_button.Clicked += delegate {
                    InvokeFieldSync();
                };

                Alignment alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);
                HBox      box       = new HBox();
                box.Spacing = 2;
                box.PackStart(new Image(Stock.Copy, IconSize.Button), false, false, 0);
                box.PackStart(new Label(Catalog.GetString("Sync all field _values")), false, false, 0);
                alignment.Add(box);
                sync_all_button.Add(alignment);

                TooltipSetter.Set(tooltip_host, sync_all_button, Catalog.GetString(
                                      "Apply the values of all common fields set for this track to all of the tracks selected in this editor"));

                button_box.PackStart(sync_all_button, false, false, 0);

                foreach (Widget child in ActionArea.Children)
                {
                    child.SizeAllocated += OnActionAreaChildSizeAllocated;
                }

                edit_notif_label        = new Label();
                edit_notif_label.Xalign = 1.0f;
                button_box.PackEnd(edit_notif_label, false, false, 0);
            }

            main_vbox.PackStart(button_box, false, false, 0);
            button_box.ShowAll();
        }
Пример #30
0
        private void AddPaneItems()
        {
            if (info_link_clicked)
            {
                LinkLabel link = new LinkLabel();
                link.Xalign = 0.0f;
                link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                     "Back")));

                link.Clicked += delegate(object o, EventArgs args) {
                    info_link_clicked = false;
                    pane.Clear();
                    AddPaneItems();
                };

                link.Show();
                pane.Append(link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true,
                            IconThemeUtils.LoadIcon(24, "go-previous", Stock.GoBack));

                pane.Append(Catalog.GetString(
                                "iTunes\u00ae 7 introduced new compatibility issues and currently only " +
                                "works with other iTunes\u00ae 7 clients.\n\n" +
                                "No third-party clients can connect to iTunes\u00ae music shares anymore. " +
                                "This is an intentional limitation by Apple in iTunes\u00ae 7 and we apologize for " +
                                "the unfortunate inconvenience."
                                ));
            }
            else
            {
                if (failure != DaapErrorType.UserDisconnect)
                {
                    Label header_label = new Label();
                    header_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                                 "Common reasons for connection failures:")));
                    header_label.Xalign = 0.0f;
                    header_label.Show();

                    pane.Append(header_label, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, false);

                    pane.Append(Catalog.GetString("The provided login credentials are invalid"));
                    pane.Append(Catalog.GetString("The login process was canceled"));
                    pane.Append(Catalog.GetString("Too many users are connected to this share"));
                }
                else
                {
                    pane.Append(Catalog.GetString("You are no longer connected to this music share"));
                }

                if (failure == DaapErrorType.UserDisconnect || failure == DaapErrorType.InvalidAuthentication)
                {
                    Button button = new Button(Catalog.GetString("Try connecting again"));
                    button.Clicked += delegate { source.Activate(); };

                    HBox bbox = new HBox();
                    bbox.PackStart(button, false, false, 0);
                    bbox.ShowAll();

                    pane.Append(bbox, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, false);
                    return;
                }

                LinkLabel link = new LinkLabel();
                link.Xalign = 0.0f;
                link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                     "The music share is hosted by iTunes\u00ae 7")));

                link.Clicked += delegate(object o, EventArgs args) {
                    info_link_clicked = true;
                    pane.Clear();
                    AddPaneItems();
                };

                link.Show();
                pane.Append(link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true);
            }
        }
        void Build()
        {
            BorderWidth   = 0;
            DefaultWidth  = 901;
            DefaultHeight = 632;

            Name  = "wizard_dialog";
            Title = GettextCatalog.GetString("New Project");
            if (IdeApp.Workbench.RootWindow.Visible)
            {
                WindowPosition = WindowPosition.CenterOnParent;
                TransientFor   = IdeApp.Workbench.RootWindow;
            }
            else
            {
                // FIXME: align on a native toplevel if available
                WindowPosition = WindowPosition.Center;
            }

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Accessible.SetShouldIgnore(true);
            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = 52;
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Accessible.SetShouldIgnore(true);
            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel                 = new Label();
            topBannerLabel.Name            = "topBannerLabel";
            topBannerLabel.Accessible.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();              // UNDONE: VV: Use FontService?
            font.Size   = (int)(font.Size * 2.0);
            font.Weight = Pango.Weight.Bold;
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Accessible.SetShouldIgnore(true);
            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox = new VBox();
            centreVBox.Accessible.SetShouldIgnore(true);
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox = new HBox();
            templatesHBox.Accessible.SetShouldIgnore(true);
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesBgBox = new EventBox();

            templateCategoriesBgBox.Accessible.SetShouldIgnore(true);
            templateCategoriesBgBox.Name        = "templateCategoriesVBox";
            templateCategoriesBgBox.BorderWidth = 0;
            templateCategoriesBgBox.ModifyBg(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesBgBox.WidthRequest = 220;
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                 = new TreeView();
            templateCategoriesTreeView.Name            = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.Name = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Categories"));
            templateCategoriesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project category to see all possible project templates");
            templateCategoriesTreeView.BorderWidth            = 0;
            templateCategoriesTreeView.HeadersVisible         = false;
            templateCategoriesTreeView.Model         = templateCategoriesTreeStore;
            templateCategoriesTreeView.SearchColumn  = -1;            // disable the interactive search
            templateCategoriesTreeView.ShowExpanders = false;

            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesBgBox.Add(templateCategoriesScrolledWindow);
            templatesHBox.PackStart(templateCategoriesBgBox, false, false, 0);

            // Templates.
            var templatesBgBox = new EventBox();

            templatesBgBox.Accessible.SetShouldIgnore(true);
            templatesBgBox.ModifyBg(StateType.Normal, templateListBackgroundColor);
            templatesBgBox.Name         = "templatesVBox";
            templatesBgBox.WidthRequest = 400;
            templatesHBox.PackStart(templatesBgBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                 = new TreeView();
            templatesTreeView.Name            = "templatesTreeView";
            templatesTreeView.Accessible.Name = "templatesTreeView";
            templatesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Templates"));
            templatesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project template");
            templatesTreeView.HeadersVisible         = false;
            templatesTreeView.Model         = templatesTreeStore;
            templatesTreeView.SearchColumn  = -1;            // disable the interactive search
            templatesTreeView.ShowExpanders = false;
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesBgBox.Add(templatesScrolledWindow);

            // Accessibilityy
            templateCategoriesTreeView.Accessible.AddLinkedUIElement(templatesTreeView.Accessible);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Accessible.SetShouldIgnore(true);
            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox = new VBox();
            templateVBox.Accessible.SetShouldIgnore(true);
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage = new ImageView();
            templateImage.Accessible.SetShouldIgnore(true);
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = 140;
            templateImage.WidthRequest  = 240;
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel                        = new Label();
            templateNameLabel.Name                   = "templateNameLabel";
            templateNameLabel.Accessible.Name        = "templateNameLabel";
            templateNameLabel.Accessible.Description = GettextCatalog.GetString("The name of the selected template");
            templateNameLabel.WidthRequest           = 240;
            templateNameLabel.Wrap                   = true;
            templateNameLabel.Xalign                 = 0;
            templateNameLabel.Markup                 = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel                 = new Label();
            templateDescriptionLabel.Name            = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.Name = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.SetLabel(GettextCatalog.GetString("The description of the selected template"));
            templateDescriptionLabel.WidthRequest = 240;
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);

            var tempLabel = new Label();

            tempLabel.Accessible.SetShouldIgnore(true);
            templateVBox.PackStart(tempLabel, true, true, 0);

            templatesTreeView.Accessible.AddLinkedUIElement(templateNameLabel.Accessible);
            templatesTreeView.Accessible.AddLinkedUIElement(templateDescriptionLabel.Accessible);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Accessible.SetShouldIgnore(true);
            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Accessible.SetShouldIgnore(true);
            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Accessible.SetShouldIgnore(true);
            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton                        = new Button();
            cancelButton.Name                   = "cancelButton";
            cancelButton.Accessible.Name        = "cancelButton";
            cancelButton.Accessible.Description = GettextCatalog.GetString("Cancel the dialog");
            cancelButton.Label                  = GettextCatalog.GetString("Cancel");
            cancelButton.UseStock               = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Accessible.SetShouldIgnore(true);
            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton                        = new Button();
            previousButton.Name                   = "previousButton";
            previousButton.Accessible.Name        = "previousButton";
            previousButton.Accessible.Description = GettextCatalog.GetString("Return to the previous page");
            previousButton.Label                  = GettextCatalog.GetString("Previous");
            previousButton.Sensitive              = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton                        = new Button();
            nextButton.Name                   = "nextButton";
            nextButton.Accessible.Name        = "nextButton";
            nextButton.Accessible.Description = GettextCatalog.GetString("Move to the next page");
            nextButton.Label                  = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
            private Widget GetRightPane()
            {
                VBox vbox = new VBox ();

                // labels
                moveNumberLabel = new Label ();
                nagCommentLabel = new Label ();
                nagCommentLabel.Xalign = 0;
                HBox hbox = new HBox ();
                hbox.PackStart (moveNumberLabel, false, false,
                        2);
                hbox.PackStart (nagCommentLabel, false, false,
                        2);

                vbox.PackStart (hbox, false, false, 2);

                // board
                chessGameDetailsBox = new VBox ();
                chessGameDetailsBox.PackStart (gameView,
                                   true, true, 4);

                vbox.PackStart (chessGameDetailsBox, true,
                        true, 2);

                // buttons
                playButton = new PlayPauseButton ();
                playButton.PlayNextEvent +=
                    on_play_next_event;

                firstButton = new Button ();
                firstButton.Clicked += on_first_clicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += on_prev_clicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += on_next_clicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += on_last_clicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox bbox = new HBox ();
                bbox.PackStart (firstButton, false, false, 1);
                bbox.PackStart (prevButton, false, false, 1);
                bbox.PackStart (playButton, false, false, 1);
                bbox.PackStart (nextButton, false, false, 1);
                bbox.PackStart (lastButton, false, false, 1);
                Alignment alignment =
                    new Alignment (0.5f, 1, 0, 0);
                alignment.Add (bbox);
                alignment.Show ();

                vbox.PackStart (alignment, false, false, 2);
                book.AppendPage (gamesListWidget,
                         new Label (Catalog.
                                GetString
                                ("Games")));
                book.AppendPage (vbox,
                         new Label (Catalog.
                                GetString
                                ("Current Game")));

                return book;
            }
Пример #33
0
        void Build()
        {
            BorderWidth   = 0;
            WidthRequest  = GtkWorkarounds.ConvertToPixelScale(901);
            HeightRequest = GtkWorkarounds.ConvertToPixelScale(632);

            Name           = "wizard_dialog";
            Title          = GettextCatalog.GetString("New Project");
            WindowPosition = WindowPosition.CenterOnParent;
            TransientFor   = IdeApp.Workbench.RootWindow;

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = GtkWorkarounds.ConvertToPixelScale(52);
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerTopEdgeLineEventBox = new EventBox();

            topBannerTopEdgeLineEventBox.Name          = "topBannerTopEdgeLineEventBox";
            topBannerTopEdgeLineEventBox.HeightRequest = 1;
            topBannerTopEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerTopEdgeLineEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel      = new Label();
            topBannerLabel.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();
            font.Size = (int)(font.Size * 1.8);
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topBannerTopEdgeLineEventBox, false, false, 0);
            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox      = new VBox();
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox      = new HBox();
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesVBox = new VBox();

            templateCategoriesVBox.Name         = "templateCategoriesVBox";
            templateCategoriesVBox.BorderWidth  = 0;
            templateCategoriesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale(220);
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                = new TreeView();
            templateCategoriesTreeView.Name           = "templateCategoriesTreeView";
            templateCategoriesTreeView.BorderWidth    = 0;
            templateCategoriesTreeView.HeadersVisible = false;
            templateCategoriesTreeView.Model          = templateCategoriesListStore;
            templateCategoriesTreeView.ModifyBase(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesVBox.PackStart(templateCategoriesScrolledWindow, true, true, 0);
            templatesHBox.PackStart(templateCategoriesVBox, false, false, 0);

            // Templates.
            var templatesVBox = new VBox();

            templatesVBox.Name         = "templatesVBox";
            templatesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale(400);
            templatesHBox.PackStart(templatesVBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                = new TreeView();
            templatesTreeView.Name           = "templatesTreeView";
            templatesTreeView.HeadersVisible = false;
            templatesTreeView.Model          = templatesListStore;
            templatesTreeView.ModifyBase(StateType.Normal, templateListBackgroundColor);
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesVBox.PackStart(templatesScrolledWindow, true, true, 0);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox             = new VBox();
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage               = new ImageView();
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = GtkWorkarounds.ConvertToPixelScale(140);
            templateImage.WidthRequest  = GtkWorkarounds.ConvertToPixelScale(240);
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel              = new Label();
            templateNameLabel.Name         = "templateNameLabel";
            templateNameLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale(240);
            templateNameLabel.Wrap         = true;
            templateNameLabel.Xalign       = 0;
            templateNameLabel.Markup       = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel              = new Label();
            templateDescriptionLabel.Name         = "templateDescriptionLabel";
            templateDescriptionLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale(240);
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);
            templateVBox.PackStart(new Label(), true, true, 0);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton          = new Button();
            cancelButton.Name     = "cancelButton";
            cancelButton.Label    = "gtk-cancel";
            cancelButton.UseStock = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton           = new Button();
            previousButton.Name      = "previousButton";
            previousButton.Label     = GettextCatalog.GetString("Previous");
            previousButton.Sensitive = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton       = new Button();
            nextButton.Name  = "nextButton";
            nextButton.Label = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
            private void AddGameNavigationButtons(VBox box)
            {
                firstButton = new Button ();
                firstButton.Clicked += OnClicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += OnClicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += OnClicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += OnClicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox hbox = new HBox ();
                hbox.PackStart (firstButton, false, false, 2);
                hbox.PackStart (prevButton, false, false, 2);
                hbox.PackStart (nextButton, false, false, 2);
                hbox.PackStart (lastButton, false, false, 2);

                Alignment align =
                    new Alignment (0.5f, 1, 1, 0);
                align.Add (hbox);
                box.PackStart (align, false, true, 2);
            }
Пример #35
0
        public TreeViewCustomStore()
        {
            DataNode root = new DataNode("Root",
                                         new DataNode [] {
                new DataNode("One", new DataNode [] {
                    new DataNode("Elephant"),
                    new DataNode("Tiger")
                }),
                new DataNode("Two", new DataNode [] {
                    new DataNode("Monkey"),
                    new DataNode("Lion")
                }),
            }
                                         );
            DataNode root2 = new DataNode("Second Root",
                                          new DataNode [] {
                new DataNode("One", new DataNode [] {
                    new DataNode("Elephant"),
                    new DataNode("Tiger")
                }),
                new DataNode("Two", new DataNode [] {
                    new DataNode("Monkey"),
                    new DataNode("Lion")
                }),
            }
                                          );

            MyTreeSource source = new MyTreeSource();

            source.Add(root);
            source.Add(root2);
            source.Add(new InfiniteDataNode("Infinite"));

            TreeView tree = new TreeView();

            var col = new ListViewColumn("Data");

            col.Views.Add(new ImageCellView(source.ImageField));
            col.Views.Add(new TextCellView(source.LabelField));
            tree.Columns.Add(col);

            PackStart(tree, true);

            var hbox   = new HBox();
            var add    = new Button("Add nodes");
            var change = new Button("Change nodes");
            var remove = new Button("Remove nodes");

            hbox.PackStart(add);
            hbox.PackStart(change);
            hbox.PackStart(remove);
            PackStart(hbox);

            add.Clicked += delegate {
                var node = new DataNode("New child");
                root.InsertChild(1, node);
                tree.SelectRow(node);
            };

            remove.Clicked += delegate {
                if (root.Children.Count > 0)
                {
                    root.RemoveChild(root.Children [root.Children.Count - 1]);
                }
            };

            change.Clicked += delegate {
                var sel = (DataNode)tree.SelectedRow;
                if (sel != null)
                {
                    sel.Name = "Modified";
                }
            };

            tree.DataSource = source;
        }
Пример #36
0
        public StatusArea()
        {
            theme     = new StatusAreaTheme();
            renderArg = new RenderArg();

            ctxHandler    = new StatusBarContextHandler(this);
            VisibleWindow = false;
            NoShowAll     = true;
            WidgetFlags  |= Gtk.WidgetFlags.AppPaintable;

            statusIconBox.BorderWidth = 0;
            statusIconBox.Spacing     = 3;

            Action <bool> animateProgressBar =
                showing => this.Animate("ProgressBarFade",
                                        val => renderArg.ProgressBarAlpha = val,
                                        renderArg.ProgressBarAlpha,
                                        showing ? 1.0f : 0.0f,
                                        easing: Easing.CubicInOut);

            ProgressBegin += delegate {
                renderArg.ShowProgressBar = true;
//				StartBuildAnimation ();
                renderArg.ProgressBarFraction = 0;
                QueueDraw();
                animateProgressBar(true);
            };

            ProgressEnd += delegate {
                renderArg.ShowProgressBar = false;
//				StopBuildAnimation ();
                QueueDraw();
                animateProgressBar(false);
            };

            ProgressFraction += delegate(object sender, FractionEventArgs e) {
                renderArg.ProgressBarFraction = (float)e.Work;
                QueueDraw();
            };

            contentBox.PackStart(messageBox, true, true, 0);
            contentBox.PackEnd(statusIconBox, false, false, 0);
            contentBox.PackEnd(statusIconSeparator = new StatusAreaSeparator(), false, false, 0);
            contentBox.PackEnd(buildResultWidget   = CreateBuildResultsWidget(Orientation.Horizontal), false, false, 0);

            HasTooltip    = true;
            QueryTooltip += messageBoxToolTip;

            mainAlign              = new Alignment(0, 0.5f, 1, 0);
            mainAlign.LeftPadding  = 12;
            mainAlign.RightPadding = 8;
            mainAlign.Add(contentBox);
            Add(mainAlign);

            mainAlign.ShowAll();
            statusIconBox.Hide();
            statusIconSeparator.Hide();
            buildResultWidget.Hide();
            Show();

            this.ButtonPressEvent += delegate {
                if (sourcePad != null)
                {
                    sourcePad.BringToFront(true);
                }
            };

            statusIconBox.Shown += delegate {
                UpdateSeparators();
            };

            statusIconBox.Hidden += delegate {
                UpdateSeparators();
            };

            messageQueue = new Queue <Message> ();

            tracker                 = new MouseTracker(this);
            tracker.MouseMoved     += (sender, e) => QueueDraw();
            tracker.HoveredChanged += (sender, e) => {
                this.Animate("Hovered",
                             x => renderArg.HoverProgress = x,
                             renderArg.HoverProgress,
                             tracker.Hovered ? 1.0f : 0.0f,
                             easing: Easing.SinInOut);
            };

            IdeApp.FocusIn += delegate {
                // If there was an error while the application didn't have the focus,
                // trigger the error animation again when it gains the focus
                if (errorAnimPending)
                {
                    errorAnimPending = false;
                    TriggerErrorAnimation();
                }
            };
        }
            public NotificationWidget()
                : base()
            {
                HBox box = new HBox ();
                  label = new Label ();
                  label.Xalign = 0;
                  closeButton = new Button ();
                  closeButton.Image =
                    new Image (Stock.Close,
                           IconSize.Button);
                  closeButton.Clicked += on_close;
                  acceptButton = new Button (Stock.Ok);
                  acceptButton.Image =
                    new Image (Stock.Ok, IconSize.Button);
                  acceptButton.Clicked += on_accept;
                  ModifyBg (StateType.Normal,
                        new Gdk.Color (0xff, 0xff, 0xc0));

                  box.PackStart (label, true, true, 5);
                  box.PackStart (acceptButton, false, false,
                         5);
                  box.PackStart (closeButton, false, false,
                         5);
                  label.Show ();
                  closeButton.Show ();

                // This box will add some vertical padding
                VBox b = new VBox ();
                  b.PackStart (box, false, true, 5);

                  Add (b);
            }
Пример #38
0
        public Command Run(WindowFrame transientFor, MessageDescription message)
        {
            this.icon = GetIcon (message.Icon);
            if (ConvertButtons (message.Buttons, out buttons) && message.Options.Count == 0) {
                // Use a system message box
                if (message.SecondaryText == null)
                    message.SecondaryText = String.Empty;
                else {
                    message.Text = message.Text + "\r\n\r\n" + message.SecondaryText;
                    message.SecondaryText = String.Empty;
                }
                var parent =  Toolkit.CurrentEngine.GetNativeWindow(transientFor) as System.Windows.Window;
                if (parent != null) {
                    this.dialogResult = MessageBox.Show (parent, message.Text, message.SecondaryText,
                                                        this.buttons, this.icon, this.defaultResult, this.options);
                }
                else {
                    this.dialogResult = MessageBox.Show (message.Text, message.SecondaryText, this.buttons,
                                                        this.icon, this.defaultResult, this.options);
                }
                return ConvertResultToCommand (this.dialogResult);
            }
            else {
                // Custom message box required
                Dialog dlg = new Dialog ();
                dlg.Resizable = false;
                dlg.Padding = 0;
                HBox mainBox = new HBox { Margin = 25 };

                if (message.Icon != null) {
                    var image = new ImageView (message.Icon.WithSize (32,32));
                    mainBox.PackStart (image, vpos: WidgetPlacement.Start);
                }
                VBox box = new VBox () { Margin = 3, MarginLeft = 8, Spacing = 15 };
                mainBox.PackStart (box, true);
                var text = new Label {
                    Text = message.Text ?? ""
                };
                Label stext = null;
                box.PackStart (text);
                if (!string.IsNullOrEmpty (message.SecondaryText)) {
                    stext = new Label {
                        Text = message.SecondaryText
                    };
                    box.PackStart (stext);
                }
                foreach (var option in message.Options) {
                    var check = new CheckBox (option.Text);
                    check.Active = option.Value;
                    box.PackStart(check);
                    check.Toggled += (sender, e) => message.SetOptionValue(option.Id, check.Active);
                }
                dlg.Buttons.Add (message.Buttons.ToArray ());
                if (message.DefaultButton >= 0 && message.DefaultButton < message.Buttons.Count)
                    dlg.DefaultCommand = message.Buttons[message.DefaultButton];
                if (mainBox.Surface.GetPreferredSize (true).Width > 480) {
                    text.Wrap = WrapMode.Word;
                    if (stext != null)
                        stext.Wrap = WrapMode.Word;
                    mainBox.WidthRequest = 480;
                }
                var s = mainBox.Surface.GetPreferredSize (true);

                dlg.Content = mainBox;
                return dlg.Run ();
            }
        }
            public SearchableGamesListWidget(GameViewerUI viewer)
            {
                HBox box = new HBox ();
                box.PackStart (new
                           Label (Catalog.
                              GetString ("Filter")),
                           false, false, 4);
                searchEntry = new Entry ();
                box.PackStart (searchEntry, true, true, 2);

                PackStart (box, false, true, 2);

                gamesListWidget =
                    new
                    GameViewerGamesListWidget (viewer);

                PackStart (gamesListWidget, true, true, 2);
                ShowAll ();

                filter = new TreeModelFilter (gamesListWidget.
                                  Model, null);
                filter.VisibleFunc = SearchFilterFunc;
                searchEntry.Changed += OnSearch;
            }
Пример #40
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            UnitTestService.TestSuiteChanged += OnTestSuiteChanged;
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(DockPositionType.Top);

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(new ImageView(ImageService.GetIcon("md-execute-all", IconSize.Menu)), false, false, 0);
            hbox.PackStart(new Label(GettextCatalog.GetString("Run All")), false, false, 0);
            buttonRunAll = new Button(hbox);
            buttonRunAll.Accessible.Name        = "TestPad.RunAll";
            buttonRunAll.Accessible.Description = GettextCatalog.GetString("Start a test run and run all the tests");
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonStop                 = new Button(new ImageView(Ide.Gui.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked        += new EventHandler(OnStopClicked);
            buttonStop.Sensitive       = false;
            buttonStop.TooltipText     = GettextCatalog.GetString("Cancel running test");
            buttonStop.Accessible.Name = "TestPad.StopAll";
            buttonStop.Accessible.SetTitle(GettextCatalog.GetString(("Cancel")));
            buttonStop.Accessible.Description = GettextCatalog.GetString("Stops the current test run");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new ImageView("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new ImageView("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);

            var chartWidget = chart.GetNativeWidget <Widget> ();

            chartWidget.ButtonPressEvent += OnChartButtonPress;
            chartWidget.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView {
                Name = "testPadDetailsTree"
            };

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Passed",
                                                                          "store__ErrorsAndFailures", "store__Ignored");

            SCM.TypeDescriptor.AddAttributes(detailsStore, modelAttr);

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new ImageView(TestStatusIcon.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new ImageView(TestStatusIcon.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new ImageView(TestStatusIcon.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView {
                Name = "testPadRegressionTree"
            };
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute regressionModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(detailsStore, regressionModelAttr);

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererImage();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute failedModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(failedStore, failedModelAttr);

            trtest2 = new CellRendererText();
            pr      = new CellRendererImage();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in UnitTestService.RootTests)
            {
                TreeView.AddChild(t);
            }

            base.TreeView.Tree.Name = "unitTestBrowserTree";
        }
        void Build()
        {
            Spacing = 6;

            listView = new TreeView {
                CanFocus       = true,
                HeadersVisible = false
            };

            scrolledWindow = new ScrolledWindow {
                ShadowType = ShadowType.In, Child = listView
            };
            buttonAdd    = new Button(Stock.Add);
            buttonRemove = new Button(Stock.Remove);

            labelScopes = new Label {
                Xalign = 0F,
                Text   = GettextCatalog.GetString("Enter one or more XPath expressions to which this format applies")
            };

            tableScopes = new Table(3, 3, false)
            {
                RowSpacing    = 6,
                ColumnSpacing = 6
            };

            propertyGrid = new DesignerSupport.PropertyGridWrapper {
                ShowToolbar = false,
                ShowHelp    = false
            };

            buttonAdvanced = new Button {
                Label        = GettextCatalog.GetString("Advanced Settings"),
                CanFocus     = true,
                UseUnderline = true
            };

            var buttonBox = new HBox(false, 6);

            buttonBox.PackStart(buttonAdd, false, false, 0);
            buttonBox.PackStart(buttonRemove, false, false, 0);

            boxScopes = new VBox(false, 6);
            boxScopes.PackStart(scrolledWindow, true, true, 0);
            boxScopes.PackStart(buttonBox, false, false, 0);

            var rightVBox = new VBox(false, 6);

            rightVBox.PackStart(labelScopes, false, false, 0);
            rightVBox.PackStart(tableScopes, false, false, 0);
            rightVBox.PackStart(propertyGrid.Widget, true, true, 0);

            var mainBox = new HBox(false, 6);

            mainBox.PackStart(boxScopes, false, false, 0);
            mainBox.PackStart(rightVBox, true, true, 0);

            var abbBox = new HBox(false, 6);

            abbBox.PackStart(buttonAdvanced, false, false, 0);

            PackStart(mainBox, true, true, 0);
            PackStart(abbBox, false, false, 0);

            ShowAll();

            buttonAdd.Clicked      += OnButtonAddClicked;
            buttonRemove.Clicked   += OnButtonRemoveClicked;
            buttonAdvanced.Clicked += OnButtonAdvancedClicked;
        }
Пример #42
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                // HBox For Vid and Pid
                HBox hbox1 = new HBox(true, _boxSpacing);
                // HBox For Vid and Pid
                HBox hbox2 = new HBox(true, _boxSpacing);

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd);
                vboxTab1.PackStart(boxLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Code
                Entry       entryCode = new Entry();
                BOWidgetBox boxCode   = new BOWidgetBox(Resx.global_record_code, entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Designation
                Entry       entryDesignation = new Entry();
                BOWidgetBox boxDesignation   = new BOWidgetBox(Resx.global_designation, entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //VID
                Entry       entryVID = new Entry();
                BOWidgetBox boxVID   = new BOWidgetBox(Resx.global_pole_display_vid, entryVID);
                hbox1.PackStart(boxVID, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxVID, _dataSourceRow, "VID", SettingsApp.RegexHardwareVidAndPid, true));

                //PID
                Entry       entryPID = new Entry();
                BOWidgetBox boxPID   = new BOWidgetBox(Resx.global_pole_display_pid, entryPID);
                hbox1.PackStart(boxPID, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxPID, _dataSourceRow, "PID", SettingsApp.RegexHardwareVidAndPid, true));

                //EndPoint
                Entry       entryEndPoint = new Entry();
                BOWidgetBox boxEndPoint   = new BOWidgetBox(Resx.global_pole_display_endpoint, entryEndPoint);
                hbox1.PackStart(boxEndPoint, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxEndPoint, _dataSourceRow, "EndPoint", SettingsApp.RegexHardwareEndpoint, true));

                // Pack hboxVIDAndPid
                vboxTab1.PackStart(hbox1, false, false, 0);

                //CodeTable
                Entry       entryCodeTable = new Entry();
                BOWidgetBox boxCodeTable   = new BOWidgetBox(Resx.global_pole_display_codetable, entryCodeTable);
                hbox2.PackStart(boxCodeTable, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCodeTable, _dataSourceRow, "CodeTable", SettingsApp.RegexHardwareCodeTable, true));

                //DisplayCharactersPerLine
                Entry       entryDisplayCharactersPerLine = new Entry();
                BOWidgetBox boxDisplayCharactersPerLine   = new BOWidgetBox(Resx.global_pole_display_number_of_characters_per_line, entryDisplayCharactersPerLine);
                hbox2.PackStart(boxDisplayCharactersPerLine, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDisplayCharactersPerLine, _dataSourceRow, "DisplayCharactersPerLine", SettingsApp.RegexInteger, true));


                //GoToStandByInSeconds
                Entry       entryGoToStandByInSeconds = new Entry();
                BOWidgetBox boxGoToStandByInSeconds   = new BOWidgetBox(Resx.global_pole_display_goto_stand_by_in_seconds, entryGoToStandByInSeconds);
                hbox2.PackStart(boxGoToStandByInSeconds, true, true, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxGoToStandByInSeconds, _dataSourceRow, "GoToStandByInSeconds", SettingsApp.RegexInteger, true));

                // Pack hboxEndpointAndCodeTableAndGoToStandByInSeconds
                vboxTab1.PackStart(hbox2, false, false, 0);

                //StandByLine1
                Entry       entryStandByLine1 = new Entry();
                BOWidgetBox boxStandByLine1   = new BOWidgetBox(string.Format(Resx.global_pole_display_stand_by_line_no, 1), entryStandByLine1);
                vboxTab1.PackStart(boxStandByLine1, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStandByLine1, _dataSourceRow, "StandByLine1", SettingsApp.RegexAlfaNumericExtended, false));

                //StandByLine2
                Entry       entryStandByLine2 = new Entry();
                BOWidgetBox boxStandByLine2   = new BOWidgetBox(string.Format(Resx.global_pole_display_stand_by_line_no, 2), entryStandByLine2);
                vboxTab1.PackStart(boxStandByLine2, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxStandByLine2, _dataSourceRow, "StandByLine2", SettingsApp.RegexAlfaNumericExtended, false));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(Resx.global_record_disabled);
                if (_dialogMode == DialogMode.Insert)
                {
                    checkButtonDisabled.Active = SettingsApp.BOXPOObjectsStartDisabled;
                }
                vboxTab1.PackStart(checkButtonDisabled, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonDisabled, _dataSourceRow, "Disabled"));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Пример #43
0
        public NewAzureJobView(ViewBase owner) : base(owner)
        {
            SubmitJob = new BackgroundWorker();
            // this vbox holds both alignment objects (which in turn hold the frames)
            VBox vboxPrimary = new VBox(false, 10);

            // this is the alignment object which holds the azure job frame
            Alignment primaryContainer = new Alignment(0f, 0f, 0f, 0f);

            primaryContainer.LeftPadding = primaryContainer.RightPadding = primaryContainer.TopPadding = primaryContainer.BottomPadding = 5;

            // Azure Job Frame
            Frame frmAzure = new Frame("Azure Job");

            Alignment alignTblAzure = new Alignment(0.5f, 0.5f, 1f, 1f);

            alignTblAzure.LeftPadding = alignTblAzure.RightPadding = alignTblAzure.TopPadding = alignTblAzure.BottomPadding = 5;

            // Azure table - contains all fields in the azure job frame
            Table tblAzure = new Table(4, 2, false);

            tblAzure.RowSpacing = 5;
            // Job Name
            Label lblName = new Label("Job Description/Name:");

            lblName.Xalign = 0;
            lblName.Yalign = 0.5f;

            entryName = new Entry();

            tblAzure.Attach(lblName, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblAzure.Attach(entryName, 1, 2, 0, 1, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 20, 0);

            // Number of cores
            Label lblCores = new Label("Number of CPU cores to use:");

            lblCores.Xalign = 0;
            lblCores.Yalign = 0.5f;

            // use the same core count options as in MARS (16, 32, 48, 64, ... , 128, 256)
            comboCoreCount = ComboBox.NewText();
            for (int i = 16; i <= 128; i += 16)
            {
                comboCoreCount.AppendText(i.ToString());
            }
            comboCoreCount.AppendText("256");

            comboCoreCount.Active = 0;

            // combo boxes cannot be aligned, so it is placed in an alignment object, which can be aligned
            Alignment comboAlign = new Alignment(0f, 0.5f, 0.25f, 1f);

            comboAlign.Add(comboCoreCount);

            tblAzure.Attach(lblCores, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblAzure.Attach(comboAlign, 1, 2, 1, 2, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 20, 0);



            // User doesn't get to choose a model via the form anymore. It comes from the context of the right click

            // Model selection frame
            Frame frmModelSelect = new Frame("Model Selection");

            // Alignment to ensure a 5px border around the inside of the frame
            Alignment alignModel = new Alignment(0f, 0f, 1f, 1f);

            alignModel.LeftPadding = alignModel.RightPadding = alignModel.TopPadding = alignModel.BottomPadding = 5;
            Table tblModel = new Table(2, 3, false);

            tblModel.ColumnSpacing = 5;
            tblModel.RowSpacing    = 10;

            chkSaveModels          = new CheckButton("Save model files");
            chkSaveModels.Toggled += ChkSaveModels_Toggled;
            entryModelPath         = new Entry();
            btnModelPath           = new Button("...");
            btnModelPath.Clicked  += BtnModelPath_Click;

            chkSaveModels.Active = true;
            chkSaveModels.Active = false;


            HBox hboxModelpath = new HBox();

            hboxModelpath.PackStart(entryModelPath, true, true, 0);
            hboxModelpath.PackStart(btnModelPath, false, false, 5);

            tblAzure.Attach(chkSaveModels, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblAzure.Attach(hboxModelpath, 1, 2, 2, 3, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 0, 0);

            //Apsim Version Selection frame/table
            Frame frmVersion = new Frame("APSIM Next Generation Version Selection");
            Table tblVersion = new Table(2, 3, false);

            tblVersion.ColumnSpacing = 5;
            tblVersion.RowSpacing    = 10;

            // Alignment to ensure a 5px border on the inside of the frame
            Alignment alignVersion = new Alignment(0f, 0f, 1f, 1f);

            alignVersion.LeftPadding = alignVersion.RightPadding = alignVersion.TopPadding = alignVersion.BottomPadding = 5;

            /*
             * // use from online source
             * // TODO: find/implement a Bob equivalent
             * HBox hbxBob = new HBox();
             * radioBob = new RadioButton("Use APSIM Next Generation from an online source (Bob?)");
             * radioBob.Toggled += new EventHandler(radioBob_Changed);
             * Label lblVersion = new Label("Version:");
             * entryVersion = new Entry();
             * Label lblRevision = new Label("Revision:");
             * entryRevision = new Entry();
             *
             * hbxBob.Add(radioBob);
             * hbxBob.Add(lblVersion);
             * hbxBob.Add(entryVersion);
             * hbxBob.Add(lblRevision);
             * hbxBob.Add(entryRevision);
             *
             * btnBob = new Button("...");
             * btnBob.Clicked += new EventHandler(btnBob_Click);
             *
             * tblVersion.Attach(hbxBob, 0, 2, 0, 1, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 0, 0);
             * tblVersion.Attach(btnBob, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
             */
            // use Apsim from a directory

            radioApsimDir          = new RadioButton("Use APSIM Next Generation from a directory");
            radioApsimDir.Toggled += new EventHandler(RadioApsimDir_Changed);
            // populate this input field with the directory containing this executable
            entryApsimDir        = new Entry(Directory.GetParent(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)).ToString());
            btnApsimDir          = new Button("...");
            btnApsimDir.Clicked += new EventHandler(BtnApsimDir_Click);
            tblVersion.Attach(radioApsimDir, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblVersion.Attach(entryApsimDir, 1, 2, 0, 1, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 0, 0);
            tblVersion.Attach(btnApsimDir, 2, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            // use a zipped version of Apsim

            radioApsimZip          = new RadioButton(radioApsimDir, "Use a zipped version of APSIM Next Generation");
            radioApsimZip.Toggled += new EventHandler(RadioApsimZip_Changed);
            entryApsimZip          = new Entry();
            btnApsimZip            = new Button("...");
            btnApsimZip.Clicked   += new EventHandler(BtnApsimZip_Click);

            tblVersion.Attach(radioApsimZip, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblVersion.Attach(entryApsimZip, 1, 2, 1, 2, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 0, 0);
            tblVersion.Attach(btnApsimZip, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);



            alignVersion.Add(tblVersion);
            frmVersion.Add(alignVersion);

            tblAzure.Attach(frmVersion, 0, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            // toggle the default radio button to ensure appropriate entries/buttons are greyed out by default
            radioApsimDir.Active = true;
            radioApsimZip.Active = true;
            radioApsimDir.Active = true;

            // add azure job table to azure alignment, and add that to the azure job frame
            alignTblAzure.Add(tblAzure);
            frmAzure.Add(alignTblAzure);

            // Results frame
            Frame frameResults = new Frame("Results");
            // Alignment object to ensure a 10px border around the inside of the results frame
            Alignment alignFrameResults = new Alignment(0f, 0f, 1f, 1f);

            alignFrameResults.LeftPadding = alignFrameResults.RightPadding = alignFrameResults.TopPadding = alignFrameResults.BottomPadding = 10;
            Table tblResults = new Table(4, 3, false);

            tblResults.ColumnSpacing = 5;
            tblResults.RowSpacing    = 5;

            // Auto send email
            chkEmail   = new CheckButton("Send email  upon completion to:");
            entryEmail = new Entry();



            tblResults.Attach(chkEmail, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblResults.Attach(entryEmail, 1, 2, 0, 1, (AttachOptions.Expand | AttachOptions.Fill), AttachOptions.Fill, 0, 0);


            // Auto download results
            chkDownload  = new CheckButton("Automatically download results once complete");
            chkSummarise = new CheckButton("Summarise Results");

            tblResults.Attach(chkDownload, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblResults.Attach(chkSummarise, 1, 3, 1, 2, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Fill, 0, 0);

            // Output dir

            Label lblOutputDir = new Label("Output Directory:");

            lblOutputDir.Xalign = 0;
            entryOutputDir      = new Entry((string)AzureSettings.Default["OutputDir"]);

            Button btnOutputDir = new Button("...");

            btnOutputDir.Clicked += new EventHandler(BtnOutputDir_Click);

            tblResults.Attach(lblOutputDir, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblResults.Attach(entryOutputDir, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tblResults.Attach(btnOutputDir, 2, 3, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);


            Alignment alignNameTip = new Alignment(0f, 0f, 1f, 1f);
            Label     lblNameTip   = new Label("(note: if you close Apsim before the job completes, the results will not be automatically downloaded)");

            alignNameTip.Add(lblNameTip);

            tblResults.Attach(alignNameTip, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0);



            alignFrameResults.Add(tblResults);
            frameResults.Add(alignFrameResults);



            // OK/Cancel buttons

            BtnOK          = new Button("OK");
            BtnOK.Clicked += new EventHandler(BtnOK_Click);
            Button btnCancel = new Button("Cancel");

            btnCancel.Clicked += new EventHandler(BtnCancel_Click);
            HBox hbxButtons = new HBox(true, 0);

            hbxButtons.PackEnd(btnCancel, false, true, 0);
            hbxButtons.PackEnd(BtnOK, false, true, 0);
            Alignment alignButtons = new Alignment(1f, 0f, 0.2f, 0f);

            alignButtons.Add(hbxButtons);
            lblStatus        = new Label("");
            lblStatus.Xalign = 0f;

            // Add Azure frame to primary vbox
            vboxPrimary.PackStart(frmAzure, false, true, 0);
            // add results frame to primary vbox
            vboxPrimary.PackStart(frameResults, false, true, 0);
            vboxPrimary.PackStart(alignButtons, false, true, 0);
            vboxPrimary.PackStart(lblStatus, false, true, 0);
            // Add primary vbox to alignment
            primaryContainer.Add(vboxPrimary);
            _mainWidget = primaryContainer;
        }
Пример #44
0
  public static void Main(string [] args)
  {	
    Application.Init();

    Window win = new Window("EFL# Demo App");	
    win.Resize(640, 480);

    Application.EE.ResizeEvent += AppResizeHandler;

    /* integrate this code in the Window class */
    Edje win_bg = new Edje(Application.EE.Get());
    win_bg.FileSet(DataConfig.DATADIR + "/data/eblocks/themes/e17.edj","window");
    win_bg.Resize(640, 480);
    win_bg.Move(0, 0);
    win_bg.Lower();
    win_bg.Show();
    
    MenuItem item;    
    MenuItem entry;

    MenuBar mb = new MenuBar();
    mb.Move(0, 0);
    mb.Resize(640, 35);
    mb.Spacing = 15;

    item = new MenuItem("_File");
    Menu file_menu = new Menu();
    
    entry = new MenuItem(file_menu.Canvas, "_Open");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Close");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Save");
    file_menu.Append(entry);
    
    item.SubMenu = file_menu;
    
    mb.Append(item);

    item = new MenuItem("_Edit");
    Menu edit_menu = new Menu();
    
    entry = new MenuItem(edit_menu.Canvas, "_Copy");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Cut");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Paste");
    edit_menu.Append(entry);
    
    item.SubMenu = edit_menu;
    mb.Append(item);

    item = new MenuItem("_About");
    //item.SubMenu = about_menu;
    mb.Append(item);

    mb.Show();

    Button button;	

    HBox box_left = new HBox();
    box_left.Move(0, 37);
    box_left.Resize(70, 480 - 37);
	
    VBox box_icons = new VBox();
    box_icons.Spacing = 0;
    box_icons.Resize(64, 480 - 37);
	
    button = new Button("Tile");
    button.Resize(64, 64);
    box_icons.PackEnd(button);
    button = new Button("Stretch");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Rotate");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Flip");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Quit");
    button.MouseUpEvent += new Enlightenment.Evas.Item.EventHandler(AppQuitButtonHandler);
    button.Resize(64, 64);	
    box_icons.PackEnd(button);		
	
    box_left.PackEnd(box_icons);
	
    Enlightenment.Eblocks.Line vline = new Enlightenment.Eblocks.Line(Application.EE.Get());
    vline.Vertical = true;
    vline.Resize(6, 480 - 37);
	
    box_left.PackEnd(vline);
	
    box_left.Show();
	
    dir = args[0];	
	       	
    imageTable = new Table(Application.EE.Get(), items);
	
    HBox box_images = new HBox();
    box_images.Move(70, 37);
    box_images.Spacing = 0;
    box_images.Resize(640 - 70 - 2, 480 - 37 - 2);
    box_images.PackStart(imageTable);
	
    Application.EE.DataSet("box_images", box_images);
    Application.EE.DataSet("box_left", box_left);
    Application.EE.DataSet("box_icons", box_icons);
    Application.EE.DataSet("win_bg", win_bg);
    Application.EE.DataSet("vline", vline);
    Application.EE.DataSet("mb", mb);
	
    WaitCallback callback = new WaitCallback(Callback);
    ThreadPool.QueueUserWorkItem(callback);	

    win.ShowAll();
	
    Application.Run();
  }   
Пример #45
0
        public DotNetRunConfigurationEditorWidget(bool includeAdvancedTab)
        {
            VBox mainBox = new VBox();

            mainBox.Margin = 12;
            mainBox.PackStart(new Label {
                Markup = GettextCatalog.GetString("Start Action")
            });
            var table = new Table();

            table.Add(radioStartProject = new RadioButton(GettextCatalog.GetString("Start project")), 0, 0);
            table.Add(radioStartApp     = new RadioButton(GettextCatalog.GetString("Start external program:")), 0, 1);
            table.Add(appEntry          = new Xwt.FileSelector(), 1, 1, hexpand: true);
            table.Add(appEntryInfoIcon  = new InformationPopoverWidget(), 2, 1);
            appEntryInfoIcon.Hide();
            radioStartProject.Group = radioStartApp.Group;
            table.MarginLeft        = 12;
            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });
            table = new Table();

            table.Add(new Label(GettextCatalog.GetString("Arguments:")), 0, 0);
            table.Add(argumentsEntry = new TextEntry(), 1, 0, hexpand: true);

            table.Add(new Label(GettextCatalog.GetString("Run in directory:")), 0, 1);
            table.Add(workingDir = new FolderSelector(), 1, 1, hexpand: true);

            mainBox.PackStart(table);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            mainBox.PackStart(new Label(GettextCatalog.GetString("Environment Variables")));
            envVars = new EnvironmentVariableCollectionEditor();

            mainBox.PackStart(envVars, true);

            mainBox.PackStart(new HSeparator()
            {
                MarginTop = 8, MarginBottom = 8
            });

            HBox cbox = new HBox();

            cbox.PackStart(externalConsole = new CheckBox(GettextCatalog.GetString("Run on external console")));
            cbox.PackStart(pauseConsole    = new CheckBox(GettextCatalog.GetString("Pause console output")));
            mainBox.PackStart(cbox);

            Add(mainBox, GettextCatalog.GetString("General"));

            var adBox = new VBox();

            adBox.Margin = 12;

            table = new Table();
            table.Add(new Label(GettextCatalog.GetString("Execute in .NET Runtime:")), 0, 0);
            table.Add(runtimesCombo = new ComboBox(), 1, 0, hexpand: true);

            table.Add(new Label(GettextCatalog.GetString("Mono runtime settings:")), 0, 1);

            var    box = new HBox();
            Button monoSettingsButton = new Button(GettextCatalog.GetString("..."));

            box.PackStart(monoSettingsEntry = new TextEntry {
                PlaceholderText = GettextCatalog.GetString("Default settings")
            }, true);
            box.PackStart(monoSettingsButton);
            monoSettingsEntry.ReadOnly = true;
            table.Add(box, 1, 1, hexpand: true);
            adBox.PackStart(table);

            if (includeAdvancedTab)
            {
                Add(adBox, GettextCatalog.GetString("Advanced"));
            }

            monoSettingsButton.Clicked      += EditRuntimeClicked;
            radioStartProject.ActiveChanged += (sender, e) => UpdateStatus();
            externalConsole.Toggled         += (sender, e) => UpdateStatus();

            LoadRuntimes();

            appEntry.FileChanged           += (sender, e) => NotifyChanged();
            argumentsEntry.Changed         += (sender, e) => NotifyChanged();
            workingDir.FolderChanged       += (sender, e) => NotifyChanged();
            envVars.Changed                += (sender, e) => NotifyChanged();
            externalConsole.Toggled        += (sender, e) => NotifyChanged();
            pauseConsole.Toggled           += (sender, e) => NotifyChanged();
            runtimesCombo.SelectionChanged += (sender, e) => NotifyChanged();
            monoSettingsEntry.Changed      += (sender, e) => NotifyChanged();
        }
Пример #46
0
		public SearchResultsPage (FileSearch search)
		{
			VPaned         paned;
			TreeViewColumn column;
			ToolItem       spacerItem;
			ToolItem       filterItem;
			Alignment      filterAlignment;
			ToolButton     searchAgainToolButton;
			
			this.search = search;
	
			downloadToolButton = new ToolButton(new Image("gtk-save", IconSize.LargeToolbar), "Download");
			downloadToolButton.IsImportant = true;
			downloadToolButton.Sensitive = false;
			downloadToolButton.Clicked += DownloadToolButtonClicked;
			
			searchAgainToolButton = new ToolButton(new Image("gtk-refresh", IconSize.LargeToolbar), "Search Again");
			searchAgainToolButton.IsImportant = true;
			searchAgainToolButton.Clicked += SearchAgainToolButtonClicked;		
			
			spacerItem = new ToolItem();
			spacerItem.Expand = true;

			filterButton = new ToggleButton("Filter Results");
			filterButton.Image = new Image(Gui.LoadIcon(16, "application-x-executable"));
			filterButton.Toggled += delegate (object o, EventArgs args) {
				this.ShowFilter = filterButton.Active;
			};

			filterAlignment = new Alignment(0.5f, 0.5f, 0, 0);
			filterAlignment.Add(filterButton);

			filterItem = new ToolItem();
			filterItem.Add(filterAlignment);

			browseToolButton = new ToolButton(new Image("gtk-open", IconSize.LargeToolbar), "Browse");
			browseToolButton.IsImportant = true;
			browseToolButton.Sensitive = false;
			browseToolButton.Clicked += BrowseToolButtonClicked;

			toolbar = new Toolbar();
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			toolbar.Insert(downloadToolButton, -1);
			toolbar.Insert(browseToolButton, -1);
			toolbar.Insert(spacerItem, -1);
			toolbar.Insert(filterItem, -1);
			toolbar.Insert(new SeparatorToolItem(), -1);
			toolbar.Insert(searchAgainToolButton, -1);
			toolbar.ShowAll();

			this.PackStart(toolbar, false, false, 0);

			resultCountByTypeCache = new Dictionary<FilterType, int>();

			Gdk.Pixbuf audioPixbuf = Gui.LoadIcon(16, "audio-x-generic");
			Gdk.Pixbuf videoPixbuf = Gui.LoadIcon(16, "video-x-generic");
			Gdk.Pixbuf imagePixbuf = Gui.LoadIcon(16, "image-x-generic");
			Gdk.Pixbuf docPixbuf = Gui.LoadIcon(16, "x-office-document");
			unknownPixbuf = Gui.LoadIcon(16, "text-x-generic");
			folderPixbuf = Gui.LoadIcon(16, "folder");
			
			typeStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(FilterType));
			typeStore.AppendValues(null, "All Results", FilterType.All);
			typeStore.AppendValues(null, "-");
			typeStore.AppendValues(audioPixbuf, "Audio", FilterType.Audio);
			typeStore.AppendValues(videoPixbuf, "Video", FilterType.Video);
			typeStore.AppendValues(imagePixbuf, "Images", FilterType.Image);
			typeStore.AppendValues(docPixbuf, "Documents", FilterType.Document);
			typeStore.AppendValues(folderPixbuf, "Folders", FilterType.Folder);
			typeStore.AppendValues(unknownPixbuf, "Other", FilterType.Other);
			
			typeTree = new TreeView();
			typeTree.HeadersVisible = false;
			typeTree.RowSeparatorFunc = delegate (TreeModel m, TreeIter i) {
				string text = (string)m.GetValue(i, 1);
				return (text == "-");
			};
			typeTree.Selection.Changed += TypeSelectionChanged;

			typeTree.Model = typeStore;
			
			CellRendererPixbuf pixbufCell = new CellRendererPixbuf();
			CellRendererText textCell = new CellRendererText();
			CellRendererText countTextCell = new CellRendererText();
			countTextCell.Sensitive = false;
			countTextCell.Alignment = Pango.Alignment.Right;
			countTextCell.Xalign = 1;

			column = new TreeViewColumn();
			column.PackStart(pixbufCell, false);
			column.PackStart(textCell, true);
			column.PackStart(countTextCell, false);
			column.AddAttribute(pixbufCell, "pixbuf", 0);
			column.AddAttribute(textCell, "text", 1);
			column.SetCellDataFunc(countTextCell, new TreeCellDataFunc(TypeCountCellFunc));

			typeTree.AppendColumn(column);

			TreeView artistTree = new TreeView();
			artistTree.HeadersVisible = false;

			TreeView albumTree = new TreeView();
			albumTree.HeadersVisible = false;

			HBox topBox = new HBox();
			topBox.PackStart(Gui.AddScrolledWindow(typeTree), true, true, 0);
			topBox.PackStart(Gui.AddScrolledWindow(artistTree), true, true, 1);
			topBox.PackStart(Gui.AddScrolledWindow(albumTree), true, true, 0);
			topBox.Homogeneous = true;

			resultsStore = new ListStore(typeof(SearchResult));
			resultsStore.RowInserted += delegate {
				Refilter();
			};
			resultsStore.RowDeleted += delegate {
				Refilter();
			};
			resultsTree = new TreeView();
			resultsTree.RowActivated += resultsTree_RowActivated;
			resultsTree.ButtonPressEvent += resultsTree_ButtonPressEvent;
			resultsTree.Selection.Changed += ResultsTreeSelectionChanged;

			imageColumns = new List<TreeViewColumn>();
			audioColumns = new List<TreeViewColumn>();
			videoColumns = new List<TreeViewColumn>();
			fileOnlyColumns = new List<TreeViewColumn>();
			folderOnlyColumns = new List<TreeViewColumn>();

			column = new TreeViewColumn();
			column.Title = "File Name";
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Autosize;
			column.Resizable = true;
			column.SortColumnId = 0;
			//resultsTree.ExpanderColumn = column;

			CellRenderer cell = new CellRendererPixbuf();
			column.PackStart(cell, false);
			column.SetCellDataFunc(cell, new TreeCellDataFunc(IconFunc));

			cell = new CellRendererText();
			column.PackStart(cell, true);
			column.SetCellDataFunc(cell, new TreeCellDataFunc(FileNameFunc));

			resultsTree.AppendColumn(column);

			column = resultsTree.AppendColumn("Codec", new CellRendererText(), new TreeCellDataFunc(CodecFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 120;
			column.Resizable = true;
			column.SortColumnId = 1;
			videoColumns.Add(column);

			column = resultsTree.AppendColumn("Format", new CellRendererText(), new TreeCellDataFunc(FormatFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 90;
			column.Resizable = true;
			column.SortColumnId = 2;
			imageColumns.Add(column);

			column = resultsTree.AppendColumn("Resolution", new CellRendererText(), new TreeCellDataFunc(ResolutionFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 90;
			column.Resizable = true;
			column.SortColumnId = 3;
			videoColumns.Add(column);
			imageColumns.Add(column);

			column = resultsTree.AppendColumn("Artist", new CellRendererText(), new TreeCellDataFunc(ArtistFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 110;
			column.Resizable = true;
			column.SortColumnId = 4;
			audioColumns.Add(column);

			column = resultsTree.AppendColumn("Album", new CellRendererText(), new TreeCellDataFunc(AlbumFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 110;
			column.Resizable = true;
			column.SortColumnId = 5;
			audioColumns.Add(column);
		
			column = resultsTree.AppendColumn("Bitrate", new CellRendererText(), new TreeCellDataFunc(BitrateFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 70;
			column.Resizable = true;
			column.SortColumnId = 6;
			audioColumns.Add(column);

			column = resultsTree.AppendColumn("Size", new CellRendererText(), new TreeCellDataFunc(SizeFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 70;
			column.SortColumnId = 7;
			column.Resizable = true;
			fileOnlyColumns.Add(column);

			column = resultsTree.AppendColumn("Sources", new CellRendererText(), new TreeCellDataFunc(SourcesFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 85;
			column.SortColumnId = 8;
			column.Resizable = true;
			fileOnlyColumns.Add(column);
			
			column = resultsTree.AppendColumn("User", new CellRendererText(), new TreeCellDataFunc(UserFunc));
			column.Clickable = true;
			column.Sizing = TreeViewColumnSizing.Fixed;
			column.FixedWidth = 85;
			column.SortColumnId = 8;
			column.Resizable = true;
			folderOnlyColumns.Add(column);
			
			column = resultsTree.AppendColumn("Full Path", new CellRendererText(), new TreeCellDataFunc(FullPathFunc));
			column.Clickable = true;
			column.Resizable = true;
			column.SortColumnId = 9;

			column = resultsTree.AppendColumn("Info Hash", new CellRendererText(), new TreeCellDataFunc(InfoHashFunc));
			column.Clickable = true;
			column.Resizable = true;
			column.SortColumnId = 10;
			fileOnlyColumns.Add(column);

			resultsFilter = new TreeModelFilter(resultsStore, null);
			resultsFilter.VisibleFunc = resultsFilterFunc;

			resultsSort = new TreeModelSort(resultsFilter);
			for (int x = 0; x < resultsTree.Columns.Length; x++) {
				resultsSort.SetSortFunc(x, resultsSortFunc);
			}
			resultsTree.Model = resultsSort;

			ScrolledWindow resultsTreeSW = new ScrolledWindow();
			resultsTreeSW.Add(resultsTree);

			paned = new VPaned();
			paned.Add1(topBox);
			paned.Add2(resultsTreeSW);
			paned.Position = 160;
			paned.ShowAll();

			filterWidget = new FilterWidget(search);
			filterWidget.FiltersChanged += filterWidget_FiltersChanged;
			filterWidget.Hidden += filterWidget_Hidden;
		
			this.PackStart(filterWidget, false, false, 0);
			this.PackStart(paned, true, true, 0);

			TypeSelectionChanged(typeTree, EventArgs.Empty);

			search.NewResults += (NewResultsEventHandler)DispatchService.GuiDispatch(new NewResultsEventHandler(search_NewResults));
			search.ClearedResults += (EventHandler)DispatchService.GuiDispatch(new EventHandler(search_ClearedResults));

			resultPopupMenu = new Menu();
			
			browseResultMenuItem = new ImageMenuItem("Browse");
			browseResultMenuItem.Image = new Image(Gui.LoadIcon(16, "document-open"));
			browseResultMenuItem.Activated += BrowseToolButtonClicked;
			resultPopupMenu.Append(browseResultMenuItem);
			
			downloadResultMenuItem = new ImageMenuItem("Download");
			downloadResultMenuItem.Image = new Image(Gui.LoadIcon(16, "go-down"));
			downloadResultMenuItem.Activated += DownloadToolButtonClicked;
			resultPopupMenu.Append(downloadResultMenuItem);

			resultPropertiesMenuItem = new ImageMenuItem(Gtk.Stock.Properties, null);
			resultPropertiesMenuItem.Activated += FilePropertiesButtonClicked;
			resultPopupMenu.Append(resultPropertiesMenuItem);
		}
        public VerticalSliderSamples()
        {
            var slv1 = new VSlider {
                MinimumValue = 50, MaximumValue = 100
            };


            var lblv1 = new Label(slv1.Value.ToString("F"));

            slv1.ValueChanged += (sender, e) => {
                lblv1.Text = (slv1.Value).ToString("F");
            };

            var slv2 = new VSlider {
                MinimumValue  = -9,
                MaximumValue  = 0,
                StepIncrement = 2,
                SnapToTicks   = true,
            };

            var lblv2 = new Label(slv2.Value.ToString("F"));

            slv2.ValueChanged += (sender, e) => {
                lblv2.Text = (slv2.Value).ToString("F");
            };

            var slv3 = new VSlider {
                MinimumValue  = -9,
                MaximumValue  = 9,
                StepIncrement = 2,
                SnapToTicks   = false,
            };

            var lblv3 = new Label(slv3.Value.ToString("F"));

            slv3.ValueChanged += (sender, e) => {
                lblv3.Text = (slv2.Value = slv3.Value).ToString("F");
            };

            var slv4 = new VSlider {
                MinimumValue  = 0,
                MaximumValue  = 20,
                StepIncrement = 0.05
            };

            var lblv4 = new Label(slv4.Value.ToString("F"));

            lblv4.ExpandVertical = false;

            var slv4box = new HBox();

            slv4box.PackStart(lblv4, false, vpos: WidgetPlacement.Start, hpos: WidgetPlacement.End);
            slv4box.PackStart(slv4, false, false);

            slv4.ValueChanged += (sender, e) => {
                var offset = Math.Abs(slv4.Value) % slv4.StepIncrement;
                if (Math.Abs(offset) > double.Epsilon)
                {
                    if (offset > slv4.StepIncrement / 2)
                    {
                        if (slv4.Value >= 0)
                        {
                            slv4.Value += -offset + slv4.StepIncrement;
                        }
                        else
                        {
                            slv4.Value += offset - slv4.StepIncrement;
                        }
                    }
                    else
                    if (slv4.Value >= 0)
                    {
                        slv4.Value -= offset;
                    }
                    else
                    {
                        slv4.Value += offset;
                    }
                }

                lblv4.MarginTop = slv4.SliderPosition - (lblv4.Size.Height / 2);
                if (lblv4.MarginTop + lblv4.Size.Height > slv4.Size.Height)
                {
                    lblv4.MarginTop = slv4.Size.Height - lblv4.Size.Height;
                }
                if (lblv4.MarginTop < 0)
                {
                    lblv4.MarginTop = 0;
                }

                lblv4.Text = (slv4.Value).ToString("F2");
            };
            slv4.Value = slv4.MaximumValue;

            var slv4Labels = new VBox();

            slv4Labels.PackStart(new Label("20"), true, vpos: WidgetPlacement.Start);
            slv4Labels.PackStart(new Label("10"), true, vpos: WidgetPlacement.Center);
            slv4Labels.PackStart(new Label("0"), true, vpos: WidgetPlacement.End);
            slv4box.PackStart(slv4Labels, false, hpos: WidgetPlacement.Start);

            Add(slv1, 0, 1, vexpand: true, hexpand: true, hpos: WidgetPlacement.Center);
            Add(lblv1, 0, 0, hpos: WidgetPlacement.Center);
            Add(slv2, 1, 1, vexpand: true, hexpand: true, hpos: WidgetPlacement.Center);
            Add(lblv2, 1, 0, hpos: WidgetPlacement.Center);
            Add(slv3, 2, 1, vexpand: true, hexpand: true, hpos: WidgetPlacement.Center);
            Add(lblv3, 2, 0, hpos: WidgetPlacement.Center);
            Add(slv4box, 3, 1, vexpand: true, hexpand: true, hpos: WidgetPlacement.Center);
        }
Пример #48
0
	static void SetUpGui ()
	{
		Button b;
		
		Window w = new Window ("Eap Editor");
		//w.BorderWidth = 10;
		Table tableLayout = new Table(10, 2, false);
		//tableLayout.BorderWidth = 6;
		//tableLayout.ColumnSpacing = 6;
		//tableLayout.RowSpacing = 6;
		
		Image im = new Image ("data/icon.png");
//		b = new Button (im);
		tableLayout.Attach (im, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
								
		b = new Button ("App name:");
		tableLayout.Attach (b, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
		
		b = new Button ("Generic Info:");
		tableLayout.Attach (b, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
		
		b = new Button ("Comments:");
		tableLayout.Attach (b, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		

		b = new Button ("Executable:");
                tableLayout.Attach (b, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Window Name:");
                tableLayout.Attach (b, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Window Class:");
                tableLayout.Attach (b, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Startup notify:");
                tableLayout.Attach (b, 0, 1, 7, 8, AttachOptions.Fill, AttachOptions.Expand, 0, 0);		
		
		b = new Button ("Wait Exit:");
                tableLayout.Attach (b, 0, 1, 8, 9, AttachOptions.Fill, AttachOptions.Expand, 0, 0);
	
		b = new Button ("Select Icon");
		tableLayout.Attach (b, 1, 2, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);
				
		appname_entry = new Entry ();
                tableLayout.Attach (appname_entry, 1, 2, 1, 2);
		
		geninfo_entry = new Entry ();
                tableLayout.Attach (geninfo_entry, 1, 2, 2, 3);
		
		comments_entry = new Entry ();
                tableLayout.Attach (comments_entry, 1, 2, 3, 4);
		
		exe_entry = new Entry ();
                tableLayout.Attach (exe_entry, 1, 2, 4, 5);
		
		winname_entry = new Entry ();
                tableLayout.Attach (winname_entry, 1, 2, 5, 6);
		
		winclass_entry = new Entry ();
                tableLayout.Attach (winclass_entry, 1, 2, 6, 7);
		
		CheckButton start_cbox = new CheckButton ();
		start_cbox.Toggled += toggle_start_cbox;
                tableLayout.Attach (start_cbox, 1, 2, 7, 8);
		
		CheckButton wait_cbox= new CheckButton ();
		wait_cbox.Toggled += toggle_wait_cbox;
                tableLayout.Attach (wait_cbox, 1, 2, 8, 9);	
		
		HBox h = new HBox ();
		h.Spacing = 0;
		tableLayout.Attach (h, 0, 2, 9, 10);
		
		VBox v = new VBox ();		
		b = new Button ("Save");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		v = new VBox ();		
		b = new Button ("Cancel");
		v.PackStart (b, true, false, 0);
		h.PackStart (v, true, false, 0);
		
		w.Add (tableLayout);
		w.ShowAll ();
	}
Пример #49
0
        public DefaultPolicyOptionsDialog(Gtk.Window parentWindow)
            : base(parentWindow, new PolicySet(),
                   "/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
        {
            this.Title = GettextCatalog.GetString("Custom Policies");
            editingSet = (PolicySet)DataObject;

            HBox topBar = new HBox();

            topBar.Spacing = 3;
            topBar.PackStart(new Label(GettextCatalog.GetString("Editing Policy:")), false, false, 0);

            policiesCombo = ComboBox.NewText();
            topBar.PackStart(policiesCombo, false, false, 0);

            deleteButton = new Button(GettextCatalog.GetString("Delete Policy"));
            topBar.PackEnd(deleteButton, false, false, 0);

            exportButton             = new MenuButton();
            exportButton.Label       = GettextCatalog.GetString("Export");
            exportButton.MenuCreator = delegate {
                Gtk.Menu menu = new Gtk.Menu();
                MenuItem mi   = new MenuItem(GettextCatalog.GetString("To file..."));
                mi.Activated += HandleToFile;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("To project or solution..."));
                mi.Activated += HandleToProject;
                if (!IdeApp.Workspace.IsOpen)
                {
                    mi.Sensitive = false;
                }
                menu.Insert(mi, -1);
                menu.ShowAll();
                return(menu);
            };
            topBar.PackEnd(exportButton, false, false, 0);

            newButton             = new MenuButton();
            newButton.Label       = GettextCatalog.GetString("Add Policy");
            newButton.MenuCreator = delegate {
                Gtk.Menu menu = new Gtk.Menu();
                MenuItem mi   = new MenuItem(GettextCatalog.GetString("New policy..."));
                mi.Activated += HandleNewButtonClicked;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("From file..."));
                mi.Activated += HandleFromFile;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("From project or solution..."));
                mi.Activated += HandleFromProject;
                if (!IdeApp.Workspace.IsOpen)
                {
                    mi.Sensitive = false;
                }
                menu.Insert(mi, -1);
                menu.ShowAll();
                return(menu);
            };
            topBar.PackEnd(newButton, false, false, 0);

            Alignment align = new Alignment(0f, 0f, 1f, 1f);

            align.LeftPadding   = 9;
            align.TopPadding    = 9;
            align.RightPadding  = 9;
            align.BottomPadding = 9;
            align.Add(topBar);

            HeaderBox ebox = new HeaderBox();

            ebox.GradientBackground = true;
            ebox.SetMargins(0, 1, 0, 0);
            ebox.Add(align);

            ebox.ShowAll();

            VBox.PackStart(ebox, false, false, 0);
            VBox.BorderWidth = 0;
            Box.BoxChild c = (Box.BoxChild)VBox [ebox];
            c.Position = 0;

            foreach (PolicySet ps in PolicyService.GetUserPolicySets())
            {
                PolicySet copy = ps.Clone();
                originalSets [copy] = ps;
                sets.Add(copy);
            }
            FillPolicySets();

            policiesCombo.Changed += HandlePoliciesComboChanged;
            deleteButton.Clicked  += HandleDeleteButtonClicked;
        }
Пример #50
0
        public SelectReferenceDialog()
        {
            Build();

            combinedBox = new CombinedBox();
            combinedBox.Show();
            mainBook = new Notebook();
            combinedBox.Add(mainBook);
            alignment1.Add(combinedBox);
            mainBook.ShowAll();

            filterEntry = combinedBox.FilterEntry;

            boxRefs.WidthRequest = 200;

            refTreeStore             = new ListStore(typeof(string), typeof(string), typeof(string), typeof(string), typeof(ProjectReference), typeof(Xwt.Drawing.Image));
            ReferencesTreeView.Model = refTreeStore;

            TreeViewColumn col = new TreeViewColumn();

            col.Title = GettextCatalog.GetString("Reference");
            CellRendererImage crp = new CellRendererImage();

            crp.Yalign = 0f;
            col.PackStart(crp, false);
            col.AddAttribute(crp, "image", IconColumn);
            var text_render = new CustomSelectedReferenceCellRenderer();

            col.PackStart(text_render, true);
            col.AddAttribute(text_render, "text-markup", NameColumn);
            col.AddAttribute(text_render, "secondary-text-markup", SecondaryNameColumn);
            text_render.Ellipsize = Pango.EllipsizeMode.End;

            ReferencesTreeView.AppendColumn(col);
//			ReferencesTreeView.AppendColumn (GettextCatalog.GetString ("Type"), new CellRendererText (), "text", TypeNameColumn);
//			ReferencesTreeView.AppendColumn (GettextCatalog.GetString ("Location"), new CellRendererText (), "text", LocationColumn);

            projectRefPanel  = new ProjectReferencePanel(this);
            packageRefPanel  = new PackageReferencePanel(this, false);
            allRefPanel      = new PackageReferencePanel(this, true);
            assemblyRefPanel = new AssemblyReferencePanel(this);
            panels.Add(allRefPanel);
            panels.Add(packageRefPanel);
            panels.Add(projectRefPanel);
            panels.Add(assemblyRefPanel);

            //mainBook.RemovePage (mainBook.CurrentPage);

            HBox tab = new HBox(false, 3);

//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Reference, IconSize.Menu)), false, false, 0);
            tab.PackStart(new Label(GettextCatalog.GetString("_All")), true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll();
            mainBook.AppendPage(allRefPanel, tab);

            tab = new HBox(false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Package, IconSize.Menu)), false, false, 0);
            tab.PackStart(new Label(GettextCatalog.GetString("_Packages")), true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll();
            mainBook.AppendPage(packageRefPanel, tab);

            tab = new HBox(false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Project, IconSize.Menu)), false, false, 0);
            tab.PackStart(new Label(GettextCatalog.GetString("Pro_jects")), true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll();
            mainBook.AppendPage(projectRefPanel, tab);

            tab = new HBox(false, 3);
//			tab.PackStart (new Image (ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.OpenFolder, IconSize.Menu)), false, false, 0);
            tab.PackStart(new Label(GettextCatalog.GetString(".Net A_ssembly")), true, true, 0);
            tab.BorderWidth = 3;
            tab.ShowAll();
            mainBook.AppendPage(assemblyRefPanel, tab);

            mainBook.Page = 0;

            var w = selectedHeader.Child;

            selectedHeader.Remove(w);
            HeaderBox header = new HeaderBox(1, 0, 1, 1);

            header.SetPadding(6, 6, 6, 6);
            header.GradientBackground = true;
            header.Add(w);
            selectedHeader.Add(header);

            RemoveReferenceButton.CanFocus        = true;
            ReferencesTreeView.Selection.Changed += new EventHandler(OnChanged);
            Child.ShowAll();
            OnChanged(null, null);
            InsertFilterEntry();
        }
Пример #51
0
        private void Build()
        {
            _type              = new ComboBox(_options);
            _type.Changed     += OnProviderChange;
            _userLabel         = new Label("Username");
            _username          = new Entry();
            _username.Changed += OnTextChange;
            _passLabel         = new Label("Password");
            _password          = new Entry()
            {
                Visibility = false
            };
            _password.Changed += OnTextChange;
            _defAnimeCheck     = new CheckButton("Use this account for managing anime")
            {
                Name = "defAnime", Sensitive = false
            };
            _defAnimeCheck.Toggled += OnToggle;
            _defMangaCheck          = new CheckButton("Use this account for managing manga")
            {
                Name = "defManga", Sensitive = false
            };
            _defMangaCheck.Toggled += OnToggle;
            _okButton = new Button("OK");
            _okButton.SetSizeRequest(70, 30);
            _okButton.CanDefault = true;
            _okButton.Clicked   += OnOkButton;
            _okButton.Sensitive  = false;
            _cancelButton        = new Button("Cancel");
            _cancelButton.SetSizeRequest(70, 30);
            _cancelButton.Clicked += delegate { Respond(ResponseType.Cancel); };

            var hb1 = new HBox();

            hb1.PackStart(_userLabel, false, false, 7);
            hb1.Add(_username);
            VBox.Add(hb1);

            var hb2 = new HBox();

            hb2.PackStart(_passLabel, false, true, 7);
            hb2.Add(_password);
            VBox.Add(hb2);

            var bb = new VButtonBox {
                _defAnimeCheck, _defMangaCheck
            };

            VBox.Add(bb);

            var hb3 = new HBox();

            hb3.PackStart(new Label("Type"), false, false, 7);
            hb3.Add(_type);
            VBox.Add(hb3);

            ActionArea.Add(_okButton);
            _okButton.GrabDefault();             // Activates when you hit enter
            ActionArea.Add(_cancelButton);
            ShowAll();
        }