git-svn-id: svn://db.shs.com.ru/pip@249 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-09-01 15:03:56 +00:00
parent bae0456042
commit 5d296fa5a5
14 changed files with 352 additions and 99 deletions

View File

@@ -0,0 +1,44 @@
#include "terminal_tile.h"
#include "piscreendrawer.h"
TileTerminal::TileTerminal(const PIString & n): PIScreenTile(n) {
focus_flags = PIScreenTypes::CanHasFocus;
size_policy = PIScreenTypes::Expanding;
lastp[0] = lastp[1] = lastp[2] = 0;
}
void TileTerminal::drawEvent(PIScreenDrawer * d) {
//piCout << "draw" << visible;
//PIVector<PIVector<PIScreenTypes::Cell> > c = term->content();
d->fillRect(x_, y_, x_ + width_, y_ + height_, cells);
}
bool TileTerminal::keyEvent(PIKbdListener::KeyEvent key) {
lastp[0] = lastp[1];
lastp[1] = lastp[2];
lastp[2] = char(key.key);
if (lastp[0] == '\e' && lastp[1] == '~' && lastp[2] == '.') {
closeRequest();
return true;
}
//piCout << "key";
/*if (!term) return false;
if (PITerminal::isSpecialKey(key.key)) term->write((PIKbdListener::SpecialKey)key.key, key.modifiers);
else {
PIByteArray ba;
ba << PIChar(key.key).toConcole1Byte();
term->write(ba);
}*/
keyPressed(key);
return true;
}
void TileTerminal::resizeEvent(int w, int h) {
/*if (!term) return;
term->resize(w, h);*/
resizeRequest();
}