Zbex Controlling the text display with putc

From CCARH Wiki
Jump to: navigation, search
Previous chapter
Conditional compiles and other features
Zbex
Manual
Next Chapter
Graphics


Zbex provides escape sequences which control parameters of the display from with a Zbex program. Use putc to send these sequences to Dmuse.


1 Two-character escape sequences

Sequence Effect
<esc>A Cursor Up
<esc>B Cursor Down
<esc>C Cursor Right
<esc>D Cursor Left
<esc>E set Tab
<esc>F Cursor End of Window (End)
<esc>G (none)
<esc>H Cursor Top of Window (Home)
<esc>I Tab
<esc>J Clear Display
<esc>K Clear Line
<esc>L Insert Line
<esc>M Delete Line
<esc>N Copy Line to Buffer
<esc>O Insert Line from Buffer
<esc>P Delete Character
<esc>Q Enter Insert Mode (if ins_mode = OFF)
<esc>R Leave Insert Mode (if ins_mode = ON)
<esc>S Scroll Up
<esc>T Scroll Down
<esc>U Page Up
<esc>V Page Down
<esc>W Scroll Right
<esc>X Scroll Left
<esc>Y Cursor to Column 0
<esc>Z Cursor to End of line

2 Multiple character sequences

2.1 Cursor Addressing

1. Relative addressing: move cursor to <x,y> position in the currently displayed screen. The <x> position in this case is actually absolute, i.e., same as <c> below. Numbering starts with 0, not 1. Numbers connected to "Y" must have at least two digits. (e.g., 09 = 9).

              <esc>&a <column number> x <row number> Y 
              <esc>&a <column number> X 
              <esc>&a <row number> Y 

2. Absolute addressing: move cursor to <c,r> position in the currently displayed window. Scrolling works, but you cannot move to a row below the data at the bottom a window. Numbering starts with 0. Numbers connected to "R" must have at least two digits. (e.g., 09 = 9).

              <esc>&a <column number> c <row number> R 
              <esc>&a <column number> C 
              <esc>&a <row number> R 

3. Cursor Relative Addressing: move cursor a relative distance from its present location <+or-c,+or-r> on the screen.

              <esc>&a <+or-><column number> c <+or-><row number> R 
              <esc>&a <+or-><row number> r <+or-><column number> C 
              <esc>&a <+or-><column number> C 
              <esc>&a <+or-><row number> R 

Note: Actually, it is possible to mix and match any of these commands. The end of the sequence is signified by a capital command letter. This means that if we want to back up the cursor 20 positions and goto row 0, we would send the command <esc>&a-20c00R

2.2 Display Enhancements

              <esc>&d@   normal wind_txt 
              <esc>&dA   enhancement 1 
              <esc>&dB   enhancement 2 
              <esc>&dC   enhancement 3 
              <esc>&dD   enhancement 4 
              <esc>&dE   enhancement 5 
              <esc>&dF   enhancement 6 
              <esc>&dG   enhancement 7 
              <esc>&dH   enhancement 8 
              <esc>&dI   enhancement 9 
              <esc>&dJ   enhancement 10 
              <esc>&dK   enhancement 11 
              <esc>&dL   enhancement 12 
              <esc>&dM   enhancement 13 
              <esc>&dN   enhancement 14 
              <esc>&dO   enhancement 15 



Previous chapter
Conditional compiles and other features
Zbex
Manual
Next Chapter
Graphics