protected override void OnParentChanged() { base.OnParentChanged(); TableLayoutContainer tlc = Parent as TableLayoutContainer; if (tlc != null) { OffsetY = tlc.CellPadding.Height; } }
protected virtual void InitTable() { Table = Controls.AddChild(new TableLayoutContainer("table")); Table.Padding = new Padding(12, 6); ImageWidget = Table.AddChild(new ImagePanel("image", Docking.Fill, String.Empty), 0, 0, 5); ImageWidget.Padding = new Padding(0, 8, 8, 0); ImageWidget.VAlign = Alignment.Near; ImageWidget.SizeMode = ImageSizeModes.None; TitleWidget = Table.AddChild(new TextWidget("title"), 0, 1, 1, 2); TitleWidget.SetFontByTag(CommonFontTags.ExtraLarge); TitleWidget.Format = FontFormat.DefaultMultiLine; // ToDo: DPI Scaling TitleWidget.Margin = new Padding(TitleWidget.Margin.Left, 8, TitleWidget.Margin.Right, TitleWidget.Margin.Bottom); SubTitleWidget = Table.AddChild(new TextWidget("subtitle"), 1, 1, 1, 2); SubTitleWidget.Format = FontFormat.DefaultMultiLine; VersionWidget = Table.AddChild(new TextWidget("version"), 2, 1, 1, 2); VersionWidget.Format = FontFormat.DefaultSingleLine; //VersionWidget.Margin = new Padding (VersionWidget.Margin.Left, 8, VersionWidget.Margin.Right, 8); VersionWidget.Text = GetVersion(); LicenseInfoWidget = Table.AddChild(new TextWidget("licinfo"), 3, 1, 1, 2); LicenseInfoWidget.Format = FontFormat.DefaultMultiLine; LicenseInfoWidget.Margin = new Padding(LicenseInfoWidget.Margin.Left, 0, LicenseInfoWidget.Margin.Right, 8); LicenseInfoWidget.Visible = false; CreditsCaptionWidget = Table.AddChild(new TextWidget("creditscaption"), 4, 0); CreditsCaptionWidget.Format = FontFormat.DefaultSingleLine; CreditsCaptionWidget.Text = "Credits:"; UrlCaptionWidget = Table.AddChild(new TextWidget("moreinfocaption"), 4, 1); UrlCaptionWidget.Format = FontFormat.DefaultSingleLine; UrlCaptionWidget.Text = "More Info:"; UrlCaptionWidget.Visible = false; UrlWidget = Table.AddChild(new UrlTextWidget("url", ""), 4, 2); CreditsWidget = Table.AddChild(new ScrollingBox("credits"), 5, 0, 1, 3); CreditsWidget.SetFontByTag(CommonFontTags.Serif); CopyrightWidget = Table.AddChild(new TextWidget("copyright"), 6, 0, 1, 3); CopyrightWidget.Format = FontFormat.DefaultMultiLine; // finally set some SizeModes Table.Columns [0].SizeMode = TableSizeModes.Content; Table.Columns [1].SizeMode = TableSizeModes.Content; Table.Rows [5].SizeMode = TableSizeModes.Fill; }