summaryrefslogtreecommitdiff
path: root/src/gui/listbox.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-26 22:33:53 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-26 22:33:53 +0000
commit9e4f25acd69489d949104eebec690ce5586849e6 (patch)
treedc4fe4483ece1a374bc44280c72e43cfd5725feb /src/gui/listbox.cpp
parent34e18a818a7696629515c39b920ba35b64832748 (diff)
downloadmana-9e4f25acd69489d949104eebec690ce5586849e6.tar.gz
mana-9e4f25acd69489d949104eebec690ce5586849e6.tar.bz2
mana-9e4f25acd69489d949104eebec690ce5586849e6.tar.xz
mana-9e4f25acd69489d949104eebec690ce5586849e6.zip
OpenGL/SDL combined in the same exe. Not in the cutest way, but we'll find a
nicer approach after the release.
Diffstat (limited to 'src/gui/listbox.cpp')
-rw-r--r--src/gui/listbox.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index b45823a6..bf80589a 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -22,6 +22,8 @@
*/
#include "listbox.h"
+#include "../graphics.h"
+#include "../main.h"
ListBox::ListBox():
gcn::ListBox()
@@ -49,10 +51,16 @@ void ListBox::draw(gcn::Graphics *graphics)
for (i = 0; i < mListModel->getNumberOfElements(); ++i)
{
if (i == mSelected) {
- graphics->fillRectangle(
+ if (useOpenGL) {
+ dynamic_cast<gcn::OpenGLGraphics*>(graphics)->fillRectangle(
gcn::Rectangle(0, y, getWidth(), fontHeight));
+ }
+ else {
+ dynamic_cast<gcn::SDLGraphics*>(graphics)->fillRectangle(
+ gcn::Rectangle(0, y, getWidth(), fontHeight));
+ }
}
-
+
graphics->drawText(mListModel->getElementAt(i), 1, y);
y += fontHeight;