New function for TabControl
A TabPage can also be a FlowLayout
This commit is contained in:
parent
42c66ce696
commit
cd290e6fd0
@ -49,6 +49,37 @@ public class TabControl : IRenderObject, IParent
|
|||||||
if (PageIndex != loc) page.Visible = false;
|
if (PageIndex != loc) page.Visible = false;
|
||||||
Controls.Add(page);
|
Controls.Add(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddPage(string Title, FlowLayout page)
|
||||||
|
{
|
||||||
|
RoundedButton tmp;
|
||||||
|
uint loc = (uint)Buttonts.Length;
|
||||||
|
int locc = 0, loccc = 0;
|
||||||
|
if (loc != 0)
|
||||||
|
{
|
||||||
|
locc = Buttonts[loc - 1].Location.X;
|
||||||
|
loccc = Buttonts[loc - 1].Size.X;
|
||||||
|
}
|
||||||
|
Buttonts.Add(tmp = new RoundedButton()
|
||||||
|
{
|
||||||
|
Location = new( locc+ loccc + (TabSpace * (int)loc) + Border, Border),
|
||||||
|
Font = TitleFont,
|
||||||
|
Text = Title,
|
||||||
|
Tag = loc,
|
||||||
|
BorderColor = this.BorderColor,
|
||||||
|
InsideColor = this.InsideColor,
|
||||||
|
FontColor = this.TextColor
|
||||||
|
});
|
||||||
|
|
||||||
|
if (loc == PageIndex) tmp.BorderColor = this.SelectedColor;
|
||||||
|
tmp.Clicked += TmpOnClicked;
|
||||||
|
tmp.Size = new(tmp._label.Size.X + ((TextBorder + 4) * 2), tmp._label.Size.Y + ((TextBorder + 4) * 2));
|
||||||
|
page.Anchor = ObjectAnchor.All;
|
||||||
|
page.Location = new(Border, tmp.Location.Y + tmp.Size.Y + TabSpace);
|
||||||
|
page.Size = new(Size.X - Border - Border, Size.Y - page.Location.Y - Border);
|
||||||
|
if (PageIndex != loc) page.Visible = false;
|
||||||
|
Controls.Add(page);
|
||||||
|
}
|
||||||
|
|
||||||
private Task TmpOnClicked(IRenderObject arg)
|
private Task TmpOnClicked(IRenderObject arg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user