| Home | Download | Forum | Bug Tracker

|  | v1.4.0

Cell Layout Algorithm
The Cell Layout Algorithm is a dynamic autosizing algorithm aimed at making child controls of dialogs or container windows fully resizeable with a set of predefined rules. The rules are encapsulated in a container-like objects called cells. People with knowledge of HTML table structures will recognize the type of operations at stake.

CLA Details
The types of cells are enumerated below with their characteristics.

Type | Child | Control | Description
--- | --- | --- | ---
Fixed | No | Yes | This cell has a fixed Width or Height or Both. It can host a child control that will be expanded in the direction where it is not fixed to fill the available length. It CANNOT hold child cell structures.
Fill | No | Yes | This cell is expanded in all directions to fill the available space. It can host a child control. It CANNOT hold child cell structures.
Pane | Yes | No | This cell control hosts a collection of stacked horizontal or vertical cell structures. They CANNOT host child controls as these must be hosted by their hosted cell structures. Its child cell structures are added with an associated weight (which can be 0), where the its child cell structures will receive space determined by the total weight proportional factor. For example, if a two cell structures are added with a weight of 1 each, then each will receive 50% of the available space.

The root control is always set to the maximum client area of the dialog minus its padding values.

CLA Visual Example
The following image illustrates a layout of cells which is explained lower. Here is the cell layout pattern of the precedent image with their paths in parenthesis (used in the /xdialog or /xdid commands) :

- Pane - Horizontal (root)
- - Fixed - Width - Weight = 0 (1)
  - Pane - Vertical - Weight = 1 (2)
  - - Fill - Weight = 1 (2 1)
    - Fill - Weight = 2 (2 2)

As we can see clearly, the top right fill cell occupies one third (1 / (1 + 2)) of the available space and the bottom right fill cell occupies the two thirds (2 / (1 + 2)).
Here is another example that illsutrates the usage of fill cells to achieve centering.
The image is again represented by the following layout pattern with their paths in parenthesis (used in the /xdialog or /xdid commands):

- Pane - Horizontal (root)
- - Fill - Weight = 1 (1)
  - Pane - Vertical - Weight = 8 (2)
  - - Fill - Weight = 1 (2 1)
    - Fill - Weight = 8 (2 2)
    - Fill - Weight = 1 (2 3)
  - Fill - Weight = 1 (3)

This layout has the control always centered in the window. It also is always exactly 80% in width and height (8 / 10).

Tutorials
If the DCX documentation is unsufficient for you to start off using CLA (most likely it would have confused you like hell!), here are a few links you can visit for further reading.

- DCX Forum: Help: CLA
- DCX Forum: CLA :(
- Mpdreamz's Cell Layout Algorithm Tutorial
- EinsteinXXL's CLA Tutorial (German)

Feel free to post any messages after reading those threads if you still need any help.

Contact | © 2005-2007 | Last Updated: 25th December, 07