applicius/dhek — pull request #137 by cchantep (2014-05-27 11:16:44+00:00)
Title: DHEK31 - Create textcell between

## Context

On PDF like this one:
![1](https://cloud.githubusercontent.com/assets/166062/3080413/d147596e-e4af-11e3-96ba-628618f4206e.png)

Add first cell (index = 0).
![2](https://cloud.githubusercontent.com/assets/166062/3080414/d148ecc0-e4af-11e3-8c94-c8c6acc0ca8d.png)

Add second cell (index = 1).
![3](https://cloud.githubusercontent.com/assets/166062/3080416/d14b17a2-e4af-11e3-8d8b-a3924d8195e6.png)

Add last cell (index = *N*, in this example 29).
![4](https://cloud.githubusercontent.com/assets/166062/3080415/d1493842-e4af-11e3-8672-edf8e026f5ac.png)

Use selection mode to select these 3 textcells.
![5](https://cloud.githubusercontent.com/assets/166062/3080417/d14c44e2-e4af-11e3-94bd-320e2d58cf39.png)

## Change

- `y`: y of Cell 0 (it's user responsibility to make sure 0, 1 & N are top aligned before).
- `s`: horizontal space between 0 & 1 = cell1.x - cell0.x + cell0.width.
- `d`: distance between 0 & N = cellN.x + cellX.width - cell0.x
- `m`: number of cell to be created between cell 1 & N = d / (cell0.width + s)

When new button in mode toolbar is clicked:
- Create textcells with same `name` property from index 2 until N-1.
- Use `y` for each of these cells.
- Auto-increment `index` property.
- As in distribute operation, make sure each cell is spaced from previous one by `s` (e.g. cell2.x = cell1.x + cell1.width + s).
- Finally index of cellN is updated = m + 1

![6](https://cloud.githubusercontent.com/assets/166062/3080418/d15b56f8-e4af-11e3-862e-5329c273afa8.png)