示例#1
0
		public override Control Generate (DynamicLayout layout)
		{
			if (rows.Count == 0)
				return null;
			int cols = rows.Max (r => r.Items.Count);

			if (Container == null) {
				Container = new Panel ();
				this.Layout = new TableLayout (Container, cols, rows.Count);
			}
			else {
				this.Layout = new TableLayout (null, cols, rows.Count);
				Container.SetInnerLayout ();
			}
			var tableLayout = this.Layout;
			var padding = this.Padding ?? layout.DefaultPadding;
			if (padding != null)
				tableLayout.Padding = padding.Value;

			var spacing = this.Spacing ?? layout.DefaultSpacing;
			if (spacing != null)
				tableLayout.Spacing = spacing.Value;

			for (int cy = 0; cy < rows.Count; cy++) {
				var row = rows[cy];
				for (int cx = 0; cx < row.Items.Count; cx++) {
					var item = row.Items[cx];
					item.Generate (layout, tableLayout, cx, cy);
				}
			}
			return Container;
		}
示例#2
0
 public virtual void SetParent(Eto.Forms.Container parent)
 {
     if (parent == null)
     {
         if (ContainerControl.Parent != null)
         {
             ((Gtk.Container)ContainerControl.Parent).Remove(ContainerControl);
         }
     }
 }
示例#3
0
		Control LoginSection ()
		{
			var layout = new DynamicLayout (loginSection = new GroupBox{ Text = "Login"});
			
			layout.Add (null);
			layout.AddRow (new Label { Text = "UserName" }, EditUserName ());
			layout.AddRow (new Label { Text = "Password" }, EditPassword ());
			layout.Add (null);

			return layout.Container;
		}
示例#4
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;
        }
示例#5
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;
		}
示例#6
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();
     };
 }
示例#7
0
文件: DockLayout.cs 项目: M1C/Eto
 public DockLayout(Container container)
     : base(container != null ? container.Generator : Generator.Current, container, typeof (IDockLayout))
 {
     inner = (IDockLayout)Handler;
 }
示例#8
0
		public PixelLayout (Container container)
			: base (container != null ? container.Generator : Generator.Current, container, typeof (IPixelLayout), true)
		{
			inner = (IPixelLayout)Handler;
		}
 public override void Generate(PreferencesDialog dialog, Container container)
 {
     var handler = dialog.Handler as IPreferencesDialog;
     handler.GenerateSection(this, container);
 }
示例#10
0
 public abstract void Generate(PreferencesDialog dialog, Container container);
示例#11
0
 public virtual void SetParent(Eto.Forms.Container parent)
 {
 }
示例#12
0
 protected override void CreateLayout(Container container)
 {
     var split = new Splitter{
         Size = new Size(200, 200),
         Position = 50,
         FixedPanel = SplitterFixedPanel.Panel2
     };
     
     split.Panel1 = new Panel();
     split.Panel2 = UserList = new UserList(this.Channel);
     
     base.CreateLayout(split.Panel1 as Panel);
     
     container.AddDockedControl(split);
 }
示例#13
0
 protected virtual void CreateLayout(Container container)
 {
     var layout = new DynamicLayout(container, Padding.Empty, Size.Empty);
     layout.Add(History, yscale: true);
     layout.Add(DockLayout.CreatePanel(TextEntry, new Padding(10)));
 }
示例#14
0
		public void SetParent(Container parent)
		{
		}
示例#15
0
		public override Control Generate (DynamicLayout layout)
		{
			if (rows.Count == 0)
				return null;
			int cols = rows.Where (r => r != null).Max (r => r.Items.Count);

			if (Container == null) {
				Container = new Panel ();
				this.Layout = new TableLayout (Container, cols, rows.Count);
			}
			else {
				this.Layout = new TableLayout (null, cols, rows.Count);
				layout.SetBaseInnerLayout();
			}
			var tableLayout = this.Layout;
			var padding = this.Padding ?? layout.DefaultPadding;
			if (padding != null)
				tableLayout.Padding = padding.Value;

			var spacing = this.Spacing ?? layout.DefaultSpacing;
			if (spacing != null)
				tableLayout.Spacing = spacing.Value;

			var scalingRow = new DynamicRow ();
			scalingRow.Items.Add (new DynamicControl{ YScale = true });
			for (int cy = 0; cy < rows.Count; cy++) {
				var row = rows[cy];
				if (row == null) row = scalingRow;
				for (int cx = 0; cx < row.Items.Count; cx++) {
					var item = row.Items[cx];
					if (item == null) item = new DynamicControl { XScale = true };
					item.Generate (layout, tableLayout, cx, cy);
				}
			}
			return Container;
		}