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


C# Xwt.HBox类代码示例

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


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

示例1: DragDrop

        public DragDrop()
        {
            HBox box = new HBox ();

            SimpleBox b1 = new SimpleBox (30);
            box.PackStart (b1, BoxMode.None);

            b2 = new Button ("Drop here");
            box.PackEnd (b2, BoxMode.None);

            b1.ButtonPressed += delegate {
                var d = b1.CreateDragOperation ();
                d.Data.AddValue ("Hola");
                var img = Image.FromResource (GetType(), "class.png");
                d.SetDragImage (img, (int)img.Size.Width, (int)img.Size.Height);
                d.AllowedActions = DragDropAction.All;
                d.Start ();
            };

            b2.SetDragDropTarget (TransferDataType.Text, TransferDataType.Uri);
            PackStart (box);

            b2.DragDrop += HandleB2DragDrop;
            b2.DragOver += HandleB2DragOver;
        }
开发者ID:RevolutionSmythe,项目名称:xwt,代码行数:25,代码来源:DragDrop.cs

示例2: LauncherWindow

        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;
        }
开发者ID:prodigeni,项目名称:TrueCraft,代码行数:27,代码来源:LauncherWindow.cs

示例3: MouseCursors

		public MouseCursors ()
		{
			PackStart (new Label ("Move the mouse over the labels \nto see the cursors:"));
			var cursorTypes = typeof (CursorType).GetFields (BindingFlags.Public | BindingFlags.Static);
			var perRow = 6;

			HBox row = null;
			for (var i = 0; i < cursorTypes.Length; i++) {
				if (cursorTypes [i].FieldType != typeof (CursorType))
					continue;

				if ((i % perRow) == 0) {
					if (row != null)
						PackStart (row);
					row = new HBox ();
				}

				var cursor = (CursorType)cursorTypes [i].GetValue (typeof(CursorType));
				var label = new Label (cursorTypes [i].Name);
				label.BackgroundColor = Colors.White;
				label.Cursor = cursor;

				row.PackStart (label);
			}
			if (row != null)
				PackStart (row);
		}
开发者ID:m13253,项目名称:xwt,代码行数:27,代码来源:MouseCursors.cs

示例4: 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

示例5: 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

示例6: Tables

        public Tables()
        {
            Table t = new Table ();

            SimpleBox b = new SimpleBox (200, 20);
            t.Attach (b, 0, 1, 0, 1);

            b = new SimpleBox (5, 20);
            t.Attach (b, 1, 2, 0, 1);

            b = new SimpleBox (250, 20);
            t.Attach (b, 0, 2, 1, 2, AttachOptions.Expand, AttachOptions.Expand);

            b = new SimpleBox (300, 20);
            t.Attach (b, 1, 3, 2, 3);

            b = new SimpleBox (100, 20);
            t.Attach (b, 2, 3, 3, 4);

            b = new SimpleBox (450, 20);
            t.Attach (b, 0, 3, 4, 5);

            PackStart (t);

            HBox box = new HBox ();
            PackStart (box);
            t = new Table ();
            t.Attach (new Label ("One:"), 0, 1, 0, 1);
            t.Attach (new TextEntry (), 1, 2, 0, 1);
            t.Attach (new Label ("Two:"), 0, 1, 1, 2);
            t.Attach (new TextEntry (), 1, 2, 1, 2);
            t.Attach (new Label ("Three:"), 0, 1, 2, 3);
            t.Attach (new TextEntry (), 1, 2, 2, 3);
            box.PackStart (t);
        }
开发者ID:RevolutionSmythe,项目名称:xwt,代码行数:35,代码来源:Tables.cs

示例7: 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

示例8: ListView

		void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject)
		{
			this.ExpandHorizontal = true;
			this.ExpandVertical = true;
			this.HeightRequest = 400;
			list = new ListView ();
			store = new ListStore (language, completeOnSpace, completeOnChars);

			var languageColumn = list.Columns.Add (GettextCatalog.GetString ("Language"), language);
			languageColumn.CanResize = true;

			var checkBoxCellView = new CheckBoxCellView (completeOnSpace);
			checkBoxCellView.Editable = true;
			var completeOnSpaceColumn = list.Columns.Add (GettextCatalog.GetString ("Complete on space"), checkBoxCellView);
			completeOnSpaceColumn.CanResize = true;

			var textCellView = new TextCellView (completeOnChars);
			textCellView.Editable = true;
			var doNotCompleteOnColumn = list.Columns.Add (GettextCatalog.GetString ("Do complete on"), textCellView);
			doNotCompleteOnColumn.CanResize = true;
			list.DataSource = store;
			PackStart (list, true, true);

			var hbox = new HBox ();
			var button = new Button ("Reset to default");
			button.Clicked += delegate {
				FillStore (CompletionCharacters.GetDefaultCompletionCharacters ());
			};	
			hbox.PackEnd (button, false, false);
			PackEnd (hbox, false, true);
			FillStore (CompletionCharacters.GetCompletionCharacters ());
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:32,代码来源:CompletionCharactersPanel.cs

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: MainView

        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();
        }
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:29,代码来源:MainView.cs


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