pisd
git-svn-id: svn://db.shs.com.ru/pip@43 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -95,8 +95,10 @@ void TileList::sizeHint(int & w, int & h) const {
|
||||
|
||||
void TileList::drawEvent(PIScreenDrawer * d) {
|
||||
lhei = height - 2;
|
||||
int osp = piMini(3, lhei / 4);
|
||||
int is = piClampi(offset, 0, piMaxi(0, content.size_s() - 1)), ie = piClampi(offset + lhei, 0, content.size_s());
|
||||
if (is > 0) d->drawText(x, y, PIString(" /\\ ").repeat(width / 4), Green, Default, Bold);
|
||||
//piCout << is << ie << offset << lhei << content.size_s();
|
||||
for (int i = is; i < ie; ++i) {
|
||||
Row & r(content[i]);
|
||||
bool sel = i == cur && has_focus;
|
||||
@@ -178,6 +180,7 @@ bool TileList::keyEvent(PIKbdListener::KeyEvent key) {
|
||||
if (cur >= content.size_s()) cur = content.size_s() - 1;
|
||||
if (cur - offset >= lhei - osp) offset += oo;
|
||||
if (offset >= content.size_s() - lhei) offset = content.size_s() - lhei;
|
||||
if (offset < 0) offset = 0;
|
||||
return true;
|
||||
case PIKbdListener::Home:
|
||||
cur = offset = 0;
|
||||
@@ -185,6 +188,7 @@ bool TileList::keyEvent(PIKbdListener::KeyEvent key) {
|
||||
case PIKbdListener::End:
|
||||
cur = content.size_s() - 1;
|
||||
offset = content.size_s() - lhei;
|
||||
if (offset < 0) offset = 0;
|
||||
return true;
|
||||
case PIKbdListener::Return:
|
||||
if (cur >= 0 && cur < content.size_s())
|
||||
|
||||
Reference in New Issue
Block a user