alternetsoft / AlternetUI

MIT License
22 stars 2 forks source link

New layout sysytem may not be working... #112

Closed Shadowblitz16 closed 5 months ago

Shadowblitz16 commented 6 months ago

I have this code...


using Alternet.UI;

public class LevelSettingsWindow : Window 
{
    public LevelSettingsWindow(Level level)
    {
        Title           = "Level Settings";

        IsToolWindow    = true;
        Resizable       = false;
        CloseEnabled    = false;
        MinimizeEnabled = false;
        MaximizeEnabled = false;

        var outer  = AddFrame(1,1);
        var inner1 = AddFrame(2,1, "Backgrounds", outer);

        foreach (var background in level.Backgrounds)
        {
            var button = inner1.AddButton(background.Name, () =>
            {
                level.Sections[(int)level.Section].Background = (uint)level.Backgrounds.IndexOf(background);
            });
        }
    }

    public Grid AddFrame(uint columns, uint rows, string name="", Control? parent=null)
    {
        if (parent == null) parent = this;

        if (name   != "") 
        {
            parent                     = parent.AddGroupBox(name);
            parent.Dock                = DockStyle.Fill;
            parent.VerticalAlignment   = VerticalAlignment.Fill;
            parent.HorizontalAlignment = HorizontalAlignment.Fill;
        }

        var grid                 = new Grid();
        grid.Dock                = DockStyle.Fill;
        grid.RowCount            = (int)rows;
        grid.ColumnCount         = (int)columns;
        grid.VerticalAlignment   = VerticalAlignment.Fill;
        grid.HorizontalAlignment = HorizontalAlignment.Fill;
        parent.Children.Add(grid);

        return grid;

    }
}

And I am getting this... image

What I was expecting was the group box expanded the the whole window rect and the None and Blocks button to be layed out horizontally like this... a, b

generalloki commented 6 months ago
DoInsideLayout(()=>
{
// Layout initialization here
});

In order to proceed with this issue further, I need

Shadowblitz16 commented 5 months ago

Closing for now. If I run into this issue again I will reopen