示例#1
17
		public TreeViewSection()
		{
			var layout = new DynamicLayout();
			
			layout.BeginHorizontal();
			layout.Add(new Label());
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(allowExpanding = new CheckBox{ Text = "Allow Expanding", Checked = true });
			layout.Add(allowCollapsing = new CheckBox{ Text = "Allow Collapsing", Checked = true });
			layout.Add(RefreshButton());
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();

			treeView = ImagesAndMenu();

			layout.AddRow(new Label{ Text = "Simple" }, Default());
			layout.BeginHorizontal();
			layout.Add(new Panel());
			layout.BeginVertical();
			layout.AddSeparateRow(InsertButton(), AddChildButton(), RemoveButton(), ExpandButton(), CollapseButton(), null);
			layout.AddSeparateRow(LabelEditCheck(), EnabledCheck(), null);
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow(new Label{ Text = "With Images\n&& Context Menu" }, treeView);
			layout.AddRow(new Panel(), HoverNodeLabel());

			layout.Add(null, false, true);

			Content = layout;
		}
示例#2
1
		public TreeGridViewSection()
		{
			var layout = new DynamicLayout();
		
			layout.BeginHorizontal();
			layout.Add(new Label());
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(allowExpanding = new CheckBox{ Text = "Allow Expanding", Checked = true });
			layout.Add(allowCollapsing = new CheckBox{ Text = "Allow Collapsing", Checked = true });
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			
			layout.AddRow(new Label{ Text = "Simple" }, Default());
			
			layout.AddRow(new Label{ Text = "With Images\n&& Context Menu" }, ImagesAndMenu());
			layout.AddRow(new Label{ Text = "Disabled" }, Disabled());
			
			layout.Add(null, false, true);

			Content = layout;
		}
示例#3
1
		public ChannelListDialog (Server server)
		{
			this.ClientSize = new Size (600, 400);
			this.Resizable = true;
			this.Title = "Channel List";
			
			grid = new GridView {
				AllowMultipleSelection = false
			};
			grid.MouseDoubleClick += HandleMouseDoubleClick;
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("Name"), HeaderText = "Channel", Width = 150, AutoSize = false });
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("UserCount"), HeaderText = "Users", Width = 60, AutoSize = false });
			grid.Columns.Add (new GridColumn { DataCell = new TextBoxCell ("Topic"), HeaderText = "Topic", Width = 350, AutoSize = false });
			
			var layout = new DynamicLayout (this);
			
			layout.Add (grid, yscale: true);
			layout.BeginVertical ();
			layout.AddRow (null, this.CancelButton (), this.OkButton ("Join Channel", CanJoin));
			layout.EndVertical ();
			
			var channelTask = server.GetChannelList ();
			channelTask.ContinueWith (task => {
				Application.Instance.AsyncInvoke (delegate {
					grid.DataStore = new GridItemCollection (task.Result.OrderBy (r => r.Name).OrderByDescending (r => r.UserCount));
				});
			}, System.Threading.Tasks.TaskContinuationOptions.OnlyOnRanToCompletion);
		}
示例#4
0
		public PrintDialogSection()
		{
			this.DataContext = settings;

			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.BeginVertical(Padding.Empty);
			layout.AddSeparateRow(null, ShowPrintDialog(), null);
			layout.AddSeparateRow(null, PrintFromGraphicsWithDialog(), null);
			layout.AddSeparateRow(null, PrintFromGraphics(), null);
			layout.EndBeginVertical();
			layout.Add(PrintDialogOptions());
			layout.Add(null);
			layout.EndVertical();
			layout.Add(null);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.AddSeparateRow(null, PageRange(), Settings(), null);

			layout.Add(null);
			Content = layout;
		}
示例#5
0
        void Init()
        {
            //_textBoxUrl
            _textBoxUrl = new TextBox();

            //_buttonReadFile
            _buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") };
            _buttonReadFile.Click += _buttonReadFile_Click;

            //_buttonSaveFile
            _buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")};
            _buttonSaveFile.Click += _buttonSaveFile_Click;

            //_textAreaBody
            _textAreaBody = new TextArea();

            var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
            layout.BeginVertical();
            layout.BeginHorizontal();
            layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false);
            layout.AddCentered(_buttonReadFile, horizontalCenter: false);
            layout.AddCentered(_buttonSaveFile, horizontalCenter: false);
            layout.EndBeginHorizontal();
            layout.EndVertical();

            layout.AddRow(_textAreaBody);

            Content = layout;
        }
示例#6
0
		public ServerDialog (Server server, bool isNew, bool allowConnect)
		{
			this.isNew = isNew;
			this.allowConnect = allowConnect && !isNew;
			this.Server = server;
			this.Title = "Add Server";
			this.MinimumSize = new Size (300, 0);
			this.DataContext = server;
			
			var layout = new DynamicLayout (this);
			
			layout.BeginVertical ();
			
			layout.AddRow (new Label { Text = "Server Name"}, ServerName ());
			
			// generate server-specific edit controls
			server.GenerateEditControls (layout, isNew);
			
			layout.AddRow (null, AutoConnectButton());
			
			layout.EndBeginVertical ();

			layout.AddRow (Connect (), Disconnect (), null, cancelButton = this.CancelButton (), this.OkButton ("Save", () => SaveData()));
			
			layout.EndVertical ();
			
			SetVisibility ();
		}
示例#7
0
		Control TestProperties()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };
			DateTimePicker min, max, current, setValue;
			Button setButton;

			layout.AddRow("Min Value", min = new DateTimePicker());
			layout.AddRow("Max Value", max = new DateTimePicker());
			layout.BeginHorizontal();
			layout.Add("Set to value");
			layout.BeginVertical(Padding.Empty);
			layout.BeginHorizontal();
			layout.AddAutoSized(setValue = new DateTimePicker());
			layout.Add(setButton = new Button { Text = "Set" });
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow("Value", current = new DateTimePicker());

			min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
			max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
			setButton.Click += (sender, e) => current.Value = setValue.Value;
			LogEvents(current);

			return layout;
		}
示例#8
0
		public GridViewSection()
		{
			var layout = new DynamicLayout();

			layout.AddRow(new Label { Text = "Default" }, Default());
			layout.AddRow(new Label { Text = "No Header,\nNon-Editable" }, NoHeader());
#if DESKTOP
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Context Menu\n&& Multi-Select\n&& Filter" });
			layout.BeginVertical();
			layout.Add(filterText = new SearchBox { PlaceholderText = "Filter" });
			var withContextMenuAndFilter = WithContextMenuAndFilter();
			layout.Add(withContextMenuAndFilter);
			layout.EndVertical();
			layout.EndHorizontal();

			var selectionGridView = Default(addItems: false);
			layout.AddRow(new Label { Text = "Selected Items" }, selectionGridView);

			// hook up selection of main grid to the selection grid
			withContextMenuAndFilter.SelectionChanged += (s, e) =>
			{
				var items = new DataStoreCollection();
				items.AddRange(withContextMenuAndFilter.SelectedItems);
				selectionGridView.DataStore = items;
			};
#endif

			Content = layout;
		}
示例#9
0
		Dialog CreateDialog()
		{
			var dialog = new Dialog();
			dialog.DisplayMode = DisplayMode;

			var layout = new DynamicLayout();

			layout.AddCentered(new Label { Text = "Content" }, yscale: true);

			dialog.DefaultButton = new Button { Text = "Default Button" };
			dialog.AbortButton = new Button { Text = "Abort Button" };

			dialog.DefaultButton.Click += delegate
			{
				MessageBox.Show("Default button clicked");
			};

			dialog.AbortButton.Click += delegate
			{
				MessageBox.Show("Abort button clicked");
				dialog.Close();
			};

			layout.BeginVertical();
			layout.AddRow(null, dialog.DefaultButton, dialog.AbortButton);
			layout.EndVertical();

			dialog.Content = layout;

			return dialog;
		}
示例#10
0
		Control TestProperties()
		{
			var layout = new DynamicLayout();
			DateTimePicker min, max, current, setValue;
			Button setButton;

			layout.AddRow(new Label { Text = "Min Value" }, min = new DateTimePicker());
			layout.AddRow(new Label { Text = "Max Value" }, max = new DateTimePicker());
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Set to value" });
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.AddAutoSized(setValue = new DateTimePicker());
			layout.Add(setButton = new Button { Text = "Set" });
			layout.EndHorizontal();
			layout.EndVertical();
			layout.EndHorizontal();
			layout.AddRow(new Label { Text = "Value" }, current = new DateTimePicker());

			min.ValueChanged += (sender, e) => current.MinDate = min.Value ?? DateTime.MinValue;
			max.ValueChanged += (sender, e) => current.MaxDate = max.Value ?? DateTime.MaxValue;
			setButton.Click += (sender, e) => current.Value = setValue.Value;
			LogEvents(current);

			return layout;
		}
示例#11
0
		public ButtonSection ()
		{
			var layout = new DynamicLayout (this);
			
			//layout.SetColumnScale(0);
			
			layout.BeginVertical ();
			layout.AddRow (null, NormalButton (), null);
			layout.EndVertical ();
			layout.BeginVertical ();
			layout.AddRow (null, LongerButton (), null);
			layout.EndVertical ();
			layout.BeginVertical ();
			layout.AddRow (null, ColourButton (), null);
			layout.EndVertical ();
			
			layout.Add (null);
		}
示例#12
0
		public DrawableSection ()
		{
			var layout = new DynamicLayout (this);
			
			layout.BeginVertical ();
			layout.BeginHorizontal ();
			layout.Add (new Label { Text = "Default" });
			layout.Add (this.Default (), true);
			layout.Add (new Label { Text = "With Background" });
			layout.Add (this.WithBackground (), true);
			layout.EndHorizontal ();
			layout.EndVertical ();
			layout.BeginVertical ();
			layout.AddRow (new Label { Text = "Large Canvas" }, DockLayout.CreatePanel (this.LargeCanvas ()));
			layout.EndVertical ();

			layout.Add (null);
		}
示例#13
0
		public DrawableSection()
		{
			var layout = new DynamicLayout();
			
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add(new Label { Text = "Default" });
			layout.Add(this.Default(), xscale: true);
			layout.Add(new Label { Text = "With Background" });
			layout.Add(this.WithBackground(), xscale: true);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.BeginVertical();
			// use a separate containing panel to test calculations in those cases
			layout.AddRow(new Label { Text = "Large Canvas" }, new Panel { Content = this.LargeCanvas () });
			layout.EndVertical();

			layout.Add(null);
			Content = layout;
		}
示例#14
0
		public DrawableSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.Add("Default");
			layout.Add(this.Default(), xscale: true);
			layout.Add("With Background");
			layout.Add(this.WithBackground(), xscale: true);
			layout.EndHorizontal();
			layout.EndVertical();
			layout.BeginVertical();
			// use a separate containing panel to test calculations in those cases
			layout.AddRow("Large Canvas", new Panel { Content = this.LargeCanvas() });
			layout.EndVertical();

			layout.Add(null);
			Content = layout;
		}
示例#15
0
		public ClearSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };
			layout.AddSeparateRow(null, UseClearColorControl(), UseGraphicsPathClipControl(), null);
			layout.BeginVertical();
			layout.AddRow(new Label { Text = "Drawable" }, ClearGraphicsTest(), null);
			layout.AddRow(new Label { Text = "Bitmap (with yellow background)" }, ClearBitmapTest(), null);
			layout.EndVertical();
			layout.Add(null);

			Content = layout;
		}
		Control Default()
		{
			var control = new RadioButtonList();
			LogEvents(control);
			
			var layout = new DynamicLayout();
			layout.Add(TableLayout.AutoSized(control));
			layout.BeginVertical();
			layout.AddRow(null, AddRowsButton(control), RemoveRowsButton(control), ClearButton(control), Orientation(control), null);
			layout.EndVertical();
			
			return layout;
		}
示例#17
0
文件: ClipSection.cs 项目: mhusen/Eto
		public ClipSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.AddSeparateRow(null, ResetClipControl(), null);
			layout.BeginVertical();
			layout.AddRow(new Label { Text = "Rectangle Clip" }, RectangleClip());
			layout.AddRow(new Label { Text = "GraphicsPath Clip" }, PathClip());
			layout.EndVertical();
			layout.Add(null);

			Content = layout;
		}
示例#18
0
		Control Default()
		{
			var control = new DropDown();
			LogEvents(control);
			
			var layout = new DynamicLayout();
			layout.Add(TableLayout.AutoSized(control));
			layout.BeginVertical();
			layout.AddRow(null, AddRowsButton(control), RemoveRowsButton(control), ClearButton(control), SetSelected(control), ClearSelected(control), null);
			layout.EndVertical();
			
			return layout;
		}
示例#19
0
		Control Default ()
		{
			var control = new ComboBox ();
			LogEvents (control);
			
			var layout = new DynamicLayout (new Panel());
			layout.Add (TableLayout.AutoSized(control));
			layout.BeginVertical ();
			layout.AddRow (null, AddRowsButton (control), RemoveRowsButton (control), ClearButton (control), null);
			layout.EndVertical ();
			
			return layout.Container;
		}
示例#20
0
		public ClipSection()
		{
			var layout = new DynamicLayout();

			layout.AddSeparateRow(null, ResetClipControl(), null);
			layout.BeginVertical();
			layout.AddRow(new Label { Text = "Rectangle Clip" }, RectangleClip());
			layout.AddRow(new Label { Text = "GraphicsPath Clip" }, PathClip());
			layout.EndVertical();
			layout.Add(null);

			Content = layout;
		}
示例#21
0
		Control Default()
		{
			var text = new TextArea { Text = "Some Text" };
			LogEvents(text);

			var layout = new DynamicLayout();

			layout.Add(text);
			layout.BeginVertical(Padding.Empty, Size.Empty);
			layout.AddRow(null, ShowSelectedText(text), SetSelectedText(text), ReplaceSelected(text), SelectAll(text), SetCaret(text), null);
			layout.EndVertical();

			return layout;
		}
示例#22
0
        Control LoginSection()
        {
            var layout = new DynamicLayout(loginSection = new GroupBox{ Text = "Login"});
            
            layout.Add(null);
            layout.BeginVertical();
            layout.AddRow(new Label { Text = "User Name" }, EditUserName());
            layout.AddRow(new Label { Text = "Password" }, EditPassword());
            layout.EndVertical();
            layout.AddSeparateRow(null, CreateAccountButton(), null);
            layout.Add(null);

            return layout.Container;
        }
示例#23
0
		public CustomDialogSection()
		{
			var layout = new DynamicLayout { Spacing = new Size(20, 20) };

			layout.AddSeparateRow(null, UseAsyncCheckBox(), DisplayModeDropDown(), null);
			layout.BeginVertical();
			layout.AddRow(null, Standard(), null);
			layout.AddRow(null, Resizable(), null);
			layout.AddRow(null, KitchenSink(), null);
			layout.EndVertical();

			layout.Add(null);

			Content = layout;
		}
示例#24
0
		Control SocialSection ()
		{
			var layout = new DynamicLayout (socialSection = new GroupBox{ Text = "Janrain"});

			layout.Add (null);
			layout.AddSeparateRow (new Label { Text = "App Name" }, JanrainAppName ());
			layout.Add (null);
			layout.BeginVertical ();
			layout.AddRow (null, StatusLabel (), null);
			layout.AddRow (null, AuthButton(), null);
			layout.EndVertical ();
			layout.Add (null);

			return layout.Container;
		}
示例#25
0
		Control Default(Size? size = null)
		{
			var control = new Spinner();
			if (size != null)
				control.Size = size.Value;

			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };

			layout.AddCentered(control);

			layout.BeginVertical();
			layout.AddRow(null, StartStopButton(control), null);
			layout.EndVertical();

			return layout;
		}
示例#26
0
		public GraphicsPathSection()
		{
			StartFigures = true;
			PenThickness = 1;

			var layout = new DynamicLayout();

			layout.AddSeparateRow(null, StartFiguresControl(), CloseFiguresControl(), ConnectPathControl(), null);
			layout.AddSeparateRow(null, PenThicknessControl(), PenJoinControl(), PenCapControl(), null);
			layout.AddSeparateRow(null, ShowBounds(), CurrentPoint(), null);
			layout.BeginVertical();
			layout.AddRow(new Label { Text = "Draw Line Path" }, DrawLinePath());
			layout.AddRow(new Label { Text = "Fill Line Path" }, FillLinePath());
			layout.EndVertical();
			layout.Add(null);

			Content = layout;
		}
示例#27
0
		public DateTimePickerSection()
		{
			var layout = new DynamicLayout();

			layout.BeginVertical();
			layout.AddRow(new Label { Text = "Default" }, Default(), new Label { Text = "Default with Value" }, DefaultWithValue(), null);
			layout.AddRow(new Label { Text = "Date" }, DateControl(), new Label { Text = "Date with Value" }, DateControlWithValue());
			layout.AddRow(new Label { Text = "Time" }, TimeControl(), new Label { Text = "Time with Value" }, TimeControlWithValue());
			layout.AddRow(new Label { Text = "Date/Time" }, DateTimeControl(), new Label { Text = "Date/Time with Value" }, DateTimeControlWithValue());
			layout.EndVertical();

			layout.AddCentered(TestProperties());
			
			// growing space at end is blank!
			layout.Add(null);

			Content = layout;
		}
示例#28
0
		public DateTimePickerSection()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5), Padding = new Padding(10) };

			layout.BeginVertical();
			layout.AddRow("Default", Default(), "Default with Value", DefaultWithValue(), null);
			layout.AddRow("Date", DateControl(), "Date with Value", DateControlWithValue());
			layout.AddRow("Time", TimeControl(), "Time with Value", TimeControlWithValue());
			layout.AddRow("Date/Time", DateTimeControl(), "Date/Time with Value", DateTimeControlWithValue());
			layout.EndVertical();

			layout.AddCentered(TestProperties());

			// growing space at end is blank!
			layout.Add(null);

			Content = layout;
		}
示例#29
0
		Control SetValue ()
		{
			var control = new ProgressBar{
				MinValue = 0,
				MaxValue = 1000,
				Value = 500
			};

			var layout = new DynamicLayout (new Panel ());
			
			layout.Add (control);
			
			layout.BeginVertical ();
			layout.AddRow (null, StartStopButton (control), null);
			layout.EndVertical ();
			
			return layout.Container;
		}
示例#30
-1
		void Init()
		{
			//_textBoxUrl
			_textBoxUrl = new TextBox();

			//_buttonReadFile
			_buttonReadFile = new Button { Text = StrRes.GetString("StrLoad", "Load") };
			_buttonReadFile.Click += _buttonReadFile_Click;

			//_buttonSaveFile
			_buttonSaveFile = new Button {Text = StrRes.GetString("StrSave","Save")};
			_buttonSaveFile.Click += _buttonSaveFile_Click;

			//_textAreaBody
			_textAreaBody = new TextArea();
            //rightMenu_Body
            var rightMenuBody = new ContextMenu();
		    var findCommand = new Command
		    {
		        MenuText = StrRes.GetString("StrFind", "Find"),
		        Shortcut = Keys.F | Application.Instance.CommonModifier
		    };
            findCommand.Executed += findCommand_Executed;
            rightMenuBody.Items.Add(findCommand);

			var layout = new DynamicLayout { Padding = new Padding(5, 5), Spacing = new Size(5, 5) };
			layout.BeginVertical();
			layout.BeginHorizontal();
			layout.AddCentered(_textBoxUrl, xscale: true, horizontalCenter: false);
			layout.AddCentered(_buttonReadFile, horizontalCenter: false);
			layout.AddCentered(_buttonSaveFile, horizontalCenter: false);
			layout.EndBeginHorizontal();
			layout.EndVertical();

            layout.AddRow(_textAreaBody);

            // bug in gtk2
            layout.ContextMenu = rightMenuBody;
            layout.MouseUp += (sender, e) =>
            {
                if (e.Buttons == MouseButtons.Alternate)
                {
                    layout.ContextMenu.Show(_textAreaBody);
                }
            };

			Content = layout;
		}