Outcurses: Difference between revisions

Line 132: Line 132:
  -------------                        -------------
  -------------                        -------------
</pre>
</pre>
Now imagine us to have the same 3 tablets, but each is now 4 lines. It is impossible to have two of these tablets wholly onscreen at once, let alone all three. If we started with A focused and at the top, the result after all three tablets have grown will be:
<pre>
-------------                        -------------
| --------- |                        | --------- | A remains at the top, and
| |XX A XX| |                        | |XXXXXXX| | is wholly on-screen. B is
| --------- |                        | |XX A XX| | below it, but we can show
| --------- | ---- "grow tablet" ---> | |XXXXXXX| | only the first two lines.
| |  B  | |                        | |XXXXXXX| | C has been pushed
| --------- |                        | --------- | off-screen.
| --------- |                        | --------- |
| |  C  | |                        | |      | |
| --------- |                        | |  B  | |
-------------                        -------------
</pre>
When a tablet is enlarged, it grows towards the nearest boundary, unless that would result in the focused tablet being moved, in which case the growing tablet instead grows in the other direction (if the tablet is in the middle of the screen exactly, it grows down). There is one exception to this rule: if the tablets are not making full use of the screen, growth is always down (the screen is always filled from the top), even if it moves the focused tablet.
A 12-line screen has three tablets: A (2 lines), B (1 line), C (1 line), filling the screen exactly. B is focused, and grows two lines:
<pre>
-------------                        -------------
| --------- |                        | --------- | B grows down, since it is
| |  A  | |                        | |  A  | | closer to the bottom (3
| |      | |                        | |      | | lines) than the top (4
| --------- | ---- "grow tablet" ---> | --------- | lines). C is pushed almost
| --------- |            B            | --------- | entirely off-screen. A is
| |XX B XX| |                        | |XXXXXXX| | untouched.
| --------- |                        | |XX B XX| |
| --------- |                        | |XXXXXXX| |
| |  C  | |                        | --------- |
| --------- |                        | --------- |
-------------                        -------------
</pre>
Starting with the same situation, A grows by 2 lines instead:
<pre>
-------------                        -------------
| --------- |                        | |      | | A grows up. It would have
| |  A  | |                        | |  A  | | grown down, but that would
| |      | |                        | |      | | have moved B, which has
| --------- | ---- "grow tablet" ---> | --------- | the focus. B and C remain
| --------- |            A            | --------- | where they are; A moves
| |XX B XX| |                        | |XX B XX| | partially off-screen.
| --------- |                        | --------- |
| --------- |                        | --------- |
| |  C  | |                        | |  C  | |
| --------- |                        | --------- |
-------------                        -------------
</pre>
If we started with the same situation, and B grew by 7 lines, it would first
push C entirely off-screen (B would then have four lines of text), and then
push A off-screen. B would then have eight lines of text, the maximum on a
12-line screen with both types of borders.


==Panel animations==
==Panel animations==