Fork of LCD-Window which works with Enhanced TextLCD from Wim

Fork of LcdWindow by Hendrik Lipka

Embed: (wiki syntax)

« Back to documentation index

SubWindow Class Reference

SubWindow Class Reference

A window class using only a part of a parent window for output. More...

#include <subwindow.h>

Inherits Window.

Public Member Functions

 SubWindow (Window *lcd, const unsigned int columnOffset, const unsigned int rowOffset, const unsigned int columns, const unsigned int rows)
 It is assumed that the sub window fill fit into the parent.
virtual void writeText (const unsigned int column, const unsigned int row, const char text[])
 write text into the window, at the given position.
virtual int getColumns ()
virtual int getRows ()
virtual void clear ()
 clear the part of the parent window which is spanned by the sub window.
virtual void character (int column, int row, int c)
 writes a character to the specified position must be public because it is used during delegation
virtual void locate (int column, int row)
 set (internal) cursor to a screen column and row
int putc (int c)
 Write a character to the LCD, on the position specified by the cursor sets the cursor to the next position, and wraps (from right to left, next line, and from bottom back to top)
int printf (const char *format,...)
 Write a formated string to the LCD, on the position specified by the cursor does wrap around (as specified by putc)

Detailed Description

A window class using only a part of a parent window for output.

It is assumed that the sub window fill fit into the parent.

Definition at line 33 of file subwindow.h.


Constructor & Destructor Documentation

SubWindow ( Window lcd,
const unsigned int  columnOffset,
const unsigned int  rowOffset,
const unsigned int  columns,
const unsigned int  rows 
)

It is assumed that the sub window fill fit into the parent.

Parameters:
lcdthe parent window
columnOffsetin which column to start the sub window
rowOffsetin which line to start the sub window
columnsthe width of the sub window
rowsthe height of the sub window

Definition at line 28 of file subwindow.cpp.


Member Function Documentation

void character ( int  column,
int  row,
int  c 
) [virtual]

writes a character to the specified position must be public because it is used during delegation

Parameters:
columnThe horizontal position from the left, indexed from 0
rowThe vertical position from the top, indexed from 0
cthe character

Implements Window.

Definition at line 38 of file subwindow.cpp.

void clear (  ) [virtual]

clear the part of the parent window which is spanned by the sub window.

Implements Window.

Definition at line 64 of file subwindow.cpp.

virtual int getColumns (  ) [virtual]
Parameters:
returnsthe width of the window

Implements Window.

Definition at line 46 of file subwindow.h.

virtual int getRows (  ) [virtual]
Parameters:
returnsthe height of the window

Implements Window.

Definition at line 47 of file subwindow.h.

void locate ( int  column,
int  row 
) [virtual, inherited]

set (internal) cursor to a screen column and row

Parameters:
columnThe horizontal position from the left, indexed from 0
rowThe vertical position from the top, indexed from 0

Definition at line 26 of file window.cpp.

int printf ( const char *  format,
  ... 
) [inherited]

Write a formated string to the LCD, on the position specified by the cursor does wrap around (as specified by putc)

Parameters:
formatA printf-style format string, followed by the variables to use in formating the string.

Reimplemented in TextLCDAdapter.

int putc ( int  c ) [inherited]

Write a character to the LCD, on the position specified by the cursor sets the cursor to the next position, and wraps (from right to left, next line, and from bottom back to top)

Parameters:
cThe character to write to the display

Reimplemented in TextLCDAdapter.

virtual void writeText ( const unsigned int  column,
const unsigned int  row,
const char  text[] 
) [virtual]

write text into the window, at the given position.

this doesn't change the internal cursor position Implementations should check for the length of the text and shorten it accordingly. columns the column where to write row the line where to write text the text to write

Implements Window.