Skip to content
Jean-Philippe Bruyère edited this page Aug 19, 2021 · 10 revisions

Introduction

Each object that appears on screen has to be layed out. The Interface class implement the main layouting queue in which graphical objects has to be added in order to be rendered.

This queue accept classes implementing the ILayoutable interface. The Widget class already implements ILayoutable, so for normal widget behavior, default implementation could be sufficient.

/images/Widget.png

Size properties

public Measure Width;
public Measure Height;

Width and Height properties are of type Measure. This class allows the declaration of cotes as:

  • Fixed integer: that represent the size in pixels.
  • Integer followed by the % signs: declare a proportional size, based on the size of the client area of the parent.
  • Stretched keyword: The widget will be stretched to fill the client area of the parent.
  • Fit keyword: The widget will be sized on its content.

Margin property

public int Margin;

Margin is a single int value indicating a gap in pixels between the widget bounds and the client area. By default, this gap is filled with the background fill, but overriding OnDraw method could allow you to change it.

Clone this wiki locally