diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-16 22:35:06 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-16 22:35:06 +0000 |
commit | 12356c8b5b7002cdffaa6a737f54806f52241bfb (patch) | |
tree | 8c2f46d37296420839b5cb3b9a231b5af94b31e5 /src/gui/textfield.cpp | |
parent | c6ee43355e49e4099fdb2e1b26bf29eddcee130a (diff) | |
download | mana-12356c8b5b7002cdffaa6a737f54806f52241bfb.tar.gz mana-12356c8b5b7002cdffaa6a737f54806f52241bfb.tar.bz2 mana-12356c8b5b7002cdffaa6a737f54806f52241bfb.tar.xz mana-12356c8b5b7002cdffaa6a737f54806f52241bfb.zip |
Removed datafile and configfile and any leftover old GUI drawing code.
Diffstat (limited to 'src/gui/textfield.cpp')
-rw-r--r-- | src/gui/textfield.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp index 0d9a21c3..ba278718 100644 --- a/src/gui/textfield.cpp +++ b/src/gui/textfield.cpp @@ -22,13 +22,28 @@ */ #include "textfield.h" -#include "gui.h" - +#include "../resources/resourcemanager.h" TextField::TextField(const std::string& text): gcn::TextField(text) { setBorderSize(2); + + // Load the skin + ResourceManager *resman = ResourceManager::getInstance(); + Image *textbox = resman->getImage("core/graphics/gui/textbox.bmp"); + int gridx[4] = {0, 9, 16, 25}; + int gridy[4] = {0, 4, 19, 24}; + int a = 0, x, y; + + for (y = 0; y < 3; y++) { + for (x = 0; x < 3; x++) { + skin.grid[a] = textbox->getSubImage( + gridx[x], gridy[y], + gridx[x + 1] - gridx[x] + 1, gridy[y + 1] - gridy[y] + 1); + a++; + } + } } void TextField::draw(gcn::Graphics *graphics) @@ -59,5 +74,5 @@ void TextField::drawBorder(gcn::Graphics *graphics) x -= bs; y -= bs; - draw_skinned_rect(buffer, &gui_skin.textbox.bg, x, y, w, h); + ((Graphics*)graphics)->drawImageRect(x, y, w, h, skin); } |