Menuhintergrund etwas versetzt

Lnge von StringInput kann immer gesetzt werden
This commit is contained in:
seba 2008-04-01 21:25:26 +02:00
parent ce3456fa98
commit f6881092c8
3 changed files with 12 additions and 3 deletions

View File

@ -132,6 +132,10 @@ std::string MIStringInput::getValue() {
return value;
}
void MIStringInput::setMaxLen(int _maxlen) {
maxlen = _maxlen;
}
// MICheckbox
MICheckBox::MICheckBox(std::string str) : MenuItem(str) {

View File

@ -63,6 +63,7 @@ class MIStringInput : public MenuItem {
void setValue(std::string str);
int getMaxValueLen();
std::string getValue();
void setMaxLen(int _maxlen);
};

View File

@ -142,10 +142,14 @@ void MenuMenu::render() {
//Wenn schatten dann hier...
// bgarea.x += offset;
// bgarea.y += offset;
bgarea.x -= offset/2;
bgarea.y -= offset/2;
glColor4f(0.1f, 0.1f, 0.1f, 0.2f);
GLFontEngine::paintSDLRect(bgarea);
bgarea.x -= offset;
bgarea.y -= offset;
bgarea.x -= offset/2;
bgarea.y -= offset/2;
glColor4f(0.2f, 0.2f, 0.2f, 0.3f);
GLFontEngine::paintSDLRect(bgarea);
@ -153,7 +157,7 @@ void MenuMenu::render() {
}
for(unsigned int i=0; i<menuitems.size(); i++) {
menuitems[i]->render(pos, centermenu, basefontsize, maxwidth, valuewidth, ((unsigned int)itempos==i)&&dohighlight, clen, cvlen, maxlen);
menuitems[i]->render(pos, centermenu, basefontsize, maxwidth, valuewidth, ((unsigned int)itempos==i)&&dohighlight, clen, cvlen, cvlen+extravalwidth+valuewidth);
pos.y += basefontsize + menuitems[i]->getFontSizeAdd() + offset;
}
}