102 unsigned int draw_begin = 0;
103 unsigned int draw_end = this->item.size();
105 if (this->height < (
int)this->item.size())
109 draw_end = this->height - 1;
111 else if ((
int)this->
currentIndex < ((
int)this->item.size() - this->height/2) - 1)
118 draw_begin = this->item.size() - this->height;
123 for (
unsigned int curitem = draw_begin, yoffset = 0;
125 curitem++, yoffset++)
129 if ((curitem == draw_begin) && (curitem != 0))
131 window->
print(
"(more)",
132 this->x + this->width/2 - 3,
134 Colors::pair(COLOR_WHITE, COLOR_DEFAULT));
139 if ((curitem == draw_end - 1) && (curitem != this->item.size() - 1))
141 window->
print(
"(more)",
142 this->x + this->width/2 - 3,
143 this->y + yoffset + 1,
144 Colors::pair(COLOR_WHITE, COLOR_DEFAULT));
160 if (! this->item[curitem])
162 for (
int j = 0; j < (this->width); j++)
163 window->
printChar(((Globals::Screen::fancy_borders) ?
168 Colors::pair(COLOR_WHITE, COLOR_DEFAULT));
172 this->item[curitem]->
draw(window,
179 (this->item[curitem] == this->
current));
185 if (InputManager::noKeyPressed())
188 if (InputManager::isPressed(
"down") ||
189 InputManager::isPressed(KEY_DOWN) ||
190 InputManager::isPressed(
'\t'))
193 else if (InputManager::isPressed(
"up") ||
194 InputManager::isPressed(KEY_UP) ||
195 InputManager::isPressed(KEY_BTAB))
198 else if (InputManager::isPressed(KEY_HOME) ||
199 InputManager::isPressed(KEY_PPAGE))
202 else if (InputManager::isPressed(KEY_END) ||
203 InputManager::isPressed(KEY_NPAGE))
206 else if (InputManager::isPressed(KEY_ENTER) ||
207 InputManager::isPressed(
'\n'))
212 this->current->type == MenuItem::LABEL)
void print(std::string str, int x, int y, ColorPair pair=0)
Shows text #str at x y on the window with color #pair.