Exemplo n.º 1
0
 public JabbRServerEdit(JabbRServer server, DynamicLayout layout)
 {
     this.server = server;
     layout.AddRow(new Label { Text = "Address" }, EditAddress());
     layout.EndBeginVertical(yscale: true);
     layout.AddRow(UseSocialLogin());
     layout.Add(authSection = new Panel {  }, yscale: true);
     layout.EndBeginVertical();
     loginSection = LoginSection();
     socialSection = SocialSection();
     
     authSection.DataContextChanged += (sender, e) => SetVisibility();
     SetVisibility();
 }
Exemplo n.º 2
0
 public JabbRServerEdit(JabbRServer server, DynamicLayout layout)
 {
     this.server = server;
     layout.AddRow(new Label { Text = "Address" }, EditAddress());
     layout.EndBeginVertical();
     layout.AddRow(UseSocialLogin());
     layout.Add(authSection = new Panel { MinimumSize = new Size(0, 100) });
     layout.EndBeginVertical();
     LoginSection();
     SocialSection();
     
     authSection.DataContextChanged += (sender, e) => {
         SetVisibility();
     };
 }
Exemplo n.º 3
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 ();
		}
Exemplo n.º 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;
		}
Exemplo n.º 5
0
		public MessageBoxSection()
		{
			MessageBoxText = "Some message";
			MessageBoxCaption = "Some caption";
			AttachToParent = true;

			var layout = new DynamicLayout();

			layout.AddSeparateRow(null, new Label { Text = "Caption" }, CaptionBox(), null);
			layout.AddSeparateRow(null, new Label { Text = "Text" }, TitleBox(), null);

			layout.BeginVertical(Padding.Empty);

			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(new Label { Text = "Type", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
			layout.Add(MessageBoxTypeCombo());
			layout.Add(AttachToParentCheckBox());
			layout.Add(null);
			layout.EndHorizontal();

			layout.EndBeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(new Label { Text = "Buttons", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
			layout.Add(MessageBoxButtonsCombo());
			layout.Add(new Label { Text = "Default Button", VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Right });
			layout.Add(MessageBoxDefaultButtonCombo());
			layout.Add(null);
			layout.EndHorizontal();

			layout.EndVertical();

			layout.AddSeparateRow(null, ShowDialogButton(), null);
			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 6
0
		public MessageBoxSection()
		{
			MessageBoxText = "Some message";
			MessageBoxCaption = "Some caption";
			AttachToParent = true;

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

			layout.AddSeparateRow(null, new Label { Text = "Caption" }, CaptionBox(), null);
			layout.AddSeparateRow(null, new Label { Text = "Text" }, TitleBox(), null);

			layout.BeginVertical();

			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(new Label { Text = "Type", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
			layout.Add(MessageBoxTypeCombo());
			layout.Add(AttachToParentCheckBox());
			layout.Add(null);
			layout.EndHorizontal();

			layout.EndBeginVertical();
			layout.BeginHorizontal();
			layout.Add(null);
			layout.Add(new Label { Text = "Buttons", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
			layout.Add(MessageBoxButtonsCombo());
			layout.Add(new Label { Text = "Default Button", VerticalAlignment = VerticalAlignment.Center, TextAlignment = TextAlignment.Right });
			layout.Add(MessageBoxDefaultButtonCombo());
			layout.Add(null);
			layout.EndHorizontal();

			layout.EndVertical();

			layout.AddSeparateRow(null, ShowDialogButton(), null);
			layout.Add(null);

			Content = layout;
		}
Exemplo n.º 7
0
		Control LoadUrl ()
		{
			var control = new Button{
				Text = "Load Url"
			};
			control.Click += delegate {
				var dialog = new Dialog();
#if DESKTOP
				dialog.MinimumSize = new Size(300, 0);
#endif
				var layout = new DynamicLayout(dialog);
				var textBox = new TextBox { Text = "http://google.com" };
				var goButton = new Button { Text = "Go" };
				dialog.DefaultButton = goButton;
				goButton.Click += (sender, e) => {
					dialog.DialogResult = DialogResult.Ok;
					dialog.Close ();
				};
				var cancelButton = new Button { Text = "Cancel" };
				dialog.AbortButton = cancelButton;
				cancelButton.Click += (sender, e) => {
					dialog.Close ();
				};
				layout.BeginVertical ();
				layout.AddRow (new Label { Text = "Url" }, textBox);
				layout.EndBeginVertical ();
				layout.AddRow (null, cancelButton, goButton);
				layout.EndVertical ();

				if (dialog.ShowDialog (this) == DialogResult.Ok) {
					Uri uri;
					if (Uri.TryCreate(textBox.Text, UriKind.Absolute, out uri))
						webView.Url = uri;
				}
			};
			return control;
		}
Exemplo n.º 8
0
		Control LoadUrl()
		{
			var control = new Button
			{
				Text = "Load Url"
			};
			control.Click += delegate
			{
				if (Platform.Supports<Dialog>())
				{
					var dialog = new Dialog<bool>();
					if (Platform.IsDesktop)
						dialog.MinimumSize = new Size(300, 0);

					var layout = new DynamicLayout();
					var textBox = new TextBox { Text = "http://google.com" };
					var goButton = new Button { Text = "Go" };
					dialog.DefaultButton = goButton;
					goButton.Click += (sender, e) => dialog.Close(true);
					var cancelButton = new Button { Text = "Cancel" };
					dialog.AbortButton = cancelButton;
					cancelButton.Click += (sender, e) => dialog.Close();
					layout.BeginVertical();
					layout.AddRow(new Label { Text = "Url" }, textBox);
					layout.EndBeginVertical();
					layout.AddRow(null, cancelButton, goButton);
					layout.EndVertical();

					dialog.Content = layout;


					if (dialog.ShowModal(this))
					{
						Uri uri;
						if (Uri.TryCreate(textBox.Text, UriKind.Absolute, out uri))
							webView.Url = uri;
					}
				}
				else
					webView.Url = new Uri("http://google.com");
			};
			return control;
		}
Exemplo n.º 9
0
		Control Metrics()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };
			layout.BeginHorizontal();
			layout.BeginVertical();
			layout.Add(null);
			layout.AddRow(new Label { Text = "Descent" }, Descender());
			layout.AddRow(new Label { Text = "Ascent" }, Ascender());
			layout.AddRow(new Label { Text = "Leading" }, Leading());
			layout.Add(null);
			layout.EndBeginVertical();
			layout.Add(null);
			layout.AddRow(new Label { Text = "BaseLine" }, BaseLine());
			layout.AddRow(new Label { Text = "XHeight" }, XHeight());
			layout.AddRow(new Label { Text = "LineHeight" }, LineHeight());
			layout.Add(null);
			layout.EndBeginVertical();
			layout.Add(null);
			layout.Add(MetricsPreview());
			layout.Add(null);
			layout.EndVertical();
			layout.EndHorizontal();
			return layout;
		}
Exemplo n.º 10
0
		Control Metrics()
		{
			var layout = new DynamicLayout { DefaultSpacing = new Size(5, 5) };
			layout.BeginHorizontal();
			layout.BeginVertical();
			layout.Add(null);
			layout.AddRow("Descent", Descender());
			layout.AddRow("Ascent", Ascender());
			layout.AddRow("Leading", Leading());
			layout.AddRow("MeasureString", MeasureString());
			layout.Add(null);
			layout.EndBeginVertical();
			layout.Add(null);
			layout.AddRow("BaseLine", BaseLine());
			layout.AddRow("XHeight", XHeight());
			layout.AddRow("LineHeight", LineHeight());
			layout.Add(null);
			layout.EndBeginVertical();
			layout.Add(null);
			layout.Add(MetricsPreview());
			layout.Add(null);
			layout.EndVertical();
			layout.EndHorizontal();
			return layout;
		}