Пример #1
0
        private void layoutHandler(object sender, LayoutEventArgs e)
        {
            int totalH   = this.ClientSize.Height;
            int menuH    = this.menuStrip1.Height;
            int tileBoxW = this.ClientSize.Width / 2;

            var tbLayout = ToolBoxOrientation.None;

            TileWindow tbWnd = toolBox.CurrentWindow;

            if (tbWnd == inputWnd)
            {
                tbLayout = ToolBoxOrientation.Left;
            }
            else if (tbWnd == spriteWnd)
            {
                tbLayout = ToolBoxOrientation.Right;
            }

            inputWnd.UpdateLayout(0, tileBoxW, totalH, menuH);
            spriteWnd.UpdateLayout(tileBoxW, tileBoxW, totalH, menuH);

            toolBox.UpdateLayout(tbLayout, this.ClientSize);
            if (toolBox.IsActive && tbWnd != null)
            {
                int wndMaxH = totalH - (menuH + tbWnd.ScrollXHeight);
                tbWnd.ReduceWindowTo(wndMaxH - toolBox.Minimum.Height);
            }

            UpdateMinimumSize();

            inputWnd.UpdateBars();
            spriteWnd.UpdateBars();
            Draw();
        }