Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Terminal by
Diff: Terminal.cpp
- Revision:
- 4:ee2311717b80
- Parent:
- 3:e72f2addfaf8
- Child:
- 5:d045e3561533
--- a/Terminal.cpp Thu Sep 10 23:39:04 2015 +0000
+++ b/Terminal.cpp Fri Sep 11 00:15:26 2015 +0000
@@ -63,14 +63,22 @@
this->printf("\033[%dm", c);
}
-void frame(int x, int y, int w, int h), int boxtype=1)
+void Terminal::frame(int x, int y, int w, int h, int boxtype)
{
+ char B_H=0, B_V=0, B_TL=0, B_TR=0, B_BL=0, B_BR=0 ;
+ // draw frame
+ // BLOCK=219; SE SI VORRA' USARE IL FILL
switch (boxtype) {
case 0: //singolo
+ B_H =205;
+ B_V =186;
+ B_TL =201;
+ B_TR =187;
+ B_BL= 200;
+ B_BR =188;
break;
case 1: //doppio
- BLOCK =219;
B_H =205;
B_V =186;
B_TL =201;
@@ -81,20 +89,20 @@
}
//riga superiore
this->printf("\033[%d;%dH", x, y);
- this->printf(B_TL);
- for(int i=x+1; i<x+w; i++) this->printf(B_H);
- this->printf(B_TR);
+ this->printf((char *) B_TL);
+ for(int i=x+1; i<x+w; i++) this->printf((char *) B_H);
+ this->printf((char *) B_TR);
//corpo
for(int i=y+1; i<y+h; i++) {
this->printf("\033[%d;%dH", x, i);
- this->printf(B_V);
+ this->printf((char *) B_V);
this->printf("\033[%d;%dH", x+w, i);
- this->printf(B_V);
+ this->printf((char *) B_V);
}
//riga inferiore
this->printf("\033[%d;%dH", x, y+h);
- this->printf(B_BL);
- for(int i=x+1; i<x+w; i++) this->printf(B_H);
- this->printf(B_BR);
+ this->printf((char *) B_BL);
+ for(int i=x+1; i<x+w; i++) this->printf((char *) B_H);
+ this->printf((char *) B_BR);
}
