Display text on LCD displays (even on multiple ones). Allow to create windows (frames) on display, and to combine them (split, add, duplicate, scroll). See http://mbed.org/users/hlipka/notebook/lcdwindow/ for more information.

Dependents:   Mbell

Revision:
2:5ac5bab7daaf
Parent:
1:65f72ed914fa
Child:
3:e5d5e2fe4bf6
--- a/multiwindow.cpp	Tue Nov 16 20:49:18 2010 +0000
+++ b/multiwindow.cpp	Sat Nov 27 22:54:13 2010 +0000
@@ -26,20 +26,36 @@
 MultiWindow::MultiWindow(vector<Window*> lcds) {
     _lcds=lcds;
     int len=_lcds.size();
-    _height=0;
+    _rows=0;
     for (int i=0;i<len;i++) {
-        _height+=_lcds[i]->getHeight();
+        _rows+=_lcds[i]->getRows();
     }
-    _width=_lcds[0]->getWidth();
+    _columns=_lcds[0]->getColumns();
 }
 
-void MultiWindow::writeText(const unsigned int line, const unsigned int pos, const char text[]) {
+void MultiWindow::character(int column, int row, int c)
+{
     int len=_lcds.size();
     int lines=0;
     for (int i=0;i<len;i++) {
-        int height=_lcds[i]->getHeight();
-        if (line>=lines && line <lines+height) {
-            _lcds[i]->writeText(line-lines,pos,text);
+        int height=_lcds[i]->getRows();
+        if (row>=lines && row <lines+height) {
+            _lcds[i]->character(column,row-lines,c);
+            break;
+        }
+        lines+=height;
+    }
+}
+
+
+void MultiWindow::writeText(const unsigned int columns, const unsigned int row, const char text[]) {
+    int len=_lcds.size();
+    int lines=0;
+    for (int i=0;i<len;i++) {
+        int height=_lcds[i]->getRows();
+        if (row>=lines && row <lines+height) {
+            _lcds[i]->writeText(columns,row-lines,text);
+            break;
         }
         lines+=height;
     }