diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-14 13:50:25 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-14 13:50:25 +0000 |
commit | 976b4da70227ab97607c51be05a20f4ecfca9325 (patch) | |
tree | d77bfb869b6337f1747b34e8f053f3acddbc4b54 /src/gui/radiobutton.cpp | |
parent | 5a1007fa3e827c03bb86db71cb26dfd4c485f28d (diff) | |
download | mana-976b4da70227ab97607c51be05a20f4ecfca9325.tar.gz mana-976b4da70227ab97607c51be05a20f4ecfca9325.tar.bz2 mana-976b4da70227ab97607c51be05a20f4ecfca9325.tar.xz mana-976b4da70227ab97607c51be05a20f4ecfca9325.zip |
Removed 9 cases of load_bitmap.
Diffstat (limited to 'src/gui/radiobutton.cpp')
-rw-r--r-- | src/gui/radiobutton.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index f3aab388..97c93954 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -22,32 +22,41 @@ */ #include "radiobutton.h" +#include "../resources/resourcemanager.h" -RadioButton::RadioButton(const std::string& caption, const std::string& group, bool marked): - gcn::RadioButton(caption,group, marked) +RadioButton::RadioButton(const std::string& caption, const std::string& group, + bool marked): + gcn::RadioButton(caption, group, marked) { + ResourceManager *resman = ResourceManager::getInstance(); + radioNormal = resman->getImage("Skin/radioout.bmp"); + radioChecked = resman->getImage("Skin/radioin.bmp"); + radioDisabled = resman->getImage("Skin/radioout.bmp"); + radioDisabledChecked = resman->getImage("Skin/radioin.bmp"); } -void RadioButton::drawBox(gcn::Graphics* graphics) { - BITMAP *box = NULL; +void RadioButton::drawBox(gcn::Graphics* graphics) +{ + Image *box = NULL; int x, y; getAbsolutePosition(x, y); if (mMarked) { if (false /*disabled*/) { - box = gui_skin.radiobutton.disabled_checked; + box = radioDisabledChecked; } else { - box = gui_skin.radiobutton.checked; + box = radioChecked; } } else if (false /*disabled*/) { - box = gui_skin.radiobutton.disabled; + box = radioDisabled; } else { - box = gui_skin.radiobutton.normal; + box = radioNormal; } x += 2; y += 2; - if(box != NULL) - masked_blit(box, gui_bitmap, 0, 0, x, y, box->w, box->h); + if (box != NULL) { + box->draw(gui_bitmap, x, y); + } } |