Class: XMTextWindow

Class: XMTextWindow

(Direct child class of XMWindow)

This is a standard text window class used for
the output of status information. It's
basically just a big character buffer.

Example:
	$win = new XMTextWindow(); # it's still hidden
	$win->move(0, 0);
	$win->resizeChars(30, 100);
	$win->show();
	$win->setCursor(14, 0);
	$win->print("Some nice heading\n");

Table 3.8. Functions

clear clearEOL clearLine
getCharAt getColumns getCursorX
getCursorY getLines newline
print printANSI resetAttributes
resizeChars scrollColumns scrollLines
setBold setBlinking setCursor
setFont setIntensive setReverse
setUnderline setBGColor setFGColor

clear

Synopsis: XMTextWindow::clear(  )

Guess what?

Example:
	$win->clear();


clearEOL

Synopsis: XMTextWindow::clearEOL(  )

Clear from the current cursor position to the end
of the line.

Example:
	$win->setCursor(13, 14);
	$win->clearEOL();


clearLine

Synopsis: XMTextWindow::clearLine(  )

Clear the current line (the one the cursor is in).

Example:
	$win->setCursor(0, 25);
	$win->clearLine();


getCharAt

Synopsis: XMTextWindow::getCharAt( x, y )

Return the character you can see at position
(x, y) inside the window.

Example:
	$char = $win->getCharAt(2, 5);


getColumns

Synopsis: XMTextWindow::getColumns(  )

Get the window's width in columns, e.g. how
many characters fit into a line.

Example:
	$width = $win->getColumns();


getCursorX

Synopsis: XMTextWindow::getCursorX(  )

Get the x-coordinate of the current cursor position.

Example:
	$x = $win->getCursorX();


getCursorY

Synopsis: XMTextWindow::getCursorY(  )

Get the y-coordinate of the current cursor position.

Example:
	$y = $win->getCursorY();


getLines

Synopsis: XMTextWindow::getLines(  )

Get the window's height in lines, e.g. how
many characters fit into a row.

Example:
	$height = $win->getLines()


newline

Synopsis: XMTextWindow::newline(  )

The same as $win->print("\n") would do on a XMTextBufferWindow.
XMTextWindows don't evaluate \n, so you have to use newline() instead.

Example:
	$win->print("Hallo");
	$win->newline();


print

Synopsis: XMTextWindow::print( text )

Print some text to the window. ANSI control sequences
are not processed, use printANSI for text directly
from the mud server.

Example:
	$win->print("Hey\nnext line\n")


printANSI

Synopsis: XMTextWindow::printANSI( text )

Print ANSI formatted text to the window. You can
simply pass anything coming from the server. 
Pay attention when using regexps on ANSI formatted
text!

Example:
	$win->printANSI($textFromServer);


resetAttributes

Synopsis: XMTextWindow::resetAttributes(  )

Reset all ANSI attributes (color and state).

Example:
	$win->setBold(1);
	$win->setBGColor(RED);
	$win->print("bold and red");
	$win->resetAttributes();
	$win->print("just plain");


resizeChars

Synopsis: XMTextWindow::resizeChars( width, height )

Resize the window so that exactly width
characters fit in a line and height 
characters in a row.

Example:
	$win->resizeChars(23, 42);


scrollColumns

Synopsis: XMTextWindow::scrollColumns( num )

Scroll the window's content by num columns.
A positive value means scrolling right,
a negative scrolling to the left.

Example:
	$win->scrollColumns(3);


scrollLines

Synopsis: XMTextWindow::scrollLines( num )

Scroll the window's content by num lines. A
positive value means scrolling down (like
the page down key), a negative scrolling up.

Example:
	$win->scrollLines(-3);


setBold

Synopsis: XMTextWindow::setBold( state )

Set the default printing style to bold,
if state is true, otherwise to unbold.

Example:
	$win->setBold(1);


setBlinking

Synopsis: XMTextWindow::setBlinking( state )

THIS IS CURRENTLY _NOT_ SUPPORTED!!!!!!!
Set the default printing style to blinking,
if state is true, otherwise to unblinking.

Example:
	$win->setBlinking(1);


setCursor

Synopsis: XMTextWindow::setCursor( x, y )

Set the cursor to position (x, y) inside
the window.

Example:
	$win->setCursor(4, 4);


setFont

Synopsis: XMTextWindow::setFont( name, size )

Set the window's font to name and size.

Example:
	$win->setFont("fixed", 15); # somehow large...


setIntensive

Synopsis: XMTextWindow::setIntensive( state )

Set the default printing style to intensive,
if state is true, otherwise to unintensive.

Example:
	$win->setIntensive(1);


setReverse

Synopsis: XMTextWindow::setReverse( state )

Set the default printing style to reverse,
if state is true, otherwise to unreverse.

Example:
	$win->setReverse(1);


setUnderline

Synopsis: XMTextWindow::setUnderline( state )

Set the default printing style to underline,
if state is true, otherwise to ununderline.

Example:
	$win->setUnderline(1);


setBGColor

Synopsis: XMTextWindow::setBGColor( color )

Set the window's background color to a color
from 0 to 7. There are also color constants
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA,
CYAN and WHITE.

Example:
	$win->setBGColor(RED); # is equal to
	$win->setBGColor(1);


setFGColor

Synopsis: XMTextWindow::setFGColor( color )

Set the window's foreground color to a color
from 0 to 7. There are also color constants
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA,
CYAN and WHITE.

Example:
	$win->setFGColor(RED); # is equal to
	$win->setFGColor(1);


KDE Logo