void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Select Work Item");
            VBox content = new VBox();
            HBox mainBox = new HBox();
            queryView.Columns.Add(new ListViewColumn(string.Empty, new TextCellView(titleField)));
            queryView.DataSource = queryStore;
            queryView.WidthRequest = 200;
            BuildQueryView();
            mainBox.PackStart(queryView);

            workItemList.WidthRequest = 400;
            workItemList.HeightRequest = 400;
            workItemList.ShowCheckboxes = true;

            mainBox.PackStart(workItemList, true, true);

            content.PackStart(mainBox, true, true);

            HBox buttonBox = new HBox();

            Button okButton = new Button(GettextCatalog.GetString("Ok"));
            okButton.WidthRequest = Constants.ButtonWidth;
            okButton.Clicked += (sender, e) => Respond(Command.Ok);
            buttonBox.PackEnd(okButton);

            content.PackStart(buttonBox);
            //this.Resizable = false;
            this.Content = content;

            AttachEvents();
        }
Ejemplo n.º 2
0
		public RadioButtonSample ()
		{
			var b1 = new RadioButton ("Item 1");
			var b2 = new RadioButton ("Item 2 (red background)");
			b2.BackgroundColor = Xwt.Drawing.Colors.Red;
			var b3 = new RadioButton ("Item 3");
			b2.Group = b3.Group = b1.Group;
			PackStart (b1);
			PackStart (b2);
			PackStart (b3);

			var la = new Label ();
			la.Hide ();
			b1.Group.ActiveRadioButtonChanged += delegate {
				la.Show ();
				la.Text = "Active: " + b1.Group.ActiveRadioButton.Label;
			};
			PackStart (la);

			PackStart (new HSeparator ());

			var box = new VBox ();
			box.PackStart (new Label ("First Option"));
			box.PackStart (new Label ("Second line"));

			var b4 = new RadioButton (box);
			var b5 = new RadioButton ("Second Option");
			var b6 = new RadioButton ("Disabled Option") { Sensitive = false };
			PackStart (b4);
			PackStart (b5);
			PackStart (b6);
			b4.Group = b5.Group = b6.Group;
		}
Ejemplo n.º 3
0
        private void Build()
        {
            this.Icon = Xwt.Drawing.Image.FromResource("URMSimulator.Resources.urm.png");
            this.Title = "About";
            this.Resizable = false;
            this.Buttons.Add(new DialogButton(Command.Close));

            vbox1 = new VBox();

            image1 = new ImageView();
            image1.WidthRequest = 320;
            image1.HeightRequest = 270;
            vbox1.PackStart(image1);

            labelProgramName = new Label();
            labelProgramName.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelProgramName);

            labelComments = new Label();
            labelComments.TextAlignment = Alignment.Center;
            vbox1.PackStart(labelComments);

            hbox1 = new HBox();

            hbox1.PackStart(new HBox(), true);

            labelWebsite = new LinkLabel();
            labelWebsite.TextAlignment = Alignment.Center; //text aligment doesn't work with Xwt.WPF
            hbox1.PackStart(labelWebsite, false);

            hbox1.PackStart(new HBox(), true);
            vbox1.PackStart(hbox1);

            this.Content = vbox1;
        }
		public DependenciesSectionWidget (IConfigurationSection section) 
		{
			this.section = section;

			widget = new VBox ();

			if (this.section.Service.Dependencies.Length == 0) {
				widget.PackStart (new Label { Text = GettextCatalog.GetString ("This service has no dependencies") });
				return;
			}

			bool firstCategory = true;

			foreach (var category in this.section.Service.Dependencies.Select (d => d.Category).Distinct ()) {
				var categoryIcon = new ImageView (category.Icon.WithSize (IconSize.Small));
				var categoryLabel = new Label (category.Name);
				var categoryBox = new HBox ();

				if (!firstCategory)
					categoryBox.MarginTop += 5;

				categoryBox.PackStart (categoryIcon);
				categoryBox.PackStart (categoryLabel);
				widget.PackStart (categoryBox);

				foreach (var dependency in this.section.Service.Dependencies.Where (d => d.Category == category)) {
					widget.PackStart (new DependencyWidget (section.Service, dependency) {
						MarginLeft = category.Icon.Size.Width / 2
					});
				}

				if (firstCategory)
					firstCategory = false;
			}
		}
		public ExecutionModeSelectorDialog ()
		{
			Title = GettextCatalog.GetString ("Execution Mode Selector");
			
			Width = 500;
			Height = 400;

			var box = new VBox ();
			Content = box;

			box.PackStart (new Label (GettextCatalog.GetString ("Run Configurations:")));
		
			listConfigs = new RunConfigurationsList ();
			box.PackStart (listConfigs, true);

			box.PackStart (new Label (GettextCatalog.GetString ("Execution Modes:")));

			storeModes = new TreeStore (modeNameField, modeField, modeSetField);
			treeModes = new TreeView (storeModes);
			treeModes.HeadersVisible = false;
			treeModes.Columns.Add (GettextCatalog.GetString ("Name"), modeNameField);
			box.PackStart (treeModes, true);

			runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));

			Buttons.Add (Command.Cancel);
			Buttons.Add (runButton);

			listConfigs.SelectionChanged += (sender, e) => LoadModes ();
			treeModes.SelectionChanged += OnModeChanged;
		}
Ejemplo n.º 6
0
		VBox GenerateFrameContents (bool useMnemonics)
		{
			var statusText = useMnemonics ? "with mnemonic" : "without mnemonic";
			var vbox = new VBox ();

			var button = new Button ("_Button");
			button.UseMnemonic = useMnemonics;
			button.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Button {0} clicked.", statusText));
			vbox.PackStart (button);

			var toggleButton = new ToggleButton ("_Toggle Button");
			toggleButton.UseMnemonic = useMnemonics;
			toggleButton.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Toggle Button {0} clicked.", statusText));
			vbox.PackStart (toggleButton);

			var menuButton = new MenuButton ("_Menu Button");
			menuButton.UseMnemonic = useMnemonics;
			menuButton.Label = "_Menu Button";
			var firstMenuItem = new MenuItem ("_First");
			firstMenuItem.UseMnemonic = useMnemonics;
			firstMenuItem.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("First Menu Item {0} clicked.", statusText));
			var secondMenuItem = new MenuItem ("_Second");
			secondMenuItem.UseMnemonic = useMnemonics;
			secondMenuItem.Clicked += (sender, e) => MessageDialog.ShowMessage (string.Format ("Second Menu Item {0} clicked.", statusText));
			var menu = new Menu ();
			menu.Items.Add (firstMenuItem);
			menu.Items.Add (secondMenuItem);
			menuButton.Menu = menu;
			vbox.PackStart (menuButton);

			return vbox;
		}
Ejemplo n.º 7
0
        public RadioButtonSample()
        {
            var b1 = new RadioButton ("Item 1");
            var b2 = new RadioButton ("Item 2");
            var b3 = new RadioButton ("Item 3");
            b2.Group = b3.Group = b1.Group;
            PackStart (b1);
            PackStart (b2);
            PackStart (b3);

            var la = new Label ();
            la.Hide ();
            b1.Group.ActiveRadioButtonChanged += delegate {
                la.Show ();
                la.Text = "Active: " + b1.Group.ActiveRadioButton.Label;
            };
            PackStart (la);

            PackStart (new HSeparator ());

            var box = new VBox ();
            box.PackStart (new Label ("First Option"));
            box.PackStart (new Label ("Second line"));

            var b4 = new RadioButton (box);
            var b5 = new RadioButton ("Second Option");
            PackStart (b4);
            PackStart (b5);
            b4.Group = b5.Group;
        }
Ejemplo n.º 8
0
 public ReliefFrameSample()
 {
     var box = new VBox ();
     box.PackStart (new ReliefFrame (new Button ("Hello")));
     box.PackStart (new ReliefFrame (new Button ("World")));
     PackStart (box);
 }
Ejemplo n.º 9
0
 void CreateButtons(HPaned panel)
 {
     var panel2 = panel.Panel2;
     var box = new VBox ();
     panel2.Content = box;
     box.PackStart (CreateConnectButton ());
     box.PackStart (CreateListenButton ());
 }
Ejemplo n.º 10
0
        public SubmitFeedbackWindow(string category)
        {
            Icon = App.Icon;
            Title = "Thanks for your feedback!";

            Resizable = false;

            VBox vbox = new VBox();

            var text = new TextEntry()
            {
                MinWidth = 500,
                MinHeight = 200,
                MultiLine = true,
                Text = ""
            };

            vbox.PackStart(text);
            {
                HBox box = new HBox();

                Button btn;
                box.PackEnd(btn = new Button(" Cancel "));
                btn.Clicked += (s, e) => { Close(); };

                box.PackEnd(btn = new Button(" Submit "));
                btn.Clicked += (s, e) =>
                {
                    string feedback = text.Text;
                    new Task(() =>
                        {
                            if (feedback.Length > 10)
                            {
                                string URL = "http://yuhrney.square7.ch/4Plug/feedback.php";
                                WebClient webClient = new WebClient();
                                webClient.Proxy = null;

                                NameValueCollection formData = new NameValueCollection();

                                formData["feedback"] = string.Format("{3} - {1} {2}\n{5}\n{4}", App.WindowTitle, Environment.OSVersion.Platform, Xwt.Toolkit.CurrentEngine.Type, DateTime.Now.ToString("dd MMM HH:mm:ss", CultureInfo.InvariantCulture), feedback, category).Trim();

                                byte[] responseBytes = webClient.UploadValues(URL, "POST", formData);
                                string responsefromserver = Encoding.UTF8.GetString(responseBytes);
                                Console.WriteLine(responsefromserver);
                                webClient.Dispose();
                            }

                        }).Start();
                    Close();
                };

                vbox.PackStart(box);

                Content = vbox;
            }
        }
Ejemplo n.º 11
0
 public ExpanderSample()
 {
     expander = new Expander ();
     expander.Label = "A title here";
     var content = new VBox ();
     content.PackStart (new Label () { Text = "Label 1" });
     content.PackStart (new Button () { Label = "Button 2" });
     expander.Content = content;
     PackStart (expander);
 }
Ejemplo n.º 12
0
		public WidgetRendering ()
		{
			VBox box = new VBox ();
			Button b = new Button ("Click here to take a shot if this box");
			box.PackStart (b);
			box.PackStart (new CheckBox ("Test checkbox"));
			PackStart (box);
			b.Clicked += delegate {
				var img = Toolkit.CurrentEngine.RenderWidget (box);
				PackStart (new ImageView (img));
			};
		}
Ejemplo n.º 13
0
        public SplashWindow()
        {
            Icon = App.Icon;

            Width = 550;

            Title = "4Plug First Use";
            Resizable = false;

            VBox V = new VBox();
            Content = V;

            Label lbl;

            lbl = new Label("A small introduction.") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Vpk.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("This tool allows you to quickly enable/disable mods as well as install new ones.");
            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            lbl = new Label("This is what a mod looks like in 4Plug!") { Font = Font.FromName("Segoe UI Light 24"), TextColor = PluginType.Unknown.GetColor() };
            V.PackStart(lbl);

            lbl = new Label("You can enable/disable mods by clicking on the image.");
            V.PackStart(lbl);

            //lbl = new Label("Uninstalled mods are saved in the \"custom_\" instead of the \"custom\" folder of you game.");
            //V.PackStart(lbl);

            lbl = new Label("");

            DummyPluginWidget dummy = new DummyPluginWidget(lbl);
            dummy.MarginTop += 16;
            dummy.MarginBottom += 8;
            V.PackStart(dummy);

            V.PackStart(lbl);

            lbl = new Label(""); V.PackStart(lbl);

            {
                HBox box = new HBox();
                Button btn;

                btn = new Button(" Got it! ");
                box.PackEnd(btn);
                btn.Clicked += (s, e) => { Close(); };

                Label lbl2;
                lbl2 = new Label(" Feel free to leave feedback (mainmenu -> submit feedback) later ");
                box.PackStart(lbl2);
                //btn.Clicked += (s, e) => { new SubmitFeedbackWindow("via Splash Window").Run(); };

                V.PackStart(box);
            }
        }
Ejemplo n.º 14
0
Archivo: Boxes.cs Proyecto: joncham/xwt
        public Boxes()
        {
            HBox box1 = new HBox ();

            VBox box2 = new VBox ();
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.None);
            box2.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);

            box1.PackStart (box2, BoxMode.FillAndExpand);
            box1.PackStart (new SimpleBox (30), BoxMode.None);
            box1.PackStart (new SimpleBox (30), BoxMode.Expand);
            PackStart (box1, BoxMode.None);

            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)}, BoxMode.FillAndExpand);
            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), BoxMode.FillAndExpand);
            box4.PackStart (b);
            box4.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            PackStart (box4);

            HBox box5 = new HBox ();
            Button b2 = new Button ("Hide / Show");
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            var hsb = new SimpleBox (20);
            box5.PackStart (hsb, BoxMode.None);
            box5.PackStart (b2);
            box5.PackStart (new SimpleBox (30), BoxMode.FillAndExpand);
            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.MinWidth = 10;
                box6.PackStart (w);
            }
            PackStart (box6);
        }
Ejemplo n.º 15
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 ();
	}
Ejemplo n.º 16
0
		public ExpanderSample ()
		{
			expander = new Expander ();
			expander.Label = "A title here";
			var content = new VBox ();
			content.PackStart (new Label () { Text = "Label 1" });
			content.PackStart (new Button () { Label = "Button 2" });
			content.BackgroundColor = Colors.Gray;
			expander.Content = content;
			PackStart (expander);

			PackStart (new Label ("This is shown below the expander"));
		}
        void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Check In files");
            this.Resizable = false;
            notebook.TabOrientation = NotebookTabOrientation.Left;

            var checkInTab = new VBox();
            checkInTab.PackStart(new Label(GettextCatalog.GetString("Pending Changes") + ":"));
            filesView.WidthRequest = 500;
            filesView.HeightRequest = 150;
            var checkView = new CheckBoxCellView(isCheckedField);
            checkView.Editable = true;
            filesView.Columns.Add("Name", checkView, new TextCellView(nameField));
            filesView.Columns.Add("Changes", changesField);
            filesView.Columns.Add("Folder", folderField);
            filesView.DataSource = fileStore;
            checkInTab.PackStart(filesView, true, true);

            checkInTab.PackStart(new Label(GettextCatalog.GetString("Comment") + ":"));
            commentEntry.MultiLine = true;
            checkInTab.PackStart(commentEntry);

            notebook.Add(checkInTab, GettextCatalog.GetString("Pending Changes"));


            var workItemsTab = new HBox();
            var workItemsListBox = new VBox();
            workItemsListBox.PackStart(new Label(GettextCatalog.GetString("Work Items") + ":"));
            workItemsView.Columns.Add("Id", idField);
            workItemsView.Columns.Add("Title", titleField);
            workItemsView.DataSource = workItemsStore;
            workItemsListBox.PackStart(workItemsView, true);
            workItemsTab.PackStart(workItemsListBox, true, true);

            var workItemButtonBox = new VBox();
            var addWorkItemButton = new Button(GettextCatalog.GetString("Add Work Item"));
            addWorkItemButton.Clicked += OnAddWorkItem;
            workItemButtonBox.PackStart(addWorkItemButton);
            var removeWorkItemButton = new Button(GettextCatalog.GetString("Remove Work Item"));
            removeWorkItemButton.Clicked += OnRemoveWorkItem;
            workItemButtonBox.PackStart(removeWorkItemButton);
            workItemsTab.PackStart(workItemButtonBox);

            notebook.Add(workItemsTab, GettextCatalog.GetString("Work Items"));


            this.Buttons.Add(Command.Ok, Command.Cancel);


            this.Content = notebook;
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public TextEntryHelper()
        {
            // Create text entry
            InnerTextEntry = new TextEntry();

            // Default bind
            InnerTextEntry.Changed += InnerTextEntry_Changed;

            // Self changed - show menu
            Changed += TextEntryHelper_Changed;

            // Key binding events
            InnerTextEntry.KeyReleased += InnerTextEntry_KeyPressed;

            // Helper
            VBox EntryHelper = new VBox();
            EntryHelper.PackStart(InnerTextEntry, true, true);

            // Create list store
            Values = new DataField<string>();
            HelperStore = new ListStore(Values);

            // Create helper list view
            HelperListView = new ListView()
            {
                MinHeight = 75,
                HeightRequest = 75,
                Visible = false,
                HeadersVisible = false,
                DataSource = HelperStore,
                SelectionMode = SelectionMode.Single
            };
            HelperListView.Columns.Add("Name", Values);

            // Click selection
            HelperListView.ButtonReleased += HelperListView_ButtonPressed;

            // Scroll view to
            EntryHelper.PackStart(HelperListView, true, true);

            // Margins
            MarginTop = 4;
            MarginBottom = 5;

            // Set as content
            Content = EntryHelper;

            // Show tree items
            InnerTextEntry.GotFocus += GotFocusHandler;
        }
        void BuildGui()
        {
            this.Title = "Get";
            this.Resizable = false;
            VBox content = new VBox();
            content.PackStart(new Label(GettextCatalog.GetString("Files") + ":"));

            listStore = new ListStore(itemField, isSelectedField, nameField, pathField);
            var checkSell = new CheckBoxCellView(isSelectedField);
            checkSell.Editable = true;
            listView.Columns.Add("Name", checkSell, new TextCellView(nameField));
            listView.Columns.Add("Folder", new TextCellView(pathField));
            listView.MinHeight = 200;
            listView.DataSource = listStore;

            content.PackStart(listView);

            HBox typeBox = new HBox();
            typeBox.PackStart(new Label(GettextCatalog.GetString("Version") + ":"));
            versionBox.Items.Add(0, "Changeset");
            versionBox.Items.Add(1, "Latest Version");
            versionBox.SelectedItem = 1;
            versionBox.SelectionChanged += (sender, e) => changeSetNumber.Visible = (int)versionBox.SelectedItem == 0;
            typeBox.PackStart(versionBox);
            changeSetNumber.Visible = false;
            changeSetNumber.WidthRequest = 100;
            changeSetNumber.MinimumValue = 1;
            changeSetNumber.MaximumValue = int.MaxValue;
            changeSetNumber.Value = 0;
            changeSetNumber.IncrementValue = 1;
            changeSetNumber.Digits = 0;
            typeBox.PackStart(changeSetNumber);
            content.PackStart(typeBox);

            content.PackStart(forceGet);
            //content.PackStart(overrideGet);

            HBox buttonBox = new HBox();
            Button okButton = new Button(GettextCatalog.GetString("Get"));
            okButton.Clicked += OnGet;
            Button cancelButton = new Button(GettextCatalog.GetString("Cancel"));
            cancelButton.Clicked += (sender, e) => Respond(Command.Cancel);
            okButton.WidthRequest = cancelButton.WidthRequest = Constants.ButtonWidth;

            buttonBox.PackEnd(cancelButton);
            buttonBox.PackEnd(okButton);
            content.PackStart(buttonBox);

            this.Content = content;
        }
		void Build ()
		{
			Title = GettextCatalog.GetString ("Add Platform Implementation");
			Width = 420;
			Height = 220;
			Padding = new WidgetSpacing (20, 20, 20, 20);

			var mainVBox = new VBox ();
			Content = mainVBox;

			// Platforms selection.
			var platformsVBox = new VBox ();
			platformsVBox.Spacing = 0;
			mainVBox.PackStart (platformsVBox);

			var platformsLabel = new Label ();
			platformsLabel.Text = GettextCatalog.GetString ("Select the platform implementations you would like to add:");
			platformsLabel.MarginBottom = 6;
			platformsVBox.PackStart (platformsLabel);

			androidCheckBox = new CheckBox ();
			androidCheckBox.Label = "Android";
			platformsVBox.PackStart (androidCheckBox);

			iosCheckBox = new CheckBox ();
			iosCheckBox.Label = "iOS";
			platformsVBox.PackStart (iosCheckBox);

			// Use shared project.
			var sharedProjectVBox = new VBox ();
			sharedProjectVBox.Spacing = 0;
			sharedProjectVBox.MarginTop = 20;
			mainVBox.PackStart (sharedProjectVBox);

			var useSharedProjectLabel = new Label ();
			useSharedProjectLabel.Text = GettextCatalog.GetString ("Create a Shared Project from the Portable Class Library:");
			useSharedProjectLabel.MarginBottom = 6;
			sharedProjectVBox.PackStart (useSharedProjectLabel);

			useSharedProjectCheckBox = new CheckBox ();
			useSharedProjectCheckBox.Label = GettextCatalog.GetString ("Create Shared Project");
			sharedProjectVBox.PackStart (useSharedProjectCheckBox);

			var cancelButton = new DialogButton (Command.Cancel);
			Buttons.Add (cancelButton);

			okButton = new DialogButton (Command.Ok);
			Buttons.Add (okButton);
		}
Ejemplo n.º 21
0
Archivo: Boxes.cs Proyecto: m13253/xwt
		public SpecialWidget ()
		{
			VBox bl = new VBox () { Spacing = 0 };
			bl.BackgroundColor = Colors.Gray;
			bl.PackStart (new Label ("Hi there"));
			Content = bl;
		}
Ejemplo n.º 22
0
        public MainView(IPresenterFactory presenterFactory)
        {
            _notebook = presenterFactory.InstantiatePresenter<MainNotebook>();
            _notebook.Add(presenterFactory.InstantiatePresenter<MenuPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<ModsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<BlueprintsPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<SavegamesPageView>(this));
            _notebook.Add(presenterFactory.InstantiatePresenter<TasksPageView>(this));

            PackStart(presenterFactory.InstantiatePresenter<MainHeaderView>());

            var sideBox = new VBox
            {
                MinWidth = 280,
                WidthRequest = 280
            };

            _sidebarContainer = new SidebarContainer();
            sideBox.PackStart(_sidebarContainer, true, true);
            var box = new HBox();

            box.PackStart(_notebook, true);
            box.PackEnd(sideBox);

            PackStart(box, true, true);

            _notebook.HandleSizeChangeOnTabChange = true;
            _notebook.HandleSizeUpdate();
        }
Ejemplo n.º 23
0
        private void InitializeComponent()
        {
            Width = 550;
            Height = 600;
            //Location = WindowLocation.CenterScreen;

            vbox2 = new VBox();
            vbox2.Visible = true;
            vbox2.Spacing = 3;

            notebook1 = new Notebook();
            notebook1.Visible = true;
            notebook1.CanGetFocus = true;

            image1 = new ImageView();
            string file = FileHelper.FindSupportFile("bygfoot_splash.png", false);
            image1.Image = Image.FromFile(file);

            treeview_splash_contributors = new TreeView();

            scrolledwindow2 = new ScrollView();
            scrolledwindow2.Content = treeview_splash_contributors;

            notebook1.Add(image1, "");
            notebook1.Add(scrolledwindow2, "");
            vbox2.PackStart(notebook1);

            Content = vbox2;
        }
Ejemplo n.º 24
0
        public LauncherWindow()
        {
            this.Title = "TrueCraft Launcher";
            this.Width = 1200;
            this.Height = 576;
            this.User = new TrueCraftUser();

            MainContainer = new HBox();
            WebScrollView = new ScrollView();
            WebView = new WebView("http://truecraft.io/updates");
            LoginView = new LoginView(this);
            OptionView = new OptionView(this);
            MultiplayerView = new MultiplayerView(this);
            SingleplayerView = new SingleplayerView(this);
            InteractionBox = new VBox();

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.svg"))
                TrueCraftLogoImage = new ImageView(Image.FromStream(stream));

            WebScrollView.Content = WebView;
            MainContainer.PackStart(WebScrollView, true);
            InteractionBox.PackStart(TrueCraftLogoImage);
            InteractionBox.PackEnd(LoginView);
            MainContainer.PackEnd(InteractionBox);

            this.Content = MainContainer;
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Baimp.PipelineController"/> class.
        /// </summary>
        /// <param name="project">Project.</param>
        /// <param name="pipelineShelf">Frame where the pipeline should be.</param>
        public PipelineController(Project project, VBox pipelineShelf)
        {
            this.pipelineShelf = pipelineShelf;

            pipelineScroller = new ScrollView();
            pipelineScroller.Content = currentPipeline;

            this.project = project;
            OnProjectDataChangged(new ProjectChangedEventArgs(null) { refresh = true });

            InitializeControllerbar();
            splitControllTab_pipelineScroller.PackEnd(pipelineScroller, true, true);

            algorithm = new AlgorithmTreeView(project.scanCollection);
            algorithm.MinWidth = 200; // TODO, save size as user property

            HPaned splitPipeline_Algorithm = new HPaned();
            splitPipeline_Algorithm.Panel1.Content = algorithm;
            splitPipeline_Algorithm.Panel1.Resize = false;
            splitPipeline_Algorithm.Panel1.Shrink = false;
            splitPipeline_Algorithm.Panel2.Content = splitControllTab_pipelineScroller;
            splitPipeline_Algorithm.Panel2.Resize = true;
            splitPipeline_Algorithm.Panel2.Shrink = false;

            pipelineShelf.PackStart(splitPipeline_Algorithm, true, true);

            InitializeEvents();
        }
Ejemplo n.º 26
0
        public Splash()
        {
            Decorated = false;
            ShowInTaskbar = false;
            box = new VBox {
                Margin = -2,
            };
            imageView = new ImageView {
                Image = Image.FromResource (Resources.Splash),
            };
            progressBar = new ProgressBar {
                Indeterminate = true,
                TooltipText = Catalog.GetString ("Loading..."),
            };
            info = new Label {
                Text = Catalog.GetString ("Loading..."),
                TextAlignment = Alignment.Center,
            };
            box.PackStart (imageView);
            box.PackEnd (progressBar);
            box.PackEnd (info);

            Content = box;

            InitialLocation = WindowLocation.CenterScreen;
        }
 protected virtual void PopulateViewBoxWithTitle(VBox vBox, IAsset asset)
 {
     var title = new Label(asset.Name)
     {
         Font = Font.SystemFont.WithSize(17.5).WithWeight(FontWeight.Bold)
     };
     vBox.PackStart(title);
 }
Ejemplo n.º 28
0
		public ServiceDetailsWidget ()
		{
			Margin = 30;

			var container = new VBox ();

			details = new ServiceWidget (true);
			details.BorderWidth = 1;
			details.CornerRadius = new Components.RoundedFrameBox.BorderCornerRadius (6, 6, 0, 0);
			sections = new VBox ();

			container.Spacing = sections.Spacing = 0;
			container.PackStart (details);
			container.PackStart (sections);

			Content = container;
		}
Ejemplo n.º 29
0
        public MainWindow()
        {
            Menu menu = new Menu ();

            var file = new MenuItem ("File");
            file.SubMenu = new Menu ();
            file.SubMenu.Items.Add (new MenuItem ("Open"));
            file.SubMenu.Items.Add (new MenuItem ("New"));
            file.SubMenu.Items.Add (new MenuItem ("Close"));
            menu.Items.Add (file);

            var edit = new MenuItem ("Edit");
            edit.SubMenu = new Menu ();
            edit.SubMenu.Items.Add (new MenuItem ("Copy"));
            edit.SubMenu.Items.Add (new MenuItem ("Cut"));
            edit.SubMenu.Items.Add (new MenuItem ("Paste"));
            menu.Items.Add (edit);

            MainMenu = menu;

            HBox box = new HBox ();

            icon = Image.FromResource (typeof(App), "class.png");

            store = new TreeStore (nameCol, iconCol, widgetCol);
            samplesTree = new TreeView ();
            samplesTree.Columns.Add ("Name", iconCol, nameCol);

            AddSample (null, "Boxes", typeof(Boxes));
            AddSample (null, "Buttons", typeof(ButtonSample));
            AddSample (null, "ComboBox", typeof(ComboBoxes));
            //			AddSample (null, "Designer", typeof(Designer));
            AddSample (null, "Drag & Drop", typeof(DragDrop));
            var n = AddSample (null, "Drawing", null);
            AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget));
            AddSample (n, "Chart", typeof(ChartSample));
            AddSample (n, "Transformations", typeof(DrawingTransforms));
            AddSample (null, "Images", typeof(Images));
            AddSample (null, "List View", typeof(ListView1));
            AddSample (null, "Notebook", typeof(NotebookSample));
            //			AddSample (null, "Scroll View", typeof(ScrollWindowSample));
            AddSample (null, "Text Entry", typeof(TextEntries));
            AddSample (null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.PackStart (samplesTree);

            sampleBox = new VBox ();
            title = new Label ("Sample:");
            sampleBox.PackStart (title, BoxMode.None);

            box.PackStart (sampleBox, BoxMode.FillAndExpand);

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
        }
        private void BuildGui()
        {
            this.Title = GettextCatalog.GetString("Manage Workspaces" + " - " + projectCollection.Server.Name + " - " + projectCollection.Name);
            this.Resizable = false;
            VBox content = new VBox();
            content.PackStart(new Label(GettextCatalog.GetString("Showing all local workspaces to which you have access, and all remote workspaces which you own.")));
            content.PackStart(new Label(GettextCatalog.GetString("Workspaces:")));

            _listView.Columns.Add(new ListViewColumn(GettextCatalog.GetString("Name"), new TextCellView(_name)));
            _listView.Columns.Add(new ListViewColumn(GettextCatalog.GetString("Computer"), new TextCellView(_computer)));
            _listView.Columns.Add(new ListViewColumn(GettextCatalog.GetString("Owner"), new TextCellView(_owner)));
            _listView.Columns.Add(new ListViewColumn(GettextCatalog.GetString("Comment"), new TextCellView(_comment)));
            _listView.MinHeight = 200;
            _listView.DataSource = _listStore;

            content.PackStart(_listView);

            HBox remoteBox = new HBox();

            _showRemoteCheck.Clicked += (sender, e) => FillWorkspaces();
            remoteBox.PackStart(_showRemoteCheck);
            remoteBox.PackStart(new Label(GettextCatalog.GetString("Show remote workspaces")));
            content.PackStart(remoteBox);

            HBox buttonBox = new HBox();
            Button addWorkspaceButton = new Button(GettextCatalog.GetString("Add")) { MinWidth = Constants.ButtonWidth };
            addWorkspaceButton.Clicked += AddWorkspaceClick;
            Button editWorkspaceButton = new Button(GettextCatalog.GetString("Edit")) { MinWidth = Constants.ButtonWidth };
            editWorkspaceButton.Clicked += EditWorkspaceClick;
            Button removeWorkspaceButton = new Button(GettextCatalog.GetString("Remove")) { MinWidth = Constants.ButtonWidth };
            removeWorkspaceButton.Clicked += RemoveWorkspaceClick;
            Button closeButton = new Button(GettextCatalog.GetString("Close")) { MinWidth = Constants.ButtonWidth };
            closeButton.Clicked += (sender, e) => this.Respond(Command.Close);

            buttonBox.PackStart(addWorkspaceButton);
            buttonBox.PackStart(editWorkspaceButton);
            buttonBox.PackStart(removeWorkspaceButton);
            buttonBox.PackEnd(closeButton);

            content.PackStart(buttonBox);

            this.Content = content;

            FillWorkspaces();
        }
Ejemplo n.º 31
0
        private void InitUI()
        {
            try
            {
                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //FiscalYear
                XPOComboBox xpoComboBoxFiscalYear = new XPOComboBox(DataSourceRow.Session, typeof(FIN_DocumentFinanceYears), (DataSourceRow as FIN_DocumentFinanceSeries).FiscalYear, "Designation");
                BOWidgetBox boxFiscalYear         = new BOWidgetBox(Resx.global_documentfinance_series, xpoComboBoxFiscalYear);
                vboxTab1.PackStart(boxFiscalYear, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxFiscalYear, DataSourceRow, "FiscalYear", SettingsApp.RegexGuid, true));

                //DocumentType
                XPOComboBox xpoComboBoxDocumentType = new XPOComboBox(DataSourceRow.Session, typeof(FIN_DocumentFinanceType), (DataSourceRow as FIN_DocumentFinanceSeries).DocumentType, "Designation");
                BOWidgetBox boxDocumentType         = new BOWidgetBox(Resx.global_documentfinance_type, xpoComboBoxDocumentType);
                vboxTab1.PackStart(boxDocumentType, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentType, DataSourceRow, "DocumentType", SettingsApp.RegexGuid, 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));

                //Acronym
                Entry       entryAcronym = new Entry();
                BOWidgetBox boxAcronym   = new BOWidgetBox(Resx.global_acronym, entryAcronym);
                vboxTab1.PackStart(boxAcronym, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxAcronym, _dataSourceRow, "Acronym", SettingsApp.RegexAlfaNumeric, false));

                //NextDocumentNumber
                Entry       entryNextDocumentNumber = new Entry();
                BOWidgetBox boxNextDocumentNumber   = new BOWidgetBox(Resx.global_documentfinanceseries_NextDocumentNumber, entryNextDocumentNumber);
                vboxTab1.PackStart(boxNextDocumentNumber, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNextDocumentNumber, _dataSourceRow, "NextDocumentNumber", SettingsApp.RegexIntegerGreaterThanZero, false));

                //DocumentNumberRangeBegin
                Entry       entryDocumentNumberRangeBegin = new Entry();
                BOWidgetBox boxDocumentNumberRangeBegin   = new BOWidgetBox(Resx.global_documentfinanceseries_DocumentNumberRangeBegin, entryDocumentNumberRangeBegin);
                vboxTab1.PackStart(boxDocumentNumberRangeBegin, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentNumberRangeBegin, _dataSourceRow, "DocumentNumberRangeBegin", SettingsApp.RegexIntegerGreaterThanZero, false));

                //DocumentNumberRangeEnd
                Entry       entryDocumentNumberRangeEnd = new Entry();
                BOWidgetBox boxDocumentNumberRangeEnd   = new BOWidgetBox(Resx.global_documentfinanceseries_DocumentNumberRangeEnd, entryDocumentNumberRangeEnd);
                vboxTab1.PackStart(boxDocumentNumberRangeEnd, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDocumentNumberRangeEnd, _dataSourceRow, "DocumentNumberRangeEnd", SettingsApp.RegexIntegerGreaterThanZero, false));

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                xpoComboBoxFiscalYear.Sensitive         = false;
                xpoComboBoxDocumentType.Sensitive       = false;
                entryAcronym.Sensitive                  = false;
                entryNextDocumentNumber.Sensitive       = false;
                entryDocumentNumberRangeBegin.Sensitive = false;
                entryDocumentNumberRangeEnd.Sensitive   = false;
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Ejemplo n.º 32
0
        void Build()
        {
            BorderWidth   = 0;
            DefaultWidth  = 901;
            DefaultHeight = 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.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;
        }
Ejemplo n.º 33
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;
        }
Ejemplo n.º 34
0
        public DocumentFinanceDialogPage7(Window pSourceWindow, String pPageName, String pPageIcon, Widget pWidget, bool pEnabled = true)
            : base(pSourceWindow, pPageName, pPageIcon, pWidget, pEnabled)
        {
            _vboxButtons  = new VBox(true, 0);
            _hboxButtons1 = new HBox(true, 0);
            _hboxButtons2 = new HBox(true, 0);

            //Print Invoice
            Button buttonPrintInvoice = new Button("Print Invoice")
            {
                Sensitive = false
            };

            buttonPrintInvoice.Clicked += buttonPrintInvoice_Clicked;

            //Cancel Invoice
            Button buttonCancelInvoice = new Button("Cancel Invoice");

            buttonCancelInvoice.Clicked += buttonCancelInvoice_Clicked;

            //OrderReferences
            Button buttonOrderReferences = new Button("Order References");

            buttonOrderReferences.Clicked += buttonOrderReferences_Clicked;

            //Credit Note
            Button buttonCreditNote = new Button("Credit Note");

            buttonCreditNote.Clicked += buttonCreditNote_Clicked;

            //Print Invoice With Diferent Vat's
            Button buttonPrintInvoiceVat = new Button("Print Invoice Vat");

            buttonPrintInvoiceVat.Clicked += buttonPrintInvoiceVat_Clicked;

            //Print Invoice With Discounts
            Button buttonPrintInvoiceDiscount = new Button("Print Invoice Discount");

            buttonPrintInvoiceDiscount.Clicked += buttonPrintInvoiceDiscount_Clicked;

            //Print Invoice With ExchangeRate
            Button buttonPrintInvoiceExchangeRate = new Button("Print Invoice ExchangeRate");

            buttonPrintInvoiceExchangeRate.Clicked += buttonPrintInvoiceExchangeRate_Clicked;

            //Print Invoice With JohnDoe1
            Button buttonPrintInvoiceJohnDoe1 = new Button("Print Invoice JohnDoe1");

            buttonPrintInvoiceJohnDoe1.Clicked += buttonPrintInvoiceJohnDoe1_Clicked;

            //Print Invoice With JohnDoe2
            Button buttonPrintInvoiceJohnDoe2 = new Button("Print Invoice JohnDoe2");

            buttonPrintInvoiceJohnDoe2.Clicked += buttonPrintInvoiceJohnDoe2_Clicked;

            //Print Invoice Transportation Guide With Totals
            Button buttonPrintTransportationGuideWithTotals = new Button("Print Transportation Guide With Totals");

            buttonPrintTransportationGuideWithTotals.Clicked += buttonPrintTransportationGuideWithTotals_Clicked;

            //Print Invoice Transportation Guide Without Totals
            Button buttonPrintTransportationGuideWithoutTotals = new Button("Print Transportation Guide Without Totals");

            buttonPrintTransportationGuideWithoutTotals.Clicked += buttonPrintTransportationGuideWithoutTotals_Clicked;

            //Pack hboxButtons1
            _hboxButtons1.PackStart(buttonPrintInvoice, true, true, 2);
            _hboxButtons1.PackStart(buttonCancelInvoice, true, true, 2);
            _hboxButtons1.PackStart(buttonOrderReferences, true, true, 2);
            _hboxButtons1.PackStart(buttonCreditNote, true, true, 2);
            _hboxButtons1.PackStart(buttonPrintInvoiceVat, true, true, 2);
            _hboxButtons1.PackStart(buttonPrintInvoiceDiscount, true, true, 2);
            //Pack hboxButtons2
            _hboxButtons2.PackStart(buttonPrintInvoiceExchangeRate, true, true, 2);
            _hboxButtons2.PackStart(buttonPrintInvoiceJohnDoe1, true, true, 2);
            _hboxButtons2.PackStart(buttonPrintInvoiceJohnDoe2, true, true, 2);
            _hboxButtons2.PackStart(buttonPrintTransportationGuideWithTotals, true, true, 2);
            _hboxButtons2.PackStart(buttonPrintTransportationGuideWithoutTotals, true, true, 2);

            //Shared : Prepare ArticleBag
            if (GlobalFramework.SessionApp.OrdersMain.ContainsKey(GlobalFramework.SessionApp.CurrentOrderMainOid))
            {
                _orderMain = GlobalFramework.SessionApp.OrdersMain[GlobalFramework.SessionApp.CurrentOrderMainOid];
                if (_orderMain != null)
                {
                    _articleBag = ArticleBag.TicketOrderToArticleBag(_orderMain);
                }
                if (_articleBag != null && _articleBag.Count > 0)
                {
                    buttonPrintInvoice.Sensitive = true;
                }
            }

            _vboxButtons.PackStart(_hboxButtons1, true, true, 2);
            _vboxButtons.PackStart(_hboxButtons2, true, true, 2);

            PackStart(_vboxButtons);
        }
Ejemplo n.º 35
0
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };
            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            this.ShowAll();

            var fileNameColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 0,
                Title        = GettextCatalog.GetString("File")
            };

            fileNameColumn.FixedWidth = 200;

            var fileNamePixbufRenderer = new CellRendererPixbuf();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(treeviewSearchResults.TextRenderer, true);
            fileNameColumn.SetCellDataFunc(treeviewSearchResults.TextRenderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);

//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//

            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           treeviewSearchResults.TextRenderer, ResultTextDataFunc);

            textColumn.SortColumnId = 2;
            textColumn.Resizable    = true;
            textColumn.FixedWidth   = 300;


            TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                                           treeviewSearchResults.TextRenderer, ResultPathDataFunc);

            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = true;
            pathColumn.FixedWidth   = 500;


            store.SetSortFunc(0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(Stock.Stop)
            {
                Sensitive = false
            };

            buttonStop.Clicked += ButtonStopClicked;

            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(Gtk.Stock.Clear);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton(Gui.Stock.OutputIcon);

            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton(Gui.Stock.PinUp);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            store.SetSortColumnId(3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
        }
Ejemplo n.º 36
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);
        }
Ejemplo n.º 37
0
        public MainWindow()
        {
            Menu menu = new Menu();

            var file = new MenuItem("File");

            file.SubMenu = new Menu();
            file.SubMenu.Items.Add(new MenuItem("Open"));
            file.SubMenu.Items.Add(new MenuItem("New"));
            file.SubMenu.Items.Add(new MenuItem("Close"));
            menu.Items.Add(file);

            var edit = new MenuItem("Edit");

            edit.SubMenu = new Menu();
            edit.SubMenu.Items.Add(new MenuItem("Copy"));
            edit.SubMenu.Items.Add(new MenuItem("Cut"));
            edit.SubMenu.Items.Add(new MenuItem("Paste"));
            menu.Items.Add(edit);

            MainMenu = menu;


            HBox box = new HBox();

            icon = Image.FromResource(typeof(App), "class.png");

            store       = new TreeStore(nameCol, iconCol, widgetCol);
            samplesTree = new TreeView();
            samplesTree.Columns.Add("Name", iconCol, nameCol);

            AddSample(null, "Boxes", typeof(Boxes));
            AddSample(null, "Buttons", typeof(ButtonSample));
            AddSample(null, "CheckBox", typeof(Checkboxes));
            AddSample(null, "ComboBox", typeof(ComboBoxes));
//			AddSample (null, "Designer", typeof(Designer));
            AddSample(null, "Drag & Drop", typeof(DragDrop));

            var n = AddSample(null, "Drawing", null);

            AddSample(n, "Canvas with Widget", typeof(CanvasWithWidget));
            AddSample(n, "Chart", typeof(ChartSample));
            AddSample(n, "Colors", typeof(Colors));
            AddSample(n, "Transformations", typeof(DrawingTransforms));

            AddSample(null, "Frames", typeof(Frames));
            AddSample(null, "Images", typeof(Images));
            AddSample(null, "Labels", typeof(Labels));
            AddSample(null, "List View", typeof(ListView1));
            AddSample(null, "Notebook", typeof(NotebookSample));
            AddSample(null, "Scroll View", typeof(ScrollWindowSample));
            AddSample(null, "Tables", typeof(Tables));
            AddSample(null, "Text Entry", typeof(TextEntries));
            AddSample(null, "WidgetEvents", typeof(WidgetEvents));
            AddSample(null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.PackStart(samplesTree);

            sampleBox = new VBox();
            title     = new Label("Sample:");
            sampleBox.PackStart(title, BoxMode.None);

            box.PackStart(sampleBox, BoxMode.FillAndExpand);

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
        }
Ejemplo n.º 38
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();
    }
Ejemplo n.º 39
0
        private EditDialog(Game game)
        {
            if (game == null)
            {
                Title = "Add";
            }
            else
            {
                Title      = "Edit";
                gameToEdit = game;
            }
            activeDialog         = this;
            activeDialog.Closed += HideEditDialog;

            this.Content = VBox;
            // Name
            HBox nameBox = new HBox();

            nameBox.PackStart(new Label("Name:"));
            nameBox.PackStart(NameEntry);
            NameEntry.WidthRequest = 300;
            VBox.PackStart(nameBox);
            // Command
            HBox commandBox = new HBox();

            commandBox.PackStart(new Label("Command:"));
            commandBox.PackStart(CommandEntry);
            CommandEntry.WidthRequest = 300;
            VBox.PackStart(commandBox);
            // Image
            HBox imageBox = new HBox();

            imageBox.PackStart(new Label("Image:"));
            ImageShow.WidthRequest  = 460;
            ImageShow.HeightRequest = 215;
            imageBox.PackStart(ImageShow);
            VBox.PackStart(imageBox);
            // Image select
            ImageSelector = new FileSelector();
            ImageSelector.Filters.Add(new FileDialogFilter("Image files", "*.bmp;*.jpg;*.jpeg;*.png;"));
            ImageSelector.FileChanged += FileChanged;
            VBox.PackStart(ImageSelector);
            // Tags
            VBox tagList = new VBox();

            tagList.PackStart(new Label("Tags:"));
            foreach (String tag in ConfigurationData.getInstance().Tags)
            {
                var check = new CheckBox(tag);
                if (gameToEdit != null && gameToEdit.tags.Contains(tag))
                {
                    check.State = CheckBoxState.On;
                }
                check.Toggled += CheckBoxClicked;
                tagList.PackStart(check);
            }
            VBox.PackStart(tagList);
            // Buttons
            Button saveButton = new Button("Save");

            saveButton.Clicked += SaveAndCloseDialog;
            VBox.PackEnd(saveButton);

            if (gameToEdit != null)
            {
                NameEntry.Text    = game.name;
                CommandEntry.Text = game.command;
                ImageShow.Image   = game.GetImage();
            }
            else
            {
                gameToEdit = new Game();
            }
        }
Ejemplo n.º 40
0
        public override void LaunchDialogue()
        {
            //the Type in the collection
            IList  collection  = (IList)Value;
            string displayName = Property.DisplayName;

            //populate list with existing items
            ListStore itemStore = new ListStore(typeof(object), typeof(int), typeof(string));

            for (int i = 0; i < collection.Count; i++)
            {
                itemStore.AppendValues(collection[i], i, collection[i].ToString());
            }

            #region Building Dialogue

            TreeView     itemTree;
            PropertyGrid grid;
            TreeIter     previousIter = TreeIter.Zero;

            //dialogue and buttons
            Dialog dialog = new Dialog()
            {
                Title       = displayName + " Editor",
                Modal       = true,
                AllowGrow   = true,
                AllowShrink = true,
            };
            var toplevel = this.Container.Toplevel as Window;
            if (toplevel != null)
            {
                dialog.TransientFor = toplevel;
            }

            dialog.AddActionWidget(new Button(Stock.Cancel), ResponseType.Cancel);
            dialog.AddActionWidget(new Button(Stock.Ok), ResponseType.Ok);

            //three columns for items, sorting, PropGrid
            HBox hBox = new HBox();
            dialog.VBox.PackStart(hBox, true, true, 5);

            //propGrid at end
            grid = new PropertyGrid(base.EditorManager)
            {
                CurrentObject = null,
                WidthRequest  = 200,
                ShowHelp      = false
            };
            hBox.PackEnd(grid, true, true, 5);

            //followed by a ButtonBox
            VBox buttonBox = new VBox();
            buttonBox.Spacing = 6;
            hBox.PackEnd(buttonBox, false, false, 5);

            //add/remove buttons
            Button addButton = new Button(new Image(Stock.Add, IconSize.Button));
            buttonBox.PackStart(addButton, false, false, 0);
            if (types[0].IsAbstract)
            {
                addButton.Sensitive = false;
            }
            Button removeButton = new Button(new Gtk.Image(Stock.Remove, IconSize.Button));
            buttonBox.PackStart(removeButton, false, false, 0);

            //sorting buttons
            Button upButton = new Button(new Image(Stock.GoUp, IconSize.Button));
            buttonBox.PackStart(upButton, false, false, 0);
            Button downButton = new Button(new Image(Stock.GoDown, IconSize.Button));
            buttonBox.PackStart(downButton, false, false, 0);

            //Third column has list (TreeView) in a ScrolledWindow
            ScrolledWindow listScroll = new ScrolledWindow();
            listScroll.WidthRequest  = 200;
            listScroll.HeightRequest = 320;
            hBox.PackStart(listScroll, false, false, 5);

            itemTree = new TreeView(itemStore);
            itemTree.Selection.Mode = SelectionMode.Single;
            itemTree.HeadersVisible = false;
            listScroll.AddWithViewport(itemTree);

            //renderers and attribs for TreeView
            CellRenderer rdr = new CellRendererText();
            itemTree.AppendColumn(new TreeViewColumn("Index", rdr, "text", 1));
            rdr = new CellRendererText();
            itemTree.AppendColumn(new TreeViewColumn("Object", rdr, "text", 2));

            #endregion

            #region Events

            addButton.Clicked += delegate
            {
                //create the object
                object instance = System.Activator.CreateInstance(types[0]);

                //get existing selection and insert after it
                TreeIter oldIter, newIter;
                if (itemTree.Selection.GetSelected(out oldIter))
                {
                    newIter = itemStore.InsertAfter(oldIter);
                }
                //or append if no previous selection
                else
                {
                    newIter = itemStore.Append();
                }
                itemStore.SetValue(newIter, 0, instance);

                //select, set name and update all the indices
                itemTree.Selection.SelectIter(newIter);
                UpdateName(itemStore, newIter);
                UpdateIndices(itemStore);
            };

            removeButton.Clicked += delegate
            {
                //get selected iter and the replacement selection
                TreeIter iter, newSelection;
                if (!itemTree.Selection.GetSelected(out iter))
                {
                    return;
                }

                newSelection = iter;
                if (!IterPrev(itemStore, ref newSelection))
                {
                    newSelection = iter;
                    if (!itemStore.IterNext(ref newSelection))
                    {
                        newSelection = TreeIter.Zero;
                    }
                }

                //new selection. Zeroing previousIter prevents trying to update name of deleted iter.
                previousIter = TreeIter.Zero;
                if (itemStore.IterIsValid(newSelection))
                {
                    itemTree.Selection.SelectIter(newSelection);
                }

                //and the removal and index update
                itemStore.Remove(ref iter);
                UpdateIndices(itemStore);
            };

            upButton.Clicked += delegate
            {
                TreeIter iter, prev;
                if (!itemTree.Selection.GetSelected(out iter))
                {
                    return;
                }

                //get previous iter
                prev = iter;
                if (!IterPrev(itemStore, ref prev))
                {
                    return;
                }

                //swap the two
                itemStore.Swap(iter, prev);

                //swap indices too
                object prevVal = itemStore.GetValue(prev, 1);
                object iterVal = itemStore.GetValue(iter, 1);
                itemStore.SetValue(prev, 1, iterVal);
                itemStore.SetValue(iter, 1, prevVal);
            };

            downButton.Clicked += delegate
            {
                TreeIter iter, next;
                if (!itemTree.Selection.GetSelected(out iter))
                {
                    return;
                }

                //get next iter
                next = iter;
                if (!itemStore.IterNext(ref next))
                {
                    return;
                }

                //swap the two
                itemStore.Swap(iter, next);

                //swap indices too
                object nextVal = itemStore.GetValue(next, 1);
                object iterVal = itemStore.GetValue(iter, 1);
                itemStore.SetValue(next, 1, iterVal);
                itemStore.SetValue(iter, 1, nextVal);
            };

            itemTree.Selection.Changed += delegate
            {
                TreeIter iter;
                if (!itemTree.Selection.GetSelected(out iter))
                {
                    removeButton.Sensitive = false;
                    return;
                }
                removeButton.Sensitive = true;

                //update grid
                object obj = itemStore.GetValue(iter, 0);
                grid.CurrentObject = obj;

                //update previously selected iter's name
                UpdateName(itemStore, previousIter);

                //update current selection so we can update
                //name next selection change
                previousIter = iter;
            };

            grid.Changed += delegate
            {
                TreeIter iter;
                if (itemTree.Selection.GetSelected(out iter))
                {
                    UpdateName(itemStore, iter);
                }
            };

            TreeIter selectionIter;
            removeButton.Sensitive = itemTree.Selection.GetSelected(out selectionIter);

            dialog.ShowAll();
            grid.ShowToolbar = false;

            #endregion

            //if 'OK' put items back in collection
            if (MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog, toplevel) == (int)ResponseType.Ok)
            {
                DesignerTransaction tran = CreateTransaction(Instance);
                object old = collection;

                try
                {
                    collection.Clear();
                    foreach (object[] o in itemStore)
                    {
                        collection.Add(o[0]);
                    }
                    EndTransaction(Instance, tran, old, collection, true);
                }
                catch
                {
                    EndTransaction(Instance, tran, old, collection, false);
                    throw;
                }
            }
        }
        public override Widget 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(Gtk.Stock.DialogWarning, IconSize.LargeToolbar);

            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.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);
        }
Ejemplo n.º 42
0
        /// <summary>
        /// Initialize window.
        /// </summary>
        public override void _initializeComponents()
        {
            // Server Name + URL + Periodicity window
            Frame f = new Frame();

            f.Label   = Director.Properties.Resources.ServerSettings;
            f.Padding = 10;

            // Create VBOX
            VBox ServerSettings = new VBox();

            // Prepare text box
            ServerSettings.PackStart(new Label()
            {
                Text = Director.Properties.Resources.ServerName
            });
            ServerName          = new TextEntry();
            ServerName.Changed += ServerName_Changed;
            ServerSettings.PackStart(ServerName);

            // Add invalid server name
            ServerSettings.PackStart(InvalidServerName);

            // Server URL
            ServerSettings.PackStart(new Label()
            {
                Text = Director.Properties.Resources.ServerURL
            });
            ServerURL          = new TextEntry();
            ServerURL.Changed += ServerURL_Changed;
            ServerSettings.PackStart(ServerURL);

            // Invalid URL
            ServerSettings.PackStart(InvalidServerURL);

            // Frequency settings
            ServerSettings.PackStart(new Label()
            {
                Text = Director.Properties.Resources.RunningPeriodicity
            });
            FrequencyRunning = new ComboBox();
            FrequencyHelper.FillComboBox(FrequencyRunning);
            ServerSettings.PackStart(FrequencyRunning);
            FrequencyRunning.SelectedIndex     = 0;
            FrequencyRunning.SelectionChanged += FrequencyRunning_SelectionChanged;

            // Add Frame to server settings
            f.Content = ServerSettings;
            PackStart(f);

            // Authorization
            AuthRequired            = new CheckBox(Director.Properties.Resources.Authorization);
            AuthRequired.MarginLeft = 10;
            PackStart(AuthRequired);

            // Create Authentication Frame
            Authentication = new Frame()
            {
                Label   = Director.Properties.Resources.AuthorizationSettings,
                Padding = 10
            };

            // Login and Password fields
            VBox AuthBox = new VBox();

            AuthBox.PackStart(new Label()
            {
                Text = Director.Properties.Resources.Username
            });
            AuthUserName          = new TextEntry();
            AuthUserName.Changed += AuthUserName_Changed;
            AuthBox.PackStart(AuthUserName);

            AuthBox.PackStart(new Label()
            {
                Text = Director.Properties.Resources.Password
            });
            AuthUserPassword          = new PasswordEntry();
            AuthUserPassword.Changed += AuthUserPassword_Changed;
            AuthBox.PackStart(AuthUserPassword);

            // Authentication content
            Authentication.Content = AuthBox;
            PackStart(Authentication);

            // Change value
            AuthRequired.Toggled += AuthRequired_Toggled;

            // Email settings
            Frame EmailFrame = new Frame()
            {
                Label     = Director.Properties.Resources.EmailNotifications,
                Padding   = 10,
                MinHeight = 180
            };

            // Create EmailList widget
            EmailWidget        = new EmailList();
            EmailFrame.Content = EmailWidget;
            PackStart(EmailFrame, expand: true, fill: true);
        }
Ejemplo n.º 43
0
 public void ShowFooter(Widget w)
 {
     HideFooter();
     vbox.PackStart(w, false, false, 0);
     footer = w;
 }
Ejemplo n.º 44
0
        public MainWindow()
        {
            Title  = "Xwt Demo Application";
            Width  = 500;
            Height = 400;

            try {
                statusIcon      = Application.CreateStatusIcon();
                statusIcon.Menu = new Menu();
                statusIcon.Menu.Items.Add(new MenuItem("Test"));
                statusIcon.Image = Image.FromResource(GetType(), "package.png");
            } catch {
                Console.WriteLine("Status icon could not be shown");
            }

            Menu menu = new Menu();

            var file = new MenuItem("File");

            file.SubMenu = new Menu();
            file.SubMenu.Items.Add(new MenuItem("Open"));
            file.SubMenu.Items.Add(new MenuItem("New"));
            MenuItem mi = new MenuItem("Close");

            mi.Clicked += delegate {
                Application.Exit();
            };
            file.SubMenu.Items.Add(mi);
            menu.Items.Add(file);

            var edit = new MenuItem("Edit");

            edit.SubMenu = new Menu();
            edit.SubMenu.Items.Add(new MenuItem("Copy"));
            edit.SubMenu.Items.Add(new MenuItem("Cut"));
            edit.SubMenu.Items.Add(new MenuItem("Paste"));
            menu.Items.Add(edit);

            MainMenu = menu;


            HPaned box = new HPaned();

            icon = Image.FromResource(typeof(App), "document-generic.png");

            store       = new TreeStore(nameCol, iconCol, widgetCol);
            samplesTree = new TreeView();
            samplesTree.Columns.Add("Name", iconCol, nameCol);

            AddSample(null, "Boxes", typeof(Boxes));
            AddSample(null, "Buttons", typeof(ButtonSample));
            AddSample(null, "CheckBox", typeof(Checkboxes));
            AddSample(null, "Clipboard", typeof(ClipboardSample));
            AddSample(null, "ColorSelector", typeof(ColorSelectorSample));
            AddSample(null, "ComboBox", typeof(ComboBoxes));
//			AddSample (null, "Designer", typeof(Designer));
            AddSample(null, "Drag & Drop", typeof(DragDrop));

            var n = AddSample(null, "Drawing", null);

            AddSample(n, "Canvas with Widget (Linear)", typeof(CanvasWithWidget_Linear));
            AddSample(n, "Canvas with Widget (Radial)", typeof(CanvasWithWidget_Radial));
            AddSample(n, "Chart", typeof(ChartSample));
            AddSample(n, "Colors", typeof(ColorsSample));
            AddSample(n, "Figures", typeof(DrawingFigures));
            AddSample(n, "Transformations", typeof(DrawingTransforms));
            AddSample(n, "Images and Patterns", typeof(DrawingPatternsAndImages));
            AddSample(n, "Text", typeof(DrawingText));
            AddSample(n, "Partial Images", typeof(PartialImages));
            AddSample(n, "Custom Drawn Image", typeof(ImageScaling));
            AddSample(n, "Widget Rendering", typeof(WidgetRendering));

            AddSample(null, "Expander", typeof(ExpanderSample));
            AddSample(null, "Progress bars", typeof(ProgressBarSample));
            AddSample(null, "Frames", typeof(Frames));
            AddSample(null, "Images", typeof(Images));
            AddSample(null, "Labels", typeof(Labels));
            AddSample(null, "ListBox", typeof(ListBoxSample));
            AddSample(null, "LinkLabels", typeof(LinkLabels));
            AddSample(null, "ListView", typeof(ListView1));
            AddSample(null, "Markdown", typeof(MarkDownSample));
            AddSample(null, "Menu", typeof(MenuSamples));
            AddSample(null, "Notebook", typeof(NotebookSample));
            AddSample(null, "Paneds", typeof(PanedViews));
            AddSample(null, "Popover", typeof(PopoverSample));
            AddSample(null, "RadioButton", typeof(RadioButtonSample));
            AddSample(null, "ReliefFrame", typeof(ReliefFrameSample));
            AddSample(null, "Screens", typeof(ScreensSample));
            AddSample(null, "Scroll View", typeof(ScrollWindowSample));
            AddSample(null, "Scrollbar", typeof(ScrollbarSample));
            AddSample(null, "Spinners", typeof(Spinners));
            AddSample(null, "Tables", typeof(Tables));
            AddSample(null, "Text Entry", typeof(TextEntries));
            AddSample(null, "Tooltips", typeof(Tooltips));
            AddSample(null, "TreeView", typeof(TreeViews));
            AddSample(null, "WidgetEvents", typeof(WidgetEvents));
            AddSample(null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.Panel1.Content = samplesTree;

            sampleBox = new VBox();
            title     = new Label("Sample:");
            sampleBox.PackStart(title, BoxMode.None);

            box.Panel2.Content = sampleBox;
            box.Panel2.Resize  = true;
            box.Position       = 160;

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;

            CloseRequested += HandleCloseRequested;
        }
Ejemplo n.º 45
0
        public override void Clicked()
        {
            Box       tmpBox, tmpBox2;
            Alignment tmpAlign;
            Box       vbox = new Gtk.VBox();

            vbox.Spacing = 3;
            Box hbox = new Gtk.HBox();

            hbox.Spacing = 3;

            Box dungeonVreContainer         = new Gtk.VBox();
            Box roomVreContainer            = new Gtk.VBox();
            ValueReferenceEditor dungeonVre = null;
            ValueReferenceEditor roomVre    = null;

            Alignment frame             = new Alignment(0, 0, 0, 0);
            var       dungeonSpinButton = new SpinButton(0, 15, 1);
            var       floorSpinButton   = new SpinButton(0, 15, 1);
            var       roomSpinButton    = new SpinButtonHexadecimal(0, 255, 1);

            roomSpinButton.Digits = 2;
            Minimap minimap = null;

            System.Action RoomChanged = () => {
                Dungeon dungeon = minimap.Map as Dungeon;
                Room    room    = minimap.GetRoom();

                roomSpinButton.Value = room.Index & 0xff;

                var vrs = new List <ValueReference>();
                vrs.Add(new StreamValueReference("Up", room.Index & 0xff, 0, 0, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Right", room.Index & 0xff, 1, 1, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Down", room.Index & 0xff, 2, 2, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Left", room.Index & 0xff, 3, 3, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Key", room.Index & 0xff, 4, 4, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Chest", room.Index & 0xff, 5, 5, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Boss", room.Index & 0xff, 6, 6, DataValueType.ByteBit));
                vrs.Add(new StreamValueReference("Dark", room.Index & 0xff, 7, 7, DataValueType.ByteBit));

                Stream stream = Project.GetBinaryFile("rooms/" + Project.GameString + "/group" + dungeon.Group + "DungeonProperties.bin");
                foreach (StreamValueReference r in vrs)
                {
                    r.SetStream(stream);
                }

                if (roomVre != null)
                {
                    roomVreContainer.Remove(roomVre);
                }

                var vrg = new ValueReferenceGroup(vrs);
                roomVre = new ValueReferenceEditor(Project, vrg, 4, "Minimap Data");

                roomVreContainer.Add(roomVre);
            };

            System.Action DungeonChanged = () => {
                Dungeon dungeon = Project.GetIndexedDataType <Dungeon>(dungeonSpinButton.ValueAsInt);

                floorSpinButton.Adjustment.Upper = dungeon.NumFloors - 1;
                if (floorSpinButton.ValueAsInt >= dungeon.NumFloors)
                {
                    floorSpinButton.Value = dungeon.NumFloors - 1;
                }

                var vrs = new List <ValueReference>();
                vrs.Add(new ValueReference("Group", 0, DataValueType.String, false));
                vrs.Add(new ValueReference("Wallmaster dest room", 0, DataValueType.Byte));
                vrs.Add(new ValueReference("Bottom floor layout", 0, DataValueType.Byte, false));
                vrs.Add(new ValueReference("# of floors", 0, DataValueType.Byte, false));
                vrs.Add(new ValueReference("Base floor name", 0, DataValueType.Byte));
                vrs.Add(new ValueReference("Floors unlocked with compass", 0, DataValueType.Byte));

                Data data = dungeon.DataStart;
                foreach (ValueReference r in vrs)
                {
                    r.SetData(data);
                    data = data.NextData;
                }

                // Remove last ValueReferenceEditor
                if (dungeonVre != null)
                {
                    dungeonVreContainer.Remove(dungeonVre);
                }

                var vrg = new ValueReferenceGroup(vrs);
                dungeonVre = new ValueReferenceEditor(Project, vrg, "Base Data");

                dungeonVre.AddDataModifiedHandler(() => {
                    floorSpinButton.Adjustment.Upper = dungeon.NumFloors;
                    minimap.GenerateImage();
                    RoomChanged();
                });

                // Replace the "group" option with a custom widget for finer
                // control.
                SpinButton groupSpinButton = new SpinButton(4, 5, 1);
                groupSpinButton.Value         = dungeon.Group;
                groupSpinButton.ValueChanged += (c, d) => {
                    vrg.SetValue("Group", ">wGroup" + groupSpinButton.ValueAsInt + "Flags");
                };
                dungeonVre.ReplaceWidget(0, groupSpinButton);
                dungeonVre.ShowAll();

                // Tooltips
                dungeonVre.SetTooltip(0, "Also known as the high byte of the room index.");
                dungeonVre.SetTooltip(1, "The low byte of the room index wallmasters will send you to.");
                dungeonVre.SetTooltip(2, "The index of the layout for the bottom floor. Subsequent floors will use subsequent indices.");
                dungeonVre.SetTooltip(4, "Determines what the game will call the bottom floor. For a value of:\n$00: The bottom floor is 'B3'.\n$01: The bottom floor is 'B2'.\n$02: The bottom floor is 'B1'.\n$03: The bottom floor is 'F1'.");
                dungeonVre.SetTooltip(5, "A bitset of floors that will appear on the map when the compass is obtained.\n\nEg. If this is $05, then floors 0 and 2 will be unlocked (bits 0 and 2 are set).");

                dungeonVreContainer.Add(dungeonVre);
                minimap.SetMap(dungeon);
                minimap.Floor = floorSpinButton.ValueAsInt;

                RoomChanged();
            };

            dungeonSpinButton.ValueChanged += (a, b) => { DungeonChanged(); };
            floorSpinButton.ValueChanged   += (a, b) => { DungeonChanged(); };

            frame.Add(vbox);

            tmpBox = new Gtk.HBox();
            tmpBox.Add(new Gtk.Label("Dungeon "));
            tmpBox.Add(dungeonSpinButton);
            tmpBox.Add(new Gtk.Label("Floor "));
            tmpBox.Add(floorSpinButton);
            tmpAlign = new Alignment(0, 0, 0, 0);
            tmpAlign.Add(tmpBox);

            vbox.Add(tmpAlign);
            vbox.Add(hbox);

            // Leftmost column

            tmpBox = new VBox();
            tmpBox.Add(dungeonVreContainer);

            var addFloorButton = new Button("Add Floor");

            addFloorButton.Image    = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Button);
            addFloorButton.Clicked += (a, b) => {
                Dungeon dungeon = minimap.Map as Dungeon;

                int newFloorIndex = dungeon.FirstLayoutIndex + dungeon.NumFloors;

                // Shift all subsequent layouts 64 bytes down in the data file
                Stream layoutFile = Project.GetBinaryFile("rooms/" + Project.GameString + "/dungeonLayouts.bin");
                layoutFile.SetLength(layoutFile.Length + 64);
                for (int i = (int)layoutFile.Length / 64 - 1; i > newFloorIndex; i--)
                {
                    var buf = new byte[64];
                    layoutFile.Position = (i - 1) * 64;
                    layoutFile.Read(buf, 0, 64);
                    layoutFile.Write(buf, 0, 64);
                }

                // Clear the new floor
                layoutFile.Position = newFloorIndex * 64;
                for (int j = 0; j < 64; j++)
                {
                    layoutFile.WriteByte(0);
                }

                // Shift each dungeon's "FirstLayoutIndex" to match the shifted layouts.
                for (int i = 0; i < Project.GetNumDungeons(); i++)
                {
                    Dungeon d2 = Project.GetIndexedDataType <Dungeon>(i);
                    if (d2.FirstLayoutIndex >= newFloorIndex)
                    {
                        d2.FirstLayoutIndex++;
                    }
                }

                dungeon.NumFloors     = dungeon.NumFloors + 1;
                floorSpinButton.Value = dungeon.NumFloors - 1;
                DungeonChanged();
            };
            tmpAlign = new Gtk.Alignment(0.5f, 0, 0, 0);
            tmpAlign.Add(addFloorButton);
            tmpBox.PackStart(tmpAlign);

            var removeFloorButton = new Button("Remove Top Floor");

            removeFloorButton.Image    = new Gtk.Image(Gtk.Stock.Remove, Gtk.IconSize.Button);
            removeFloorButton.Clicked += (a, b) => {
                Dungeon dungeon = minimap.Map as Dungeon;

                if (dungeon.NumFloors <= 1)
                {
                    return;
                }

                Gtk.MessageDialog d = new MessageDialog(null,
                                                        DialogFlags.DestroyWithParent,
                                                        MessageType.Warning,
                                                        ButtonsType.YesNo,
                                                        "Are you quite certain that you wish to delete the top floor of this dungeon?");
                var response = (ResponseType)d.Run();
                d.Destroy();

                if (response == Gtk.ResponseType.Yes)
                {
                    int deletedFloorIndex = dungeon.FirstLayoutIndex + dungeon.NumFloors - 1;

                    // Shift all subsequent layouts 64 bytes up in the data file
                    Stream layoutFile = Project.GetBinaryFile("rooms/" + Project.GameString + "/dungeonLayouts.bin");
                    for (int i = deletedFloorIndex; i < layoutFile.Length / 64 - 1; i++)
                    {
                        var buf = new byte[64];
                        layoutFile.Position = (i + 1) * 64;
                        layoutFile.Read(buf, 0, 64);
                        layoutFile.Position = i * 64;
                        layoutFile.Write(buf, 0, 64);
                    }

                    layoutFile.SetLength(layoutFile.Length - 64);

                    // Shift each dungeon's "FirstLayoutIndex" to match the shifted layouts.
                    for (int i = 0; i < Project.GetNumDungeons(); i++)
                    {
                        Dungeon d2 = Project.GetIndexedDataType <Dungeon>(i);
                        if (d2.FirstLayoutIndex > deletedFloorIndex)
                        {
                            d2.FirstLayoutIndex--;
                        }
                    }

                    dungeon.NumFloors = dungeon.NumFloors - 1;

                    DungeonChanged();
                }
            };
            tmpAlign = new Gtk.Alignment(0.5f, 0, 0, 0);
            tmpAlign.Add(removeFloorButton);
            tmpBox.PackStart(tmpAlign);

            hbox.PackStart(tmpBox);

            // Middle column (minimap)

            minimap = new Minimap();
            minimap.TileSelectedEvent += (sender) => {
                RoomChanged();
            };

            hbox.PackStart(minimap);

            // Rightmost column

            tmpAlign = new Alignment(0, 0, 0, 0);
            tmpAlign.Add(roomVreContainer);

            tmpBox2 = new HBox();
            tmpBox2.Add(new Gtk.Label("Room "));
            roomSpinButton.ValueChanged += (a, b) => {
                (minimap.Map as Dungeon).SetRoom(minimap.SelectedX, minimap.SelectedY,
                                                 minimap.Floor, roomSpinButton.ValueAsInt);
                minimap.GenerateImage();
                RoomChanged();
            };
            tmpBox2.Add(roomSpinButton);

            tmpBox = new VBox();
            tmpBox.Add(tmpBox2);
            tmpBox.Add(tmpAlign);

            hbox.PackStart(tmpBox);



            Window w = new Window(null);

            w.Add(frame);
            w.ShowAll();

            Map map = manager.GetActiveMap();

            if (map is Dungeon)
            {
                dungeonSpinButton.Value = map.Index;
            }

            DungeonChanged();
        }
Ejemplo n.º 46
0
        private void BuildUI()
        {
            // The BorderWidth situation here is a bit nuts b/c the
            // ActionArea's is set to 5.  So we work everything else out
            // so it all totals to 12.
            //
            // WIDGET           BorderWidth
            // Dialog           5
            //   VBox           2
            //     inner_vbox   5 => total = 12
            //     ActionArea   5 => total = 12
            BorderWidth           = 5;
            base.VBox.BorderWidth = 0;

            // This spacing is 2 b/c the inner_vbox and ActionArea should be
            // 12 apart, and they already have BorderWidth 5 each
            base.VBox.Spacing = 2;

            inner_vbox = new VBox()
            {
                Spacing = 12, BorderWidth = 5, Visible = true
            };
            base.VBox.PackStart(inner_vbox, true, true, 0);

            Visible      = false;
            HasSeparator = false;

            var table = new Table(3, 2, false)
            {
                RowSpacing    = 12,
                ColumnSpacing = 16
            };

            table.Attach(new Image()
            {
                IconName = "dialog-error",
                IconSize = (int)IconSize.Dialog,
                Yalign   = 0.0f
            }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach(header_label = new Label()
            {
                Xalign = 0.0f
            }, 1, 2, 0, 1,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Shrink, 0, 0);

            table.Attach(message_label = new Hyena.Widgets.WrapLabel(), 1, 2, 1, 2,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow()
            {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType       = ShadowType.In
            };

            list_view = new TreeView()
            {
                HeightRequest = 120,
                WidthRequest  = 200
            };
            scrolled_window.Add(list_view);

            table.Attach(details_expander = new Expander(Catalog.GetString("Details")),
                         1, 2, 2, 3,
                         AttachOptions.Fill | AttachOptions.Expand,
                         AttachOptions.Fill | AttachOptions.Expand,
                         0, 0);
            details_expander.Add(scrolled_window);

            VBox.PackStart(table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll();

            accel_group = new AccelGroup();
            AddAccelGroup(accel_group);

            Button button = new Button(Stock.Close);

            button.CanDefault = true;
            button.UseStock   = true;
            button.Show();
            button.Clicked += (o, a) => {
                Destroy();
            };

            AddActionWidget(button, ResponseType.Close);

            DefaultResponse = ResponseType.Close;
            button.AddAccelerator("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);
        }
        private void BuildWindow()
        {
            BorderWidth       = 5;
            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();

            box.BorderWidth = 5;
            box.Spacing     = 15;

            Image image = new Image(Stock.Network, IconSize.Dialog);

            image.Yalign = 0.2f;
            box.PackStart(image, false, false, 0);

            VBox content_box = new VBox();

            content_box.Spacing = 12;

            Label header = new Label();

            header.Markup = "<big><b>" + GLib.Markup.EscapeText(Catalog.GetString(
                                                                    "Authentication Required")) + "</b></big>";
            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.5f);

            Label message = new Label(Catalog.GetString(String.Format(
                                                            "Please provide login information to access {0}.", share_name)));

            message.Wrap    = true;
            message.Justify = Justification.Left;
            message.SetAlignment(0.0f, 0.5f);

            content_box.PackStart(header, false, false, 0);
            content_box.PackStart(message, false, false, 0);

            username_entry            = new Entry();
            password_entry            = new Entry();
            password_entry.Visibility = false;

            uint yoff = show_username ? (uint)0 : (uint)1;

            Table table = new Table(2, 2, false);

            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;

            if (show_username)
            {
                table.Attach(new Label(Catalog.GetString("Username:"******"Password:"******"Login"), ResponseType.Ok, true);

            box.ShowAll();
            VBox.Add(box);
        }
        protected virtual void Build()
        {
            MonoDevelop.Components.Gui.Initialize(this);
            // Widget MonoDevelop.VersionControl.Views.LogWidget
            var w1 = MonoDevelop.Components.BinContainer.Attach(this);

            this.UIManager = new global::Gtk.UIManager();
            global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup("Default");
            this.UIManager.InsertActionGroup(w2, 0);
            this.Name = "MonoDevelop.VersionControl.Views.LogWidget";
            // Container child MonoDevelop.VersionControl.Views.LogWidget.Gtk.Container+ContainerChild
            this.vbox1         = new global::Gtk.VBox();
            this.vbox1.Name    = "vbox1";
            this.vbox1.Spacing = 6;
            // Container child vbox1.Gtk.Box+BoxChild
            this.vpaned1          = new global::Gtk.VPaned();
            this.vpaned1.CanFocus = true;
            this.vpaned1.Name     = "vpaned1";
            this.vpaned1.Position = 204;
            // Container child vpaned1.Gtk.Paned+PanedChild
            this.hpaned1          = new global::Gtk.HPaned();
            this.hpaned1.CanFocus = true;
            this.hpaned1.Name     = "hpaned1";
            this.hpaned1.Position = 236;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.vbox4         = new global::Gtk.VBox();
            this.vbox4.Name    = "vbox4";
            this.vbox4.Spacing = 6;
            // Container child vbox4.Gtk.Box+BoxChild
            this.scrolledLoading          = new global::Gtk.ScrolledWindow();
            this.scrolledLoading.CanFocus = true;
            this.scrolledLoading.Name     = "scrolledLoading";
            // Container child scrolledLoading.Gtk.Container+ContainerChild
            global::Gtk.Viewport w3 = new global::Gtk.Viewport();
            w3.ShadowType = ((global::Gtk.ShadowType)(0));
            // Container child GtkViewport1.Gtk.Container+ContainerChild
            this.label3           = new global::Gtk.Label();
            this.label3.Name      = "label3";
            this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Loading...");
            w3.Add(this.label3);
            this.scrolledLoading.Add(w3);
            this.vbox4.Add(this.scrolledLoading);
            global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledLoading]));
            w6.Position = 0;
            // Container child vbox4.Gtk.Box+BoxChild
            this.scrolledLog      = new global::Gtk.ScrolledWindow();
            this.scrolledLog.Name = "scrolledLog";
            // Container child scrolledLog.Gtk.Container+ContainerChild
            this.treeviewLog          = new global::Gtk.TreeView();
            this.treeviewLog.CanFocus = true;
            this.treeviewLog.Name     = "treeviewLog";
            this.scrolledLog.Add(this.treeviewLog);
            this.vbox4.Add(this.scrolledLog);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledLog]));
            w8.Position = 1;
            this.hpaned1.Add(this.vbox4);
            global::Gtk.Paned.PanedChild w9 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vbox4]));
            w9.Resize = false;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.vbox2      = new global::Gtk.VBox();
            this.vbox2.Name = "vbox2";
            // Container child vbox2.Gtk.Box+BoxChild
            this.commitBox      = new global::Gtk.EventBox();
            this.commitBox.Name = "commitBox";
            // Container child commitBox.Gtk.Container+ContainerChild
            this.hbox1             = new global::Gtk.HBox();
            this.hbox1.Name        = "hbox1";
            this.hbox1.Spacing     = 6;
            this.hbox1.BorderWidth = ((uint)(8));
            // Container child hbox1.Gtk.Box+BoxChild
            this.imageUser = new global::Gtk.Image();
            this.imageUser.WidthRequest  = 32;
            this.imageUser.HeightRequest = 32;
            this.imageUser.Name          = "imageUser";
            this.hbox1.Add(this.imageUser);
            global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.imageUser]));
            w10.Position = 0;
            w10.Expand   = false;
            w10.Fill     = false;
            // Container child hbox1.Gtk.Box+BoxChild
            this.vbox5         = new global::Gtk.VBox();
            this.vbox5.Name    = "vbox5";
            this.vbox5.Spacing = 6;
            // Container child vbox5.Gtk.Box+BoxChild
            this.hbox2         = new global::Gtk.HBox();
            this.hbox2.Name    = "hbox2";
            this.hbox2.Spacing = 6;
            // Container child hbox2.Gtk.Box+BoxChild
            this.labelAuthor            = new global::Gtk.Label();
            this.labelAuthor.Name       = "labelAuthor";
            this.labelAuthor.Xalign     = 0F;
            this.labelAuthor.LabelProp  = global::Mono.Unix.Catalog.GetString("Author");
            this.labelAuthor.Selectable = true;
            this.hbox2.Add(this.labelAuthor);
            global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.labelAuthor]));
            w11.Position = 0;
            w11.Expand   = false;
            w11.Fill     = false;
            // Container child hbox2.Gtk.Box+BoxChild
            this.labelRevision            = new global::Gtk.Label();
            this.labelRevision.Name       = "labelRevision";
            this.labelRevision.Xalign     = 1F;
            this.labelRevision.LabelProp  = global::Mono.Unix.Catalog.GetString("Revision");
            this.labelRevision.Selectable = true;
            this.hbox2.Add(this.labelRevision);
            global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.labelRevision]));
            w12.Position = 1;
            this.vbox5.Add(this.hbox2);
            global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox2]));
            w13.Position = 0;
            w13.Expand   = false;
            w13.Fill     = false;
            // Container child vbox5.Gtk.Box+BoxChild
            this.labelDate            = new global::Gtk.Label();
            this.labelDate.Name       = "labelDate";
            this.labelDate.Xalign     = 0F;
            this.labelDate.LabelProp  = global::Mono.Unix.Catalog.GetString("Date");
            this.labelDate.Selectable = true;
            this.vbox5.Add(this.labelDate);
            global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelDate]));
            w14.Position = 1;
            w14.Expand   = false;
            w14.Fill     = false;
            this.hbox1.Add(this.vbox5);
            global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox5]));
            w15.Position = 1;
            this.commitBox.Add(this.hbox1);
            this.vbox2.Add(this.commitBox);
            global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.commitBox]));
            w17.Position = 0;
            w17.Expand   = false;
            w17.Fill     = false;
            // Container child vbox2.Gtk.Box+BoxChild
            this.scrolledwindow1          = new global::Gtk.ScrolledWindow();
            this.scrolledwindow1.CanFocus = true;
            this.scrolledwindow1.Name     = "scrolledwindow1";
            // Container child scrolledwindow1.Gtk.Container+ContainerChild
            this.textviewDetails          = new global::Gtk.TextView();
            this.textviewDetails.CanFocus = true;
            this.textviewDetails.Name     = "textviewDetails";
            this.textviewDetails.Editable = false;
            this.scrolledwindow1.Add(this.textviewDetails);
            this.vbox2.Add(this.scrolledwindow1);
            global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1]));
            w19.Position = 1;
            this.hpaned1.Add(this.vbox2);
            this.vpaned1.Add(this.hpaned1);
            global::Gtk.Paned.PanedChild w21 = ((global::Gtk.Paned.PanedChild)(this.vpaned1 [this.hpaned1]));
            w21.Resize = false;
            // Container child vpaned1.Gtk.Paned+PanedChild
            this.scrolledwindowFiles          = new global::Gtk.ScrolledWindow();
            this.scrolledwindowFiles.CanFocus = true;
            this.scrolledwindowFiles.Name     = "scrolledwindowFiles";
            this.fileHPaned          = new HPaned();
            this.fileHPaned.Position = 333;

            fileHPaned.Add(this.scrolledwindowFiles);
            vboxFileContents         = new VBox();
            labelFilePathName.Xalign = 0f;
            vboxFileContents.PackStart(labelFilePathName, false, true, 6);
            vboxFileContents.PackStart(scrolledwindowFileContents, true, true, 0);
            fileHPaned.Add(vboxFileContents);

            this.vpaned1.Add(fileHPaned);
            this.vbox1.Add(this.vpaned1);
            global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.vpaned1]));
            w23.Position = 0;
            this.Add(this.vbox1);
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            w1.SetUiManager(UIManager);
            this.scrolledLoading.Hide();
            this.Show();
        }
Ejemplo n.º 49
0
        public ConfigForm(Window parent) : base("設定")
        {
            TransientFor = parent;
            SetPosition(WindowPosition.CenterOnParent);

            var table = new Table(6, 2, false)
            {
                ColumnSpacing = 10,
                RowSpacing    = 10
            };

            table.Attach(new Label("DBファイラー")
            {
                Xalign = 1, WidthRequest = 130
            }, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            table.Attach(new Label("ヒントスピード(秒)")
            {
                Xalign = 1, WidthRequest = 130
            }, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            table.Attach(new Label("オートモードスピード(ミリ秒)")
            {
                Xalign = 1, WidthRequest = 130
            }, 0, 1, 4, 5, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            table.Attach(new Label("ゲームモード")
            {
                Xalign = 1, WidthRequest = 130
            }, 0, 1, 5, 6, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            var hbox = new HBox();

            hbox.PackStart(_dbDirectoryEntry, true, true, 0);
            hbox.PackStart(_dbDirectoryBrowse, false, false, 0);
            table.Attach(hbox, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            _dbDirectoryEntry.Text      = _configuration.StorageDir;
            _dbDirectoryBrowse.Clicked += DbDirectoryBrowseOnClicked;
            table.Attach(_showHint, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            _showHint.Active   = _configuration.ShowHint;
            _showHint.Toggled += ShowHintOnToggled;

            _hintScale.Sensitive = _configuration.ShowHint;
            _hintScale.Value     = _configuration.HintSpeed;
            table.Attach(_hintScale, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            table.Attach(_autoMode, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            _autoMode.Active   = _configuration.AutoMode;
            _autoMode.Toggled += AutoModeOnToggled;

            _autoModeScale.Sensitive = _configuration.AutoMode;
            _autoModeScale.Value     = _configuration.AutoModeSpeed;
            table.Attach(_autoModeScale, 1, 2, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            _simpleRadio = new RadioButton(_simpleRadio, GameMode.Simple.Label());
            _guessRadio  = new RadioButton(_simpleRadio, GameMode.GuessMode.Label());
            _inputRadio  = new RadioButton(_simpleRadio, GameMode.InputMode.Label())
            {
                Sensitive = false
            };

            _simpleRadio.Toggled += SimpleRadioOnToggled;
            _guessRadio.Toggled  += SimpleRadioOnToggled;
            _inputRadio.Toggled  += SimpleRadioOnToggled;

            switch (_configuration.GameMode)
            {
            case GameMode.Simple:
                _simpleRadio.Active = true;
                break;

            case GameMode.GuessMode:
                _guessRadio.Active = true;
                break;

            case GameMode.InputMode:
                _inputRadio.Active = true;
                break;
            }

            var gameModeHBox = new HBox(false, 20);
            var gameModeVBox = new VBox();

            gameModeVBox.PackStart(_simpleRadio, false, false, 0);
            gameModeVBox.PackStart(_guessRadio, false, false, 0);
            gameModeVBox.PackStart(_inputRadio, false, false, 0);
            gameModeHBox.PackStart(gameModeVBox, false, false, 0);

            var gameModeVBox2 = new VBox();

            _questionCombobox        = new ComboBox(TangoTypeUtil.LabelList());
            _questionCombobox.Active = _configuration.QuestionType.Index();
            gameModeVBox2.PackStart(new Label("質問")
            {
                Xalign = 0
            }, false, false, 0);
            gameModeVBox2.PackStart(_questionCombobox, false, false, 0);
            gameModeHBox.PackStart(gameModeVBox2, false, false, 0);

            var gameModeVBox3 = new VBox();

            _answerCombobox        = new ComboBox(TangoTypeUtil.LabelList());
            _answerCombobox.Active = _configuration.AnswerType.Index();
            gameModeVBox3.PackStart(new Label("回答")
            {
                Xalign = 0
            }, false, false, 0);
            gameModeVBox3.PackStart(_answerCombobox, false, false, 0);
            gameModeHBox.PackStart(gameModeVBox3, false, false, 0);

            table.Attach(gameModeHBox, 1, 2, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            _mainVerticalBox.PackStart(table, false, false, 0);
            _mainVerticalBox.PackStart(new HSeparator(), false, true, 5);

            var hbbox = new HButtonBox {
                Layout = ButtonBoxStyle.End, Spacing = 10
            };

            hbbox.PackStart(_confirmButton);
            hbbox.PackStart(_cancelButton);;
            _confirmButton.Clicked += ConfirmButtonOnClicked;
            _cancelButton.Clicked  += CancelButtonOnClicked;
            _mainVerticalBox.PackStart(hbbox);

            Add(_mainVerticalBox);
            ShowAll();
        }
        void SetLayout()
        {
            var vbox = new VBox();

            vbox.MinWidth = 450;

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

            var breakpointActionGroup = new VBox {
                MarginLeft = 12
            };

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

            var printExpressionGroup = new HBox {
                MarginLeft = 18
            };

            printExpressionGroup.PackStart(entryPrintExpression, true);
            printExpressionGroup.PackStart(warningPrintExpression);
            breakpointActionGroup.PackStart(printExpressionGroup);

            breakpointActionGroup.PackEnd(printMessageTip);

            vbox.PackStart(breakpointActionGroup);

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

            var whenToTakeActionRadioGroup = new VBox {
                MarginLeft = 12
            };

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

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

                whenToTakeActionRadioGroup.PackStart(hboxFunction);
            }

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

                hboxException = new HBox();
                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);

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

            var vboxAdvancedConditions = new VBox {
                MarginLeft = 30
            };
            var hboxHitCount = new HBox();

            hboxHitCount.PackStart(ignoreHitType, true);
            hboxHitCount.PackStart(ignoreHitCount);
            vboxAdvancedConditions.PackStart(hboxHitCount);

            vboxAdvancedConditions.PackStart(conditionalHitType);
            hboxCondition = new HBox();
            hboxCondition.PackStart(entryConditionalExpression, true);
            hboxCondition.PackStart(warningCondition);
            vboxAdvancedConditions.PackStart(hboxCondition);
            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);
        }
Ejemplo n.º 51
0
        void Build()
        {
            DefaultWidth  = 470;
            DefaultHeight = 380;
            BorderWidth   = 6;
            Resizable     = false;

            VBox.Spacing = 6;

            buttonCancel = new Button(Gtk.Stock.Cancel);
            AddActionWidget(buttonCancel, ResponseType.Cancel);
            buttonOk = new Button(Gtk.Stock.Ok);
            AddActionWidget(buttonOk, ResponseType.Ok);

            var table = new Table(3, 2, false)
            {
                ColumnSpacing = 6, RowSpacing = 6
            };

            nameEntry = new Entry {
                WidthRequest = 350
            };
            viewEngineCombo = ComboBox.NewText();
            templateCombo   = ComboBox.NewText();

            var nameLabel = new Label(GettextCatalog.GetString("_Name"))
            {
                MnemonicWidget = nameEntry,
                Xalign         = 0
            };
            var templateLabel = new Label(GettextCatalog.GetString("_Template:"))
            {
                MnemonicWidget = nameEntry,
                Xalign         = 0
            };
            var engineLabel = new Label(GettextCatalog.GetString("_View Engine:"))
            {
                MnemonicWidget = nameEntry,
                Xalign         = 0
            };

            const AttachOptions expandFill = AttachOptions.Expand | AttachOptions.Fill;
            const AttachOptions fill       = AttachOptions.Fill;

            table.Attach(nameLabel, 0, 1, 0, 1, fill, 0, 0, 0);
            table.Attach(nameEntry, 1, 2, 0, 1, expandFill, 0, 0, 0);
            table.Attach(templateLabel, 0, 1, 1, 2, fill, 0, 0, 0);
            table.Attach(templateCombo, 1, 2, 1, 2, expandFill, 0, 0, 0);
            table.Attach(engineLabel, 0, 1, 2, 3, fill, 0, 0, 0);
            table.Attach(viewEngineCombo, 1, 2, 2, 3, expandFill, 0, 0, 0);

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

            var frame = new Frame(GettextCatalog.GetString("Options"))
            {
                BorderWidth = 2
            };
            var optionsVBox = new VBox {
                Spacing = 6
            };
            var optionsAlignment = new Alignment(0.5f, 0.5f, 1f, 1f)
            {
                Child         = optionsVBox,
                TopPadding    = 4,
                BottomPadding = 4,
                RightPadding  = 4,
                LeftPadding   = 4
            };

            frame.Add(optionsAlignment);

            partialCheck = new CheckButton(GettextCatalog.GetString("_Partial view"))
            {
                UseUnderline = true
            };
            stronglyTypedCheck = new CheckButton(GettextCatalog.GetString("_Strongly typed"))
            {
                UseUnderline = true
            };
            masterCheck = new CheckButton(GettextCatalog.GetString("Has _master page or layout"))
            {
                UseUnderline = true
            };

            dataClassCombo = ComboBoxEntry.NewText();
            masterEntry    = new Entry {
                WidthRequest = 250
            };
            placeholderCombo = ComboBoxEntry.NewText();
            masterButton     = new Button("...");

            optionsVBox.PackStart(partialCheck);
            optionsVBox.PackStart(stronglyTypedCheck);
            typePanel = WithLabelAndLeftPadding(dataClassCombo, GettextCatalog.GetString("_Data class:"), true, 24);
            optionsVBox.PackStart(typePanel);
            optionsVBox.PackStart(masterCheck);


            var masterLabel = new Label(GettextCatalog.GetString("_File:"))
            {
                MnemonicWidget = masterEntry,
                Xalign         = 0,
                UseUnderline   = true
            };

            placeholderLabel = new Label(GettextCatalog.GetString("P_rimary placeholder:"))
            {
                MnemonicWidget = placeholderCombo,
                Xalign         = 0,
                UseUnderline   = true
            };

            var masterTable = new Table(2, 3, false)
            {
                RowSpacing = 6, ColumnSpacing = 6
            };

            masterTable.Attach(masterLabel, 0, 1, 0, 1, fill, 0, 0, 0);
            masterTable.Attach(masterEntry, 1, 3, 0, 1, expandFill, 0, 0, 0);
            masterTable.Attach(placeholderLabel, 0, 1, 1, 2, expandFill, 0, 0, 0);
            masterTable.Attach(placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0);
            masterTable.Attach(masterButton, 2, 3, 1, 2, fill, 0, 0, 0);

            masterPanel = new Alignment(0.5f, 0.5f, 1f, 1f)
            {
                LeftPadding = 24, Child = masterTable
            };
            optionsVBox.PackStart(masterPanel);

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

            Child.ShowAll();

            viewEngineCombo.Changed    += ViewEngineChanged;
            templateCombo.Changed      += Validate;
            nameEntry.Changed          += Validate;
            partialCheck.Toggled       += UpdateMasterPanelSensitivity;
            stronglyTypedCheck.Toggled += UpdateTypePanelSensitivity;
            dataClassCombo.Changed     += DataClassChanged;
            masterCheck.Toggled        += UpdateMasterPanelSensitivity;
            masterEntry.Changed        += MasterChanged;
            masterButton.Clicked       += ShowMasterSelectionDialog;
            placeholderCombo.Changed   += Validate;
        }
Ejemplo n.º 52
0
        private void CreateAbout()
        {
            Label version = new Label()
            {
                Markup = string.Format("<span font_size='small' fgcolor='white'>version {0}</span>",
                                       Controller.RunningVersion),
                Xalign = 0,
                Xpad   = 300
            };

            this.updates = new Label()
            {
                Markup = "<span font_size='small' fgcolor='#729fcf'>Checking for updates...</span>",
                Xalign = 0,
                Xpad   = 300
            };

            Label copyright = new Label()
            {
                Markup = "<span font_size='small' fgcolor='white'>" +
                         "Copyright © 2010–" + DateTime.Now.Year + " " +
                         "Hylke Bons and others." +
                         "</span>",
                Xalign = 0,
                Xpad   = 300
            };

            Label license = new Label()
            {
                LineWrap     = true,
                LineWrapMode = Pango.WrapMode.Word,
                Markup       = "<span font_size='small' fgcolor='white'>" +
                               "SparkleShare Open Source software. You are free to use, modify, " +
                               "and redistribute it under the GNU General Public License version 3 or later." +
                               "</span>",
                WidthRequest = 330,
                Wrap         = true,
                Xalign       = 0,
                Xpad         = 300,
            };

            VBox layout_vertical = new VBox(false, 0)
            {
                BorderWidth   = 0,
                HeightRequest = 260,
                WidthRequest  = 640
            };

            HBox links_layout = new HBox(false, 6);

            SparkleLink website_link        = new SparkleLink("Website", Controller.WebsiteLinkAddress);
            SparkleLink credits_link        = new SparkleLink("Credits", Controller.CreditsLinkAddress);
            SparkleLink report_problem_link = new SparkleLink("Report a problem", Controller.ReportProblemLinkAddress);
            SparkleLink debug_log_link      = new SparkleLink("Debug log", Controller.DebugLogLinkAddress);

            links_layout.PackStart(new Label(""), false, false, 143);
            links_layout.PackStart(website_link, false, false, 9);
            links_layout.PackStart(credits_link, false, false, 9);
            links_layout.PackStart(report_problem_link, false, false, 9);
            links_layout.PackStart(debug_log_link, false, false, 9);

            layout_vertical.PackStart(new Label(""), false, false, 42);
            layout_vertical.PackStart(version, false, false, 0);
            layout_vertical.PackStart(this.updates, false, false, 0);
            layout_vertical.PackStart(copyright, false, false, 9);
            layout_vertical.PackStart(license, false, false, 0);
            layout_vertical.PackStart(links_layout, false, false, 12);

            Add(layout_vertical);
        }
Ejemplo n.º 53
0
        public AutoHideBox(DockFrame frame, DockItem item, Gtk.PositionType pos, int size)
        {
            this.position   = pos;
            this.frame      = frame;
            this.targetSize = size;
            horiz           = pos == PositionType.Left || pos == PositionType.Right;
            startPos        = pos == PositionType.Top || pos == PositionType.Left;
            Events          = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;

            Box         fr;
            CustomFrame cframe = new CustomFrame();

            switch (pos)
            {
            case PositionType.Left: cframe.SetMargins(0, 0, 1, 1); break;

            case PositionType.Right: cframe.SetMargins(0, 0, 1, 1); break;

            case PositionType.Top: cframe.SetMargins(1, 1, 0, 0); break;

            case PositionType.Bottom: cframe.SetMargins(1, 1, 0, 0); break;
            }
            EventBox sepBox = new EventBox();

            cframe.Add(sepBox);

            if (horiz)
            {
                fr = new HBox();
                sepBox.Realized    += delegate { sepBox.GdkWindow.Cursor = resizeCursorW; };
                sepBox.WidthRequest = gripSize;
            }
            else
            {
                fr = new VBox();
                sepBox.Realized     += delegate { sepBox.GdkWindow.Cursor = resizeCursorH; };
                sepBox.HeightRequest = gripSize;
            }

            sepBox.Events = EventMask.AllEventsMask;

            if (pos == PositionType.Left || pos == PositionType.Top)
            {
                fr.PackEnd(cframe, false, false, 0);
            }
            else
            {
                fr.PackStart(cframe, false, false, 0);
            }

            Add(fr);
            ShowAll();
            Hide();

#if ANIMATE_DOCKING
            scrollable            = new ScrollableContainer();
            scrollable.ScrollMode = false;
            scrollable.Show();
#endif
            VBox itemBox = new VBox();
            itemBox.Show();
            item.TitleTab.Active = true;
            itemBox.PackStart(item.TitleTab, false, false, 0);
            itemBox.PackStart(item.Widget, true, true, 0);

            item.Widget.Show();
#if ANIMATE_DOCKING
            scrollable.Add(itemBox);
            fr.PackStart(scrollable, true, true, 0);
#else
            fr.PackStart(itemBox, true, true, 0);
#endif

            sepBox.ButtonPressEvent   += OnSizeButtonPress;
            sepBox.ButtonReleaseEvent += OnSizeButtonRelease;
            sepBox.MotionNotifyEvent  += OnSizeMotion;
            sepBox.ExposeEvent        += OnGripExpose;
            sepBox.EnterNotifyEvent   += delegate { insideGrip = true; sepBox.QueueDraw(); };
            sepBox.LeaveNotifyEvent   += delegate { insideGrip = false; sepBox.QueueDraw(); };
        }
Ejemplo n.º 54
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        // Make fullscreen and centered
        SetDefaultSize(Screen.Width, Screen.Height);
        SetPosition(WindowPosition.Center);

        //Create vbox to hold UI
        VBox vbox = new VBox(false, 2);

        // Create menu bar
        Toolbar menu = new Toolbar();

        menu.ToolbarStyle = ToolbarStyle.Icons;

        //Make menu items
        ToolButton newBtn = new ToolButton(Stock.New);

        newBtn.TooltipText = "Create a new program";
        newBtn.Clicked    += NewBtnClicked;

        ToolButton saveBtn = new ToolButton(Stock.Save);

        saveBtn.TooltipText = "Save the program";
        saveBtn.Clicked    += SaveBtnClicked;

        ToolButton openBtn = new ToolButton(Stock.Open);

        openBtn.TooltipText = "Open a program";
        openBtn.Clicked    += OpenBtnClicked;

        ToolButton runBtn = new ToolButton(Stock.MediaPlay);

        runBtn.TooltipText = "Run the program";
        runBtn.Clicked    += RunBtnClicked;

        ToolButton nlpLexerSwitchBtn = new ToolButton(Stock.DialogWarning); // NLP Lexer button displayed with warning as it's experimental

        nlpLexerSwitchBtn.TooltipText = "Toggle the experimental NLP lexer";
        nlpLexerSwitchBtn.Clicked    += nlpLexerSwitchBtnClicked;

        ToolButton parseTreeSwitchBtn = new ToolButton(Stock.Indent);

        parseTreeSwitchBtn.TooltipText = "Toggle the Parse Tree display";
        parseTreeSwitchBtn.Clicked    += ParseTreeSwitchBtnClicked;


        //Add menu items to menu bar
        menu.Insert(newBtn, 0);
        menu.Insert(openBtn, 1);
        menu.Insert(saveBtn, 2);
        menu.Insert(runBtn, 3);
        menu.Insert(new SeparatorToolItem(), 4); // Seperate NLP toggle and parse tree toggle from other buttons
        menu.Insert(nlpLexerSwitchBtn, 5);
        menu.Insert(parseTreeSwitchBtn, 5);
        menu.ShowAll();



        //Create TextView
        var editorWindow = new ScrolledWindow(); // Make TextView Scrollable

        editor = new TextView();
        int editorWidth  = this.editor.SizeRequest().Width + 10;
        int editorHeight = this.editor.SizeRequest().Height + 10;

        editor.BorderWidth = 10;
        editor.ModifyBg(StateType.Normal, new Gdk.Color(249, 249, 249));
        editorWindow.Add(editor);


        // Add menu to top of screen
        vbox.PackStart(menu, false, false, 0);

        vbox.SetSizeRequest(editorWidth, editorHeight);

        // Add editor to vbox
        vbox.Add(editorWindow);

        //Add info view to bottom of window
        vbox.PackEnd(this.infoTextView, false, false, 0);
        this.infoTextView.Visible = true; // Make sure info view is visible

        // Add vbox to window
        Add(vbox);

        // Display all children
        ShowAll();
    }
Ejemplo n.º 55
0
        protected virtual void AddNewsItem(VBox box, Gtk.Widget newsItem)
        {
            box.PackStart(newsItem, true, false, 0);

            SetTitledWidget(newsItem);
        }
Ejemplo n.º 56
0
        public ModelDetailsWrapperView(ViewBase owner) : base(owner)
        {
            hbox  = new HBox();
            vbox1 = new VBox();

            modelTypeLabel = new Label
            {
                Xalign = 0.0f,
                Xpad   = 3
            };
            Pango.FontDescription font = new Pango.FontDescription
            {
                Size   = Convert.ToInt32(16 * Pango.Scale.PangoScale, CultureInfo.InvariantCulture),
                Weight = Pango.Weight.Semibold
            };
            modelTypeLabel.ModifyFont(font);

            modelDescriptionLabel = new Label()
            {
                Xalign = 0.0f,
                Xpad   = 4
            };
            modelDescriptionLabel.LineWrapMode = Pango.WrapMode.Word;
            modelDescriptionLabel.Wrap         = true;
            modelDescriptionLabel.ModifyBg(StateType.Normal, new Gdk.Color(131, 0, 131));

            modelHelpLinkLabel = new LinkButton("", "")
            {
                Xalign = 0.0f,
            };
            modelHelpLinkLabel.Clicked += ModelHelpLinkLabel_Clicked;
            modelHelpLinkLabel.ModifyBase(StateType.Normal, new Gdk.Color(131, 0, 131));
            modelHelpLinkLabel.Visible = false;

            Gtk.CellRendererPixbuf pixbufRender = new CellRendererPixbuf();
            pixbufRender.Pixbuf = new Gdk.Pixbuf(null, "ApsimNG.Resources.MenuImages.Help.png");
            pixbufRender.Xalign = 0.5f;
            Gtk.Image img = new Image(pixbufRender.Pixbuf);
            modelHelpLinkLabel.Image         = img;
            modelHelpLinkLabel.Image.Visible = true;

            modelVersionLabel = new Label()
            {
                Xalign = 0.0f,
                Xpad   = 4
            };
            font = new Pango.FontDescription
            {
                Size   = Convert.ToInt32(8 * Pango.Scale.PangoScale, CultureInfo.InvariantCulture),
                Weight = Pango.Weight.Normal,
            };
            modelVersionLabel.ModifyFont(font);
            modelVersionLabel.ModifyFg(StateType.Normal, new Gdk.Color(150, 150, 150));
            modelVersionLabel.LineWrapMode = Pango.WrapMode.Word;
            modelVersionLabel.Wrap         = true;
            modelVersionLabel.ModifyBg(StateType.Normal, new Gdk.Color(131, 0, 131));

            bottomView = new Viewport
            {
                ShadowType = ShadowType.None
            };

            hbox.PackStart(modelTypeLabel, false, true, 0);
            hbox.PackStart(modelHelpLinkLabel, false, false, 0);

            vbox1.PackStart(hbox, false, true, 0);
            vbox1.PackStart(modelTypeLabel, false, true, 0);
            vbox1.PackStart(modelDescriptionLabel, false, true, 0);
            vbox1.PackStart(modelVersionLabel, false, true, 4);
            vbox1.Add(bottomView);
            vbox1.SizeAllocated += Vbox1_SizeAllocated;

            mainWidget            = vbox1;
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 57
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            testChangedHandler            = (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnDetailsTestChanged));
            testService.TestSuiteChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnTestSuiteChanged));
            paned = new VPaned();

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

            buttonRunAll             = new Button(new Gtk.Image(Gtk.Stock.GoUp, IconSize.Menu));
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonRun             = new Button(new Gtk.Image(Gtk.Stock.Execute, IconSize.Menu));
            buttonRun.Clicked    += new EventHandler(OnRunClicked);
            buttonRun.Sensitive   = true;
            buttonRun.TooltipText = GettextCatalog.GetString("Run test");
            topToolbar.Add(buttonRun);

            buttonStop             = new Button(new Gtk.Image(Gtk.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked    += new EventHandler(OnStopClicked);
            buttonStop.Sensitive   = false;
            buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test");
            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 Gtk.Image("gtk-close", IconSize.SmallToolbar));

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

            hb          = new Button(new Gtk.Image("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.ButtonPressEvent += OnChartButtonPress;
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);
            chart.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();

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new Gtk.Image(CircleImage.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 Gtk.Image(CircleImage.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 Gtk.Image(CircleImage.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();
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf));

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

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 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(Pixbuf));

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

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 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 testService.RootTests)
            {
                TreeView.AddChild(t);
            }
        }
Ejemplo n.º 58
0
        private void InitUI()
        {
            try
            {
                //Get XpoObject Reference from DataSourceRow
                //Template dataSourceRow = (DataSourceRow as Template);

                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), entryDesignation);
                vboxTab1.PackStart(boxDesignation, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxDesignation, _dataSourceRow, "Designation", SettingsApp.RegexAlfaNumericExtended, true));

                //Disabled
                CheckButton checkButtonDisabled = new CheckButton(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                /* Tab2 Sample
                 *
                 * //Tab2
                 * VBox vboxTab2 = new VBox(false, _boxSpacing) { BorderWidth = (uint)_boxSpacing };
                 *
                 * //Notes
                 * Entry entryNotes = new Entry();
                 * BOWidgetBox boxNotes = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"), entryNotes);
                 * vboxTab2.PackStart(boxNotes, false, false, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxNotes, _dataSourceRow, "Notes", SettingsApp.RegexAlfa, false));
                 *
                 * //CreatedAt
                 * Entry entryCreatedAt = new Entry() { WidthRequest = 250 };
                 * BOWidgetBox boxCreatedAt = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), entryCreatedAt);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedAt, _dataSourceRow, "CreatedAt", SettingsApp.RegexDateTime, false));
                 *
                 * //UpdatedAt
                 * Entry entryUpdatedAt = new Entry();
                 * BOWidgetBox boxUpdatedAt = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_date"), entryUpdatedAt);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxUpdatedAt, _dataSourceRow, "UpdatedAt", SettingsApp.RegexDateTime, false));
                 *
                 * //Hbox CreatedAt and UpdatedAt
                 * HBox hboxCreatedAtAndUpdatedAt = new HBox(false, _boxSpacing);
                 * hboxCreatedAtAndUpdatedAt.PackStart(boxCreatedAt, true, true, 0);
                 * hboxCreatedAtAndUpdatedAt.PackStart(boxUpdatedAt, true, true, 0);
                 * vboxTab2.PackStart(hboxCreatedAtAndUpdatedAt, false, false, 0);
                 *
                 * //CreatedBy
                 * XPOComboBox xpoComboBoxCreatedBy = new XPOComboBox(DataSourceRow.Session, typeof(sys_userdetail), (DataSourceRow as fin_articleclass).CreatedBy, "Name") { WidthRequest = 250 };
                 * BOWidgetBox boxCreatedBy = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_user, xpoComboBoxCreatedBy);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedBy, DataSourceRow, "CreatedBy", SettingsApp.RegexGuid, true));
                 *
                 * //CreatedWhere
                 * XPOComboBox xpoComboBoxCreatedWhere = new XPOComboBox(DataSourceRow.Session, typeof(pos_configurationplaceterminal), (DataSourceRow as fin_articleclass).CreatedWhere, "Designation");
                 * BOWidgetBox boxCreatedWhere = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_terminal, xpoComboBoxCreatedWhere);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCreatedWhere, DataSourceRow, "CreatedWhere", SettingsApp.RegexGuid, true));
                 *
                 * //Hbox CreatedBy and CreatedWhere
                 * HBox hboxCreatedByAndCreatedWhere = new HBox(false, _boxSpacing);
                 * hboxCreatedByAndCreatedWhere.PackStart(boxCreatedBy, true, true, 0);
                 * hboxCreatedByAndCreatedWhere.PackStart(boxCreatedWhere, true, true, 0);
                 * vboxTab2.PackStart(hboxCreatedByAndCreatedWhere, false, false, 0);
                 *
                 * //ButtonImage
                 * FileChooserButton fileChooserButtonImage = new FileChooserButton(string.Empty, FileChooserAction.Open) { HeightRequest = 23 };
                 * Image fileChooserImagePreviewButtonImage = new Image() { WidthRequest = _sizefileChooserPreview.Width, HeightRequest = _sizefileChooserPreview.Height };
                 * Frame fileChooserFrameImagePreviewButtonImage = new Frame();
                 * fileChooserFrameImagePreviewButtonImage.ShadowType = ShadowType.None;
                 * fileChooserFrameImagePreviewButtonImage.Add(fileChooserImagePreviewButtonImage);
                 * fileChooserButtonImage.SetFilename(((fin_articlefamily)DataSourceRow).ButtonImage);
                 * fileChooserButtonImage.Filter = Utils.GetFileFilterImages();
                 * fileChooserButtonImage.SelectionChanged += (sender, eventArgs) => fileChooserImagePreviewButtonImage.Pixbuf = Utils.ResizeAndCropFileToPixBuf((sender as FileChooserButton).Filename, new System.Drawing.Size(fileChooserImagePreviewButtonImage.WidthRequest, fileChooserImagePreviewButtonImage.HeightRequest));
                 * BOWidgetBox boxfileChooserButtonImage = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_button_image, fileChooserButtonImage);
                 * HBox hboxfileChooserAndimagePreviewButtonImage = new HBox(false, _boxSpacing);
                 * hboxfileChooserAndimagePreviewButtonImage.PackStart(boxfileChooserButtonImage, true, true, 0);
                 * hboxfileChooserAndimagePreviewButtonImage.PackStart(fileChooserFrameImagePreviewButtonImage, false, false, 0);
                 * vboxTab1.PackStart(hboxfileChooserAndimagePreviewButtonImage, false, false, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxfileChooserButtonImage, _dataSourceRow, "ButtonImage", string.Empty, true));
                 *
                 * //Notes
                 * EntryMultiline entryMultilineNotes = new EntryMultiline();
                 * entryMultilineNotes.Value.Text = (DataSourceRow as fin_article).Notes;
                 * Label labelMultilineNotes = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes);
                 * vboxTab4.PackStart(entryMultilineNotes, true, true, 0);
                 * _crudWidgetList.Add(new GenericCRUDWidgetXPO(entryMultilineNotes, labelMultilineNotes, DataSourceRow, "Notes", SettingsApp.RegexAlfaNumericExtended, false));
                 *
                 * //Append Tab
                 * _notebook.AppendPage(vboxTab2, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes));
                 */

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                /* Events Sample
                 *
                 * //Capture Events
                 * //_crudWidgetList.BeforeUpdate += delegate { ShowEventOutput(); };
                 */
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Ejemplo n.º 59
0
        public PreviewVisualizerWindow(ObjectValue val, Gtk.Widget invokingWidget) : base(Gtk.WindowType.Toplevel)
        {
            this.TypeHint  = WindowTypeHint.PopupMenu;
            this.Decorated = false;
            TransientFor   = (Gtk.Window)invokingWidget.Toplevel;

            Theme.SetFlatColor(new Cairo.Color(245 / 256.0, 245 / 256.0, 245 / 256.0));
            Theme.Padding = 3;
            ShowArrow     = true;
            var mainBox     = new VBox();
            var headerTable = new Table(1, 3, false);

            headerTable.ColumnSpacing = 5;
            var closeButton = new ImageButton()
            {
                InactiveImage = ImageService.GetIcon("md-popup-close", IconSize.Menu),
                Image         = ImageService.GetIcon("md-popup-close-hover", IconSize.Menu)
            };

            closeButton.Clicked += delegate {
                this.Destroy();
            };
            var hb = new HBox();
            var vb = new VBox();

            hb.PackStart(vb, false, false, 0);
            vb.PackStart(closeButton, false, false, 0);
            headerTable.Attach(hb, 0, 1, 0, 1);

            var headerTitle = new Label();

            headerTitle.ModifyFg(StateType.Normal, new Color(36, 36, 36));
            var font = headerTitle.Style.FontDescription.Copy();

            font.Weight = Pango.Weight.Bold;
            headerTitle.ModifyFont(font);
            headerTitle.Text = val.TypeName.Split('.').LastOrDefault();
            var vbTitle = new VBox();

            vbTitle.PackStart(headerTitle, false, false, 3);
            headerTable.Attach(vbTitle, 1, 2, 0, 1);

            if (DebuggingService.HasValueVisualizers(val))
            {
                var openButton = new Button();
                openButton.Label    = "Open";
                openButton.Relief   = ReliefStyle.Half;
                openButton.Clicked += delegate {
                    PreviewWindowManager.DestroyWindow();
                    DebuggingService.ShowValueVisualizer(val);
                };
                var hbox = new HBox();
                hbox.PackEnd(openButton, false, false, 2);
                headerTable.Attach(hbox, 2, 3, 0, 1);
            }
            else
            {
                headerTable.Attach(new Label(), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0);
            }
            mainBox.PackStart(headerTable);
            mainBox.ShowAll();

            var previewVisualizer = DebuggingService.GetPreviewVisualizer(val);

            if (previewVisualizer == null)
            {
                previewVisualizer = new GenericPreviewVisualizer();
            }
            Control widget = null;

            try {
                widget = previewVisualizer.GetVisualizerWidget(val);
            } catch (Exception e) {
                DebuggingService.DebuggerSession.LogWriter(true, "Exception during preview widget creation: " + e.Message);
            }
            if (widget == null)
            {
                widget = new GenericPreviewVisualizer().GetVisualizerWidget(val);
            }
            var alignment = new Alignment(0, 0, 1, 1);

            alignment.SetPadding(3, 5, 5, 5);
            alignment.Show();
            alignment.Add(widget);
            mainBox.PackStart(alignment);
            ContentBox.Add(mainBox);
        }
Ejemplo n.º 60
0
        public void ShowCalendar()
        {
            popup        = new Window(WindowType.Popup);
            popup.Screen = parent.Screen;

            Frame frame = new Frame();

            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);

            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent      += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

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

            //Requisition req = SizeRequest();

            parent.GdkWindow.GetOrigin(out xPos, out yPos);
//			popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
            popup.Move(xPos, yPos);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                                      Gdk.EventMask.ButtonPressMask
                                                      | Gdk.EventMask.ButtonReleaseMask
                                                      | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success)
            {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success)
                {
                    Grab.Remove(popup);
                    popup.Destroy();
                    popup = null;
                }
            }
            else
            {
                Grab.Remove(popup);
                popup.Destroy();
                popup = null;
            }

            cal.DaySelected  += OnCalendarDaySelected;
            cal.MonthChanged += OnCalendarMonthChanged;

            cal.Date = date;
        }