当前位置: 首页>>代码示例>>C#>>正文


C# HBox.PackStart方法代码示例

本文整理汇总了C#中Xwt.HBox.PackStart方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.PackStart方法的具体用法?C# HBox.PackStart怎么用?C# HBox.PackStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xwt.HBox的用法示例。


在下文中一共展示了HBox.PackStart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReportViewer

        public ReportViewer()
        {
            // Setup layout boxes
            vboxContents = new Xwt.VBox();
            vboxToolMenu = new Xwt.HBox();

            // Setup tool button menu
            Xwt.Button buttonExport = new Xwt.Button("Export");
            buttonExport.Clicked += delegate(object sender, EventArgs e) {
                SaveAs();
            };
            vboxToolMenu.PackStart(buttonExport);

            Xwt.Button buttonPrint = new Xwt.Button("Print");
            vboxToolMenu.PackStart(buttonPrint);

            // Add vboxContent widgets
            vboxPages = new Xwt.VBox();
            vboxContents.PackStart(vboxToolMenu);
            vboxContents.PackStart(vboxPages);

            // Setup Controls Contents
            scrollView = new Xwt.ScrollView();
            scrollView.Content = vboxContents;
            scrollView.VerticalScrollPolicy = ScrollPolicy.Automatic;
            scrollView.BorderVisible = true;
            this.PackStart(scrollView, BoxMode.FillAndExpand);

            Parameters = new ListDictionary();

            ShowErrors = false;
        }
开发者ID:kevindqc,项目名称:My-FyiReporting,代码行数:32,代码来源:ReportViewer.cs

示例2: BuildGui

        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();
        }
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:32,代码来源:SelectWorkItemDialog.cs

示例3: ThemedImages

        public ThemedImages()
        {
            Context.RegisterStyles ("dark", "sel");

            var img = Image.FromResource ("zoom-in-16.png");
            var img_sel = Image.FromResource ("zoom-in-16.png").WithStyles("sel");
            var img_dark = Image.FromResource ("zoom-in-16.png").WithStyles("dark");
            var img_dark_sel = Image.FromResource ("zoom-in-16.png").WithStyles("dark", "sel");

            var img_row = new HBox ();
            ImageView imgv = new ImageView () { Image = img };
            ImageView imgv_sel = new ImageView () { Image = img_sel };
            ImageView imgv_dark = new ImageView () { Image = img_dark };
            ImageView imgv_dark_sel = new ImageView () { Image = img_dark_sel };
            img_row.PackStart (imgv);
            img_row.PackStart (imgv_sel);
            img_row.PackStart (imgv_dark);
            img_row.PackStart (imgv_dark_sel);
            PackStart (img_row);

            var btn_row = new HBox ();
            Button btn = new Button (img);
            Button btn_sel = new Button (img_sel);
            Button btn_dark = new Button (img_dark);
            Button btn_dark_sel = new Button (img_dark_sel);
            btn_row.PackStart (btn);
            btn_row.PackStart (btn_sel);
            btn_row.PackStart (btn_dark);
            btn_row.PackStart (btn_dark_sel);
            PackStart (btn_row);
        }
开发者ID:akrisiun,项目名称:xwt,代码行数:31,代码来源:ThemedImages.cs

示例4: BuildGui

        void BuildGui()
        {
            HBox topPanel = new HBox();
            topPanel.MarginTop = 5;
            VSeparator separator = new VSeparator();
            acceptYours.WidthRequest = acceptTheirs.WidthRequest = acceptMerge.WidthRequest = viewBase.WidthRequest = viewTheir.WidthRequest = 120;
            SetButtonSensitive();

            topPanel.PackStart(acceptYours);
            topPanel.PackStart(acceptTheirs);
            topPanel.PackStart(acceptMerge);
            topPanel.PackStart(separator);
            topPanel.PackStart(viewBase);
            topPanel.PackStart(viewTheir);
            
            topPanel.MinHeight = 30;
            view.PackStart(topPanel);
            listView.Columns.Add("Conflict Type", typeField);
            listView.Columns.Add("Item Name", nameField);
            listView.Columns.Add("Base Version", versionBaseField);
            listView.Columns.Add("Server Version", versionTheirField);
            listView.Columns.Add("Your Version", versionYourField);
            listView.DataSource = listStore;

            view.PackStart(listView, true, true);
            AttachEvents();
        }
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:27,代码来源:ResolveConflictsView.cs

示例5: MainWindow

        public MainWindow()
        {
            this.Examples = ExampleLibrary.Examples.GetList().OrderBy(e => e.Category).ToList();

            this.plotView = new PlotView();
            this.plotView.MinHeight = 554;
            this.plotView.MinWidth = 625;
            this.plotView.DefaultTrackerSettings.Enabled = true;
            this.plotView.DefaultTrackerSettings.Background = Xwt.Drawing.Colors.AliceBlue.WithAlpha (0.9).ToOxyColor();

            this.treeView = new TreeView();
            this.treeView.MinWidth = 314;
            this.treeView.Visible = true;

            var treeModel = new TreeStore(nameCol);
            TreePosition categoryNode = null;
            string categoryName = null;
            foreach (var ex in this.Examples)
            {
                if (categoryName == null || categoryName != ex.Category)
                {
                    categoryNode = treeModel.AddNode ().SetValue (nameCol, ex.Category).CurrentPosition;
                    categoryName = ex.Category;
                }

                treeModel.AddNode (categoryNode).SetValue (nameCol, ex.Title);
            }

            treeView.Columns.Add ("Example", nameCol);
            this.treeView.DataSource = treeModel;

            this.treeView.SelectionChanged += (s, e) =>
            {

                if (treeView.SelectedRow != null) {
                    var sample = treeModel.GetNavigatorAt (treeView.SelectedRow).GetValue (nameCol);

                    var info = this.Examples.FirstOrDefault(ex => ex.Title == sample);
                    if (info != null)
                    {
                        this.SelectedExample = info;
                    }
                }
            };

            var hbox = new HBox();
            hbox.Spacing = 6;
            hbox.MinHeight = 554;
            hbox.MinWidth = 943;

            hbox.PackStart(this.treeView);
            hbox.PackStart(this.plotView, true);

            Content = hbox;

            this.SelectedExample = this.Examples.FirstOrDefault();

            this.Title = "OxyPlot.Xwt Example Browser";
            this.CloseRequested += (s, a) => Application.Exit ();
        }
开发者ID:oxyplot,项目名称:oxyplot-xwt,代码行数:60,代码来源:MainWindow.cs

示例6: ListView1

		public ListView1 ()
		{
			PackStart (new Label ("The listview should have a red background"));
			ListView list = new ListView ();
			list.GridLinesVisible = GridLines.Both;
			ListStore store = new ListStore (name, icon, text, icon2, progress);
			list.DataSource = store;
			list.Columns.Add ("Name", icon, name);
			list.Columns.Add ("Text", icon2, text);
			list.Columns.Add ("Progress", new TextCellView () { TextField = text }, new CustomCell () { ValueField = progress });

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

			Random rand = new Random ();
			
			for (int n=0; n<100; n++) {
				var r = store.AddRow ();
				store.SetValue (r, icon, png);
				store.SetValue (r, name, "Value " + n);
				store.SetValue (r, icon2, png);
				store.SetValue (r, text, "Text " + n);
				store.SetValue (r, progress, new CellData { Value = rand.Next () % 100 });
			}
			PackStart (list, true);

			list.RowActivated += delegate(object sender, ListViewRowEventArgs e) {
				MessageDialog.ShowMessage ("Row " + e.RowIndex + " activated");
			};

			Menu contextMenu = new Menu ();
			contextMenu.Items.Add (new MenuItem ("Test menu"));
			list.ButtonPressed += delegate(object sender, ButtonEventArgs e) {
				int row = list.GetRowAtPosition(new Point(e.X, e.Y));
				if (e.Button == PointerButton.Right && row >= 0) {
					// Set actual row to selected
					list.SelectRow(row);
					contextMenu.Popup(list, e.X, e.Y);
				}
			};

			var but = new Button ("Scroll one line");
			but.Clicked += delegate {
				list.VerticalScrollControl.Value += list.VerticalScrollControl.StepIncrement;
			};
			PackStart (but);

			var spnValue = new SpinButton ();
			spnValue.MinimumValue = 0;
			spnValue.MaximumValue = 99;
			spnValue.IncrementValue = 1;
			spnValue.Digits = 0;
			var btnScroll = new Button ("Go!");
			btnScroll.Clicked += (sender, e) => list.ScrollToRow((int)spnValue.Value);

			HBox scrollActBox = new HBox ();
			scrollActBox.PackStart (new Label("Scroll to Value: "));
			scrollActBox.PackStart (spnValue);
			scrollActBox.PackStart (btnScroll);
			PackStart (scrollActBox);
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:60,代码来源:ListView1.cs

示例7: DependenciesSectionWidget

		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;
			}
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:35,代码来源:DependenciesSectionWidget.cs

示例8: TaskView

        public TaskView(IQueueableTask task)
        {
            if (task == null) throw new ArgumentNullException(nameof(task));
            Task = task;
            task.StatusChanged += Task_StatusChanged;

            _nameLabel = new Label
            {
                Font = Font.SystemFont.WithWeight(FontWeight.Bold).WithSize(15)
            };
            _descriptionlabel = new Label
            {
                Font = Font.SystemFont.WithStyle(FontStyle.Italic)
            };

            _spinner = new Spinner {Visible = false};

            var hBox = new HBox();
            hBox.PackStart(_spinner);
            hBox.PackStart(_descriptionlabel);

            PackStart(_nameLabel);
            PackStart(hBox);

            HeightRequest = 64;
            MinHeight = 64;

            UpdateLabels();
        }
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:29,代码来源:TaskView.cs

示例9: Build

        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;
        }
开发者ID:cra0zy,项目名称:URMSimulator,代码行数:35,代码来源:AboutDialog.GUI.cs

示例10: CreateEditPane

 Widget CreateEditPane()
 {
     var hbox = new HBox();
     hbox.PackStart(new Toolpane());
     hbox.PackStart(new TileEditor());
     hbox.PackStart(new PreviewPane());
     return hbox;
 }
开发者ID:rje,项目名称:gbforge-old,代码行数:8,代码来源:MainView.cs

示例11: MainWindow

        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;
        }
开发者ID:carlosalberto,项目名称:xwt,代码行数:58,代码来源:MainWindow.cs

示例12: LoadTiles

        private IEnumerable<Tile> LoadTiles()
        {
            yield return CreateTile("Visit ParkitectNexus", App.DImages["parkitectnexus_logo-64x64.png"],
                Color.FromBytes(0xf3, 0x77, 0x35), _website.Launch);

            if (OperatingSystem.Detect() == SupportedOperatingSystem.Linux)
                yield return
                    CreateTile("Download URL", App.DImages["appbar.browser.wire.png"], Color.FromBytes(0xf3, 0x77, 0x35),
                        () =>
                        {
                            var entry = new TextEntry();

                            var box = new HBox();
                            box.PackStart(new Label("URL:"));
                            box.PackStart(entry, true, true);

                            var dialog = new Dialog
                            {
                                Width = 300,
                                Icon = ParentWindow.Icon,
                                Title = "Enter URL to download",
                                Content = box
                            };
                            dialog.Buttons.Add(new DialogButton(Command.Cancel));
                            dialog.Buttons.Add(new DialogButton(Command.Ok));

                            var result = dialog.Run(ParentWindow);

                            NexusUrl url;
                            if (result.Label.ToLower() == "ok" && NexusUrl.TryParse(entry.Text, out url))
                                ObjectFactory.GetInstance<IApp>().HandleUrl(url);
                            dialog.Dispose();
                        });

            yield return
                CreateTile("Launch Parkitect", App.DImages["parkitect_logo.png"], Color.FromBytes(45, 137, 239),
                    () => { _parkitect.Launch(); });

            yield return CreateTile("Help", App.DImages["appbar.information.png"], Color.FromBytes(45, 137, 239), () =>
            {
                // Temporary help solution.
                Process.Start(
                    "https://parkitectnexus.com/forum/2/parkitectnexus-website-client/70/troubleshooting-mods-and-client");
            });

            yield return CreateTile("Donate!", App.DImages["appbar.thumbs.up.png"], Color.FromBytes(45, 137, 239), () =>
            {
                if (MessageDialog.AskQuestion("Maintaining this client and adding new features takes a lot of time.\n" +
                                              "If you appreciate our work, please consider sending a donation our way!\n" +
                                              "All donations will be used for further development of the ParkitectNexus Client and the website.\n" +
                                              "\nSelect Yes to visit PayPal and send a donation.", 1, Command.No,
                    Command.Yes) == Command.Yes)
                {
                    Process.Start("https://paypal.me/ikkentim");
                }
            });
        }
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:57,代码来源:MenuPageView.cs

示例13: MyCanvas

        public MyCanvas()
        {
            var entry = new TextEntry () { ShowFrame = false };
            AddChild (entry, rect);

            var box = new HBox ();
            box.PackStart (new Button ("..."));
            box.PackStart (new TextEntry (), BoxMode.FillAndExpand);
            AddChild (box, new Rectangle (30, 70, 100, 30));
        }
开发者ID:RevolutionSmythe,项目名称:xwt,代码行数:10,代码来源:CanvasWithWidget.cs

示例14: ProgressWidget

        public ProgressWidget()
        {
            ProgressMonitor = new ProgressMonitor { Handler = new ProgressWidgetMonitor(this) };

            progressBar = new ProgressBar();
            text = new Label();
            var box = new HBox();
            box.PackStart(progressBar);
            box.PackStart(text, true);
            Content = box;
        }
开发者ID:rte-se,项目名称:emul8,代码行数:11,代码来源:ProgressWidget.cs

示例15: MyCanvas

        public MyCanvas(bool linear)
        {
            var entry = new TextEntry () { ShowFrame = false };
            AddChild (entry, rect);

            var box = new HBox ();
            box.PackStart (new Button ("..."));
            box.PackStart (new TextEntry (), true);
            AddChild (box, new Rectangle (30, 70, 100, 30));
            Linear = linear;
        }
开发者ID:shines77,项目名称:xwt,代码行数:11,代码来源:CanvasWithWidget.cs


注:本文中的Xwt.HBox.PackStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。