|
|
|
@ -24,7 +24,11 @@ void MenuItem::setCaption(std::string str) {
|
|
|
|
|
caption = str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MenuItem::render(Punkt2D pos, bool center, int basefontsize, int maxwidth, int valuewidth, bool highlight, int caplen, int vallen) {
|
|
|
|
|
int MenuItem::getMaxValueLen() {
|
|
|
|
|
return (int)value.length();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MenuItem::render(Punkt2D pos, bool center, int basefontsize, int maxwidth, int valuewidth, bool highlight, int caplen, int capvallen, int maxlen) {
|
|
|
|
|
fontengine.setSize(basefontsize+fontsizeadd);
|
|
|
|
|
if(highlight)
|
|
|
|
|
fontengine.setColor(1.0f, 0.0f, 0.0f);
|
|
|
|
@ -39,13 +43,14 @@ void MenuItem::render(Punkt2D pos, bool center, int basefontsize, int maxwidth,
|
|
|
|
|
// center und position ggf. überarbeiten..
|
|
|
|
|
|
|
|
|
|
Punkt2D tmp = pos;
|
|
|
|
|
tmp.x = pos.x - (caplen+vallen+valuewidth)/2;
|
|
|
|
|
// tmp.x = pos.x - (caplen+vallen+valuewidth)/2;
|
|
|
|
|
tmp.x = pos.x - maxlen/2;
|
|
|
|
|
|
|
|
|
|
// tmp.x = pos.x - valuewidth/2 - fontengine.getTextWidth(caption)/2;
|
|
|
|
|
// tmp.x = pos.x - caplen - valuewidth/2;
|
|
|
|
|
fontengine.renderLine(caption, (int)tmp.x, (int)tmp.y, false);
|
|
|
|
|
|
|
|
|
|
tmp.x += caplen+valuewidth;
|
|
|
|
|
tmp.x += capvallen+valuewidth;
|
|
|
|
|
fontengine.renderLine(value, (int)tmp.x, (int)tmp.y, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -54,6 +59,10 @@ bool MenuItem::isSelectable() {
|
|
|
|
|
return (!grey)&&selectable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MenuItem::hasValue() {
|
|
|
|
|
return usevalue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MenuItem::setFontSizeAdd(int fsa) {
|
|
|
|
|
fontsizeadd = fsa;
|
|
|
|
|
}
|
|
|
|
|