#include <TxtPad.h>
Public Types | |
enum | Justification { RIGHT, LEFT, TOP, BOTTOM, JUSTIFIED } |
Public Member Functions | |
TxtPad (int x, int y, char background= ' ') | |
Creates a TxtPad of given size and background. | |
TxtPad () | |
Creates an empty TxtPad, with blank background. | |
void | resize (int x, int y) |
Resizes the TxtPad. | |
void | set (int x, int y, char c) |
Explicitly set a particular position to the given character. | |
char | get (int x, int y) |
Explicitly retrieve the character at a given position. | |
int | getXdim () |
Accessor method. | |
int | getYdim () |
Accessor method. | |
void | frame () |
Draws a frame around the TxtPad. | |
void | clear () |
Clears the TxtPad by setting all locations to the background character. | |
void | drawSquare (int xMin, int yMin, int xMax, int yMax) |
Draws a square in the TxtPad. | |
void | insert (int xMin, int yMin, TxtPad &t) |
Inserts a smaller TxtPad into this one at the given position. | |
void | print (int x, int y, const string &str, Justification j=LEFT) |
Writes a string into the TxtPad at the given position, with the given justification. | |
void | printVert (int x, int y, const string &str, Justification j=TOP) |
Writes a vertical string to the TxtPad. | |
void | print (int x, int y, int value, Justification j=RIGHT) |
Writes an integer to the TxtPad, using the given justification. | |
void | print (int x, int y, float value, Justification j=RIGHT, int decimalPlaces=1) |
Writes a floating point number to the TxtPad, using the given justification. | |
Public Attributes | |
int | xDim |
int | yDim |
vector< vector< char > > | pad |
char | background |
Friends | |
ostream & | operator<< (ostream &, TxtPad &) |
Writes the TxtPad to the output stream. |
|
|
|
Creates a TxtPad of given size and background.
|
|
Creates an empty TxtPad, with blank background.
|
|
Clears the TxtPad by setting all locations to the background character.
|
|
Draws a square in the TxtPad.
|
|
Draws a frame around the TxtPad. This doesn't change the size of the TxtPad; rather it uses up one character width on all sides for the frame. |
|
Explicitly retrieve the character at a given position.
|
|
Accessor method.
|
|
Accessor method.
|
|
Inserts a smaller TxtPad into this one at the given position.
|
|
Writes a floating point number to the TxtPad, using the given justification. It just starts by converting it to a string and calling print(string).
|
|
Writes an integer to the TxtPad, using the given justification. It just starts by converting it to a string and calling print(string).
|
|
Writes a string into the TxtPad at the given position, with the given justification. Will complain if string is altogether out of range, otherwise will quietly clip if needed.
|
|
Writes a vertical string to the TxtPad. Will complain if string is altogether out of range, otherwise will quietly clip if needed.
|
|
Resizes the TxtPad.
|
|
Explicitly set a particular position to the given character.
|
|
Writes the TxtPad to the output stream.
|
|
|
|
|
|
|
|
|