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

This commit is contained in:
2016-09-17 12:04:46 +00:00
parent bdf3c77dcf
commit 362c6bf505
2 changed files with 72 additions and 2 deletions

View File

@@ -59,6 +59,59 @@ void TileSimple::drawEvent(PIScreenDrawer * d) {
TileScrollBar::TileScrollBar(const PIString & n) {
direction = Vertical;
thickness = 1;
minimum_ = value_ = 0;
maximum_ = 100;
}
void TileScrollBar::setMinimum(int v) {
minimum_ = v;
_check();
}
void TileScrollBar::setMaximum(int v) {
maximum_ = v;
_check();
}
void TileScrollBar::setValue(int v) {
value_ = v;
_check();
}
void TileScrollBar::_check() {
value_ = piClampi(value_, minimum_, maximum_);
}
void TileScrollBar::sizeHint(int & w, int & h) const {
w = h = 0;
if (direction == Vertical) {
w = thickness;
h = 255;
} else {
h = thickness;
w = 255;
}
}
void TileScrollBar::drawEvent(PIScreenDrawer * d) {
line_char = d->artChar(direction == Vertical ? PIScreenDrawer::LineVertical : PIScreenDrawer::LineHorizontal);
d->fillRect(x_, y_, x_ + width_, y_ + height_, line_char, Green);
if ()
d->drawPixel(cx, y_ + piRound(float(cur) / (content.size_s() - 1) * (lhei - 1)) + 1, ' ', Green, Green);
}
TileList::TileList(const PIString & n): PIScreenTile(n) {
alignment = Left;
focus_flags = CanHasFocus | NextByArrowsHorizontal | NextByTab;
@@ -76,7 +129,6 @@ void TileList::sizeHint(int & w, int & h) const {
void TileList::drawEvent(PIScreenDrawer * d) {
vert_line = d->artChar(PIScreenDrawer::LineVertical);
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());