Browse Source

Menuhintergrund etwas versetzt

Lnge von StringInput kann immer gesetzt werden
seba 13 years ago
parent
commit
f6881092c8
3 changed files with 12 additions and 3 deletions
  1. 4
    0
      glmenu/menuitems.cpp
  2. 1
    0
      glmenu/menuitems.h
  3. 7
    3
      glmenu/menumenu.cpp

+ 4
- 0
glmenu/menuitems.cpp View File

@@ -132,6 +132,10 @@ std::string MIStringInput::getValue() {
132 132
 	return value;
133 133
 }
134 134
 
135
+void MIStringInput::setMaxLen(int _maxlen) {
136
+	maxlen = _maxlen;
137
+}
138
+
135 139
 // MICheckbox
136 140
 
137 141
 MICheckBox::MICheckBox(std::string str) : MenuItem(str) {

+ 1
- 0
glmenu/menuitems.h View File

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

+ 7
- 3
glmenu/menumenu.cpp View File

@@ -142,10 +142,14 @@ void MenuMenu::render() {
142 142
 		//Wenn schatten dann hier...
143 143
 // 		bgarea.x += offset;
144 144
 // 		bgarea.y += offset;
145
+
146
+		bgarea.x -= offset/2;
147
+		bgarea.y -= offset/2;
148
+
145 149
 		glColor4f(0.1f, 0.1f, 0.1f, 0.2f);
146 150
 		GLFontEngine::paintSDLRect(bgarea);
147
-		bgarea.x -= offset;
148
-		bgarea.y -= offset;
151
+		bgarea.x -= offset/2;
152
+		bgarea.y -= offset/2;
149 153
 
150 154
 		glColor4f(0.2f, 0.2f, 0.2f, 0.3f);
151 155
 		GLFontEngine::paintSDLRect(bgarea);
@@ -153,7 +157,7 @@ void MenuMenu::render() {
153 157
 	}
154 158
 
155 159
 	for(unsigned int i=0; i<menuitems.size(); i++) {
156
-		menuitems[i]->render(pos, centermenu, basefontsize, maxwidth, valuewidth, ((unsigned int)itempos==i)&&dohighlight, clen, cvlen, maxlen);
160
+		menuitems[i]->render(pos, centermenu, basefontsize, maxwidth, valuewidth, ((unsigned int)itempos==i)&&dohighlight, clen, cvlen, cvlen+extravalwidth+valuewidth);
157 161
 		pos.y += basefontsize + menuitems[i]->getFontSizeAdd() + offset;
158 162
 	}
159 163
 }

Loading…
Cancel
Save