General Concept

Control

Every GUI element in Squid is a subclass of Control.
It provides layouting, clipping, drawing and event handling.

Desktop

The root element of every Squid GUI is the Desktop.
It serves as a canvas on which you place your controls.

public class MyGUI: Desktop
{
   public MyGUI()
   {
      Label label = new Label();
      Button button = new Button();

      this.Controls.Add(label);
      this.Controls.Add(button);
   }
}

Custom controls

You can easily create your own controls

public class CustomControl: Control
{
   public CustomControl()
   {
      Size = new Point(128, 32);
   }
}

Child controls

Controls can be nested abritrarily  to create complex hierarchies.
Child controls come in two flavours:

Private: Elements

Every control has a collection of private children.
For example: CheckBox uses 1 Label and 1 Button
Using the Elements collection makes sure they cannot be removed.

public class CustomControl: Control
{
   public CustomControl()
   {
      Size = new Point(128, 32);

      Button button = new Button();
      button.Size = new Point(32, 32);
      // immutable child
      Elements.Add(button);
   }
}
Public: IControlContainer

Controls implementing this interface expose a collection of public child controls.
For example: Frame, Panel, Window

public class CustomControl: Control, IControlContainer
{
   public ControlCollection Controls { get; set; }

   public CustomControl()
   {
      Size = new Point(128, 32);

      Button button = new Button();
      button.Size = new Point(32, 32);
      // mutable child
      Controls.Add(button);
   }
}

Elements and Controls don’t share dockspace.
Elements are always drawn on top of Controls